now I am testing Ranorex 2.2(using trial version)
How can I create the instance of the WebDocument object related to the instance of the WebBrowser control in Ranorex v2.2?
Form webBrowser = "pathToWebBrowserForm";
WebDocument doc = webBrowser.FindSingle("//webdocument");
// or use the FindDescendant method
doc = webBrowser.FindDescendant<WebDocument>();gisiman wrote:what is 'pathToWebBrowserForm'?
Form frmMain = "/form[@controlname='form1']";
WebDocument webDoc = frmMain.FindSingle("//webdocument");
webDoc.Navigate("http://www.naver.com");
webDoc.WaitForDocumentLoaded();"Ranorex.ElementNotFoundException: No element found for path '/form[@controlname='form1']' within 10s....
using System.Threading;
// your event handler method
private static void MyButton_Click(EventArgs e)
{
// next line is OK, since it is not a Ranorex method
webBrowserControl1.Navigate("about:blank");
Thread thread = new Thread(new ThreadStart(RunAutomation));
thread.SetApartmentState(ApartmentState.STA);
thread.Name = "RunAutomation";
thread.Start();
}
// code in this method is executed on a separate thread
private static void RunAutomation()
{
Form frmThis = "/form[@controlname='Form1']";
WebDocument webDoc = frmThis.FindDescendant<WebDocument>();
webDoc.Navigate("http://www.naver.com/");
webDoc.WaitForDocumentLoaded();
}Return to Object Identification and Technologies
Users browsing this forum: No registered users and 0 guests