In the task manager why does Cefsharp created browser instance does not show embedded browser webview where as webview2 shows? - webbrowser-control

I created a browser instance using Cefsharp library. In the task manager I see only the below processes and not embedded browser webview.
But, when I created browser instance using the Microsoft Edge WebView2, I see that process as well present. Since, both are chromium based I was thinking same set of processes to be present.
Any explanation should greatly be helpful.

Both CefSharp and MS Edge WebView2 are based on Chromium, so both libraries use multi-process architecture.
The msedgewebview2.exe process with the --embedded-browser-view=1 command line parameter you see when running MS Edge WebView2 represents a main Chromium process. It doesn't have --type=....
In CefSharp you don't see the main Chromium process, because CefSharp initializes Chromium inside a .NET application which might have absolutely different name.
So, the behavior you see is expected and there's nothing strange or unusual if you know how it works inside ;)

Related

Does Microsoft UI Automation Framework work with Chrome, Python and Java Apps?

I am working on an automation project, in which I need to capture the activities [ application launched, data entered, input type etc.] user performs on a desktop. I came across Microsoft UI Automation framework which so far works well for native windows based applications like MS Office, .NET apps etc. However I did not find any useful information / samples of capturing the information from different web browsers [Chrome is a must], Python apps, Java Apps etc. Can someone please confirm whether MS UI Automation Framework supports such apps. Any working example to extract user activities from these apps would be highly appreciated. Thanks.
Chrome only supports UI Automation for toolbars, tabs, menu, buttons around the web page. Everything that's rendered as a web page is not seen by UIA.
For the web page content, the easiest way is to use Selenium (driven by the ChromeDriver), which is kind of a de facto standard for browsers, and has nothing to do with UIA.
To test if an app supports UIA, and how far it does, it's very easy, just run UIA's Inspect tool and check the UI tree over that application.
Some additions to Simon's answer...
Chrome page content can be seen by UIA if you run chrome --force-renderer-accessibility. Only for existing Chrome process it won't work. Though user can create a new tab chrome://accessibility manually and enable UIA for all or some chosen pages. This method also works for AT-SPI accessibility technology on Linux. Of course, Selenium WebDriver is an industry standard here. But another way exists. Both Mozilla and IE support UIA by default.
Inspect.exe can be simply downloaded from this GitHub repo.
Regarding Java apps it depends on the app type. Your chances is about 50/50.
WxPython or PyQt5 are good for UIA. TkInter or Kivy apps are not.
P.S. There is an example how to drag a file from explorer.exe and drop to Google Drive in Chrome using Python library pywinauto.
I'm a bit late to the party..
But Chromes accessibility features are only activated once something tries to access it's accessibility.
If you call AccessibleObjectFromWindow ([DllImport("oleacc.dll")]) with the window handle an existing chrome window will have its accessibility activated (and you'll see the actual web page content in UIA!).
If the chrome window is opened after your app is running - Chrome pings open processes for any open accessibility apps... for that you use AccessibleObjectFromEvent and the event you're responding to comes from the windows pipeline: EVENT_SYSTEM_ALERT = 0x0002 .
The bottom line is - you have to tell chrome that there's something installed that wants to access it's web page content.
Oh! and your application has to be signed!! Unsigned apps won't be able to access web content - I think that's the same in firefox too.
I hope this helps someone in the future.
See:
https://www.chromium.org/developers/design-documents/accessibility

Blueprism - Not able to spy elements

I am using Blueprism to launch a URL in browser to spy it. I am able to launch the URL using the application modeller, but not able to spy it. The "Identify" option itself does not appear in blue prism. What is the problem and what is the solution ?
In spying a web application, key things to note for your application modeler;
1. your application modeler must be a "Browser-Based Application"
2. Launching from an executable or attaching to one. (Assuming you are launching from an executable from your question)
3. Specify url.
From your question. you are able to launch the browser from the application modeler. the most possible problem is you missing step 1 as mentioned above. Confirm your application modeler is specified as "Browser-Based Application"
Check a few things : is your modeler attached to the browser, are you in the right mode (for ease of use I would recommend using IE in HTML mode), and if that doesn't work try accessibility mode.
Try these simple steps:
Close the browser application and let the Blue Prism open your browser.
Try testing your object in Object Studio.
Now open your application modeler and launch. Check and you will find the identify option appeared.
If you launch application from Google Chrome, then you can get this error because in Google Chrome it's not possible to Spy and launch the applications. Any RPA Tools will support only Internet Explorer

Create/embed Firefox/Chrome base browser in Visual Studio

Im creating a freeware application (long live the free community) and I'm trying to add various features that might drive people to use the application such as implementing whatsapp web https://web.whatsapp.com/ into the app so that the user will always have an "always on top" window with their chats rather than everytime having to switch tabs if they're multitasking on their browser.
The problem i am having is that the built in Browser control with VS 2013 does not work with whatsapp web and i get the option to use supported browsers like firefox...chrome...safari.
Is there anyway to make a VB.NET application open an actual chrome/firefox based browser within itself?
I found an article on Gecko Browser...I am not sure if web.whatsapp.com would see this as a firefox browser: http://www.vbforums.com/showthread.php?692005-Mozilla-Firefox-Gecko-Xulrunner-in-VB-NET-%28versions-14-and-up%29
Help appreciated.

Can I change the rendering engine of the WebBrowser control to an older version?

i have an application with a webbrowsercontrol. this webbrowsercontrol is going to load a page that is not compatible with IE9. (cannot change this because its produced by somebody else) By default VB.NET 2010's webbrowser control uses IE9 renderengine, and can run in some sort of compatibility mode. unfortunately even in compatibility mode the page do not work. is there are way to use a webbrowser control with a genuine IE7 or IE8 render engine? thanks
UPDATE
explaining the problem: i have a page with a JAVA applet inside. this java applet has a popup opening with a textbox. this textbox is forced to stay in front until closed. this works fine in IE7 and IE8. in IE9 however if i move the browser window or access any other application this messagebox jumps to the back. and cant be clicked anymore. my webbrowser (IE9 running any emulation) does not work. it beheaves as if it still would be on IE9 even if i emulate IE7 or IE8.
is there are way to use a webbrowser control with a genuine IE7 or IE8 render engine?
Yes, but it requires that you downgrade the version of Internet Explorer that is installed on the computer to version 7 or 8, which doesn't make for a friendly installation experience.
The issue is that the WebBrowser control always uses the version of IE that is installed on the computer because it simply delegates rendering to the native library shdocvw.dll, the same one that is used by IE itself. In your case, that appears to be IE 9. However, by default, it also runs in IE 7 compatibility mode. You can change this by editing the registry, but you cannot change the version of the rendering engine.
And unfortunately, this means you're out of luck, because running multiple versions of IE on a single computer is not and has never been a supported configuration. It can be accomplished for testing purposes, but it requires additional software and the versions don't play nicely together. Certainly not nicely enough for one to support the standalone IE browser while the other drives the .NET WebBrowser control.
Fixing the code to work properly with IE 9 is the best option. IE 9 represents Microsoft's slow progression towards a standards-compliant browser, and although it still has some quirks, it is worth supporting. I know you said that the website code is maintained by "someone else", but I recommend filing a support request with them—their code is buggy and needs to be fixed. If you (or they) need help with this, they can ask some of our code ninjas web standards experts here on Stack Overflow.
Alternatively, you could explore replacing the WebBrowser control with an alternative control. There are several good ones for the .NET Framework, wrapping the rendering engines used by other popular browsers. For example:
WebKit .NET is a wrapper for the WebKit engine, used by Google Chrome and Apple Safari.
GeckoFX is a wrapper for the Gecko rendering engine, used by Mozilla Firefox.
MozNet is an alternative wrapper for Gecko.
Unfortunately, if the code you're dealing with is so badly written that IE 9's feeble attempt at standards-compliance brings it to its knees, it's unlikely that switching to the rendering engine for another even more standards-compliant browser will bring much success.

Getting black images with selenium.captureScreenshot

I'm executing selenium tests with testng, that are started on a remote system with Selenium RC via hudson (with ssh connection). The remote system is windows xp with MKS Toolkit installed, hence ssh. Tests are NOT executed as a windows service.
I've tried using both captureScreenshot and captureEntirePageScreenshot methods. The first one always produces a black image. The second one creates the correct screen shot but it only works on Firefox and our tests usually pass on Firefox and fail in other browsers, so it is crucial to capture screen shots for the other browsers (mainly IE and Safari). The tests are ran in parallel, with many browser windows open at the same time. I'm not certain if this is what's causing the problem. Any thoughts will be appreciated.
Unfortunately screenshots in Selenium have been problematic from the start in browsers that are not Firefox. This is something that we Selenium Developers have been working on for a while to correct.
The latest work has been updating Snapsie to work in IE. There is a blog post at http://blog.codecentric.de/en/2010/02/remote-screenshots-mit-selenium-und-dem-robot-framework/ that explains what has happened.
I have noticed that if the screen isn't active, i.e. the screensaver has kicked in, it can produce black screenshots.
Edit:
I just had a thought. You can always run Castro to video record your tests and then watch it play back. This is something SauceLabs use to run Selenium in the cloud.
Write a method for this and call that whereever you need to take the screenshot. Use the java.awt package which has been used in selenium. For example, check this site
After setting Windows Auto-Logon, and launching process not as Windows Service, I found how to solve the Remote Desktop with Black Screenshots problem of IEDriverServer.exe, by creating a batch file that disconnects RDP, instead of closing the RDP session with the regular X button:
%windir%\system32\tscon.exe %SESSIONNAME% /dest:console
See more details here:
https://stackoverflow.com/a/24529629/658497
(Although, I would prefer there was a way to run it as the default action, when terminating RDP session with X Windows button).