Hi,
I have a main window (WPF) and a frame in it. A page control is opened in the frame area.
Within the page control, I have TabList control. The Fist tab (tab1) has a WebBrowser Control which host some Html content.
While writing Coded UI Test, I'm able to locate (tab1) control but unable to get its children or the Webbrowser contriol.
I need to find the Webbrowser control or the HTML document it hosts, in order to find Image within the HTML doc.
Following is the XAML for Webbrowser:
<WebBrowser Margin="10" Name="webDocument" AutomationProperties.AutomationId="DOC_01" LoadCompleted="WebDocumentLoadCompleted" Visibility="{Binding Source={StaticResource viewModel},Path= IsWebDocumentVisible ,Converter={StaticResource boolToVis},ConverterParameter=True}" >
<Interactivity:Interaction.Behaviors>
<local:BubbleScrollWheelBehavior/>
</Interactivity:Interaction.Behaviors>
</WebBrowser>
Following is the Coded Ui c# part:
WpfTabList tablist = new WpfTabList(TopParent.MainWindow);
tablist.SearchProperties[WpfTabList.PropertyNames.ClassName] = "Uia.TabControl";
tablist.SearchProperties[WpfTabList.PropertyNames.AutomationId] = "tabControlMain";
WpfTabPage tabDoc = new WpfTabPage(tablist);
tabDoc.SearchProperties[WpfTabPage.PropertyNames.ClassName] = "Uia.TabItem";
tabDoc.SearchProperties[WpfTabPage.PropertyNames.AutomationId] = "tab1";
WpfCustom custom = new WpfCustom(tabDoc);
custom.SearchProperties[WpfCustom.PropertyNames.ClassName] = "HtmlBody";
HtmlImage mUItoolImage = new HtmlImage(custom);
mUItoolImage.SearchProperties[HtmlEdit.PropertyNames.Id] = "tool_MiningTool1";
It is failing and Html part is not being determined.
Your help is much appreciated.
Thanks,
Abhishek
What I have tried:
I've tried the above code. I've also used Inspect.exe to determine the parent child relationship, but still can't get the Webbrowser control anywhere.