WPF application with embedded browser

Sep 8, 2011 at 12:32 AM



Will White allow me to access an embedded web browser which is inside my WPF application?

If not, could I combine White & WATIN/Selenium?






Sep 12, 2011 at 3:16 AM


We had the same situation and we did it using DOM, HTMLDocument from MSHTML.dll.. we had a reasonable success using that.

Sep 12, 2011 at 10:56 AM



Is there any chance you could expand on this? I am an experienced test automation developer but haven't delved into White yet as the requirement to access teh embedded page is teh key requirement in choosing an API for the test framework

Oct 12, 2011 at 6:29 AM

You can use the MSHTML libraries to build your own api that interacts with the browser properties and controls. As far as I know, Selenium cannot be associated with a browser that it has not created. If you have any more information on this please let me know thanks

Dec 2, 2011 at 2:32 PM

Marines2002, I would reply to your inquiry about this, but your status on CodePlex does not allow you to be contacted. We ended up using a "modified" version of Selenium that works with he AutomationElement of the embedded browser.

Dec 16, 2011 at 2:15 PM

Hi guys,

I am just encountering this issue whereby I essentially need to pass off my 'White' actions to an embedded browser to be picked up by either WatiN or Selenium. Are you able to post some sample code of the modified Selenium, or how you have used the MSHTML assemblies please? Cheers. 

Dec 19, 2011 at 2:45 PM

Hi Spoonster, we ended up going the Selenium route because I couldn't convert the embedded browser automation element into a usable form for the Shelldoc or MSHTML. I'll post the modified Selenium code at some point if I can. Here is how you get to the browser automation element. You might be able to do something more useful with it.

First find the IUItem container that holds the embedded browser and then: 

PropertyCondition cond = new PropertyCondition(AutomationElement.ClassNameProperty, "Internet Explorer_Server");

AutomationElementCollection col = container.rnobject.AutomationElement.FindAll(TreeScope.Descendants, cond);