Page 1 of 1

Validation when 2 Browser Tabs in Google Chrome?

Posted: Mon Nov 24, 2014 2:32 pm
by Fergal
I have a test that validates the text in the footer of a web page. At the time the test is run in Chrome, there are two browser tabs open. The text to be validated is in the open / active browser tab. However, when I run the test, Ranorex tries to validate the text in the footer of the inactive browser window and hence the test fails.

How can I ensure the test attempts to validate the text in the correct / active browser tab?

Thanks!

Re: Validation when 2 Browser Tabs in Google Chrome?

Posted: Mon Nov 24, 2014 3:02 pm
by CookieMonster
Hi Fergal,

Did you try to validate the visible property of the dom?

Regards
Dan

Re: Validation when 2 Browser Tabs in Google Chrome?

Posted: Mon Nov 24, 2014 3:48 pm
by Fergal
Thanks Dan. I have set the "Use Ensure Visible" property of the item I am trying to validate, to "True" and the test still fails, i.e. the test still gets the text from the footer of the inactive tab.

Is that what you asked me?

Thanks again!

Edit
I have added a test step to check that the repository item is visible. That test step passes.

Plus, I re-recorded the step to validate the text, with the browser tab open. Even, when I run the text validation step, immediately after recording it, the test step still fails (because it is reading the text value from the inactive tab.

Re: Validation when 2 Browser Tabs in Google Chrome?

Posted: Mon Nov 24, 2014 4:17 pm
by krstcs
You could add the following to your web document's RanoreXPath: " and @visible='true'"

Code: Select all

/dom[@domain='www.mydomain.com' and @visible='true']
This will make Ranorex only check the web document that is actually visible.

Re: Validation when 2 Browser Tabs in Google Chrome?

Posted: Mon Nov 24, 2014 4:30 pm
by Fergal
krstcs wrote:You could add the following to your web document's RanoreXPath: " and @visible='true'"

Code: Select all

/dom[@domain='www.mydomain.com' and @visible='true']
...
Thanks very much krstcs, that works perfectly :)