Page 1 of 1

unable to find dom

Posted: Tue Aug 07, 2018 10:11 pm
by kumprave5
1. unable to find dom but still status is success but surprisingly going into catch block.
void ITestModule.Run()
        {
        	
        	var tm=TestReport.CurrentTestModuleActivity;
        	Script sc = new Script();
			try
			{
				Report.CurrentReportLevel = ReportLevel.Info;
                               TestReport.EnableTracingScreenshots =false;
                             sc._startBrowser("chrome.exe", "https://www.google.com/");
                
                             WebDocument wd ="/form[@title='New Tab - Google Chrome']"; //unable to find dom still satus shows passed
                             LogUtility._info("dom found successfully");
    
			}
			catch(Exception e)
			{
				LogUtility._info("I am in the catch");
                                string status = tm.Status.ToString();
				LogUtility._failure(status, "Test", e, "I am failed");
				
			}
        }
Edit by Support Team: Use code tag for better readability

Re: unable to find dom

Posted: Wed Aug 08, 2018 8:34 am
by Stub
Have you instrumented your browser? If applicable, have you whitelisted your browser in Ranorex v8.2? I don't use Ranorex to interact with web browsers like you are, so your code is unfamiliar to me, but are you waiting long enough for things to happen before looking for something?

Re: unable to find dom

Posted: Wed Aug 08, 2018 1:16 pm
by kumprave5
If possible, can you please suggest your way to interact with web browser?

Re: unable to find dom

Posted: Thu Aug 09, 2018 3:48 pm
by asdf
Have you already tried to simply record some steps in Google Chrome?
Furthermore, I saw that your RxPath is pointing to the form element of Chrome instead of the WebDocument which RxPath should be something like: /dom[@url='www.google.com'].