Validation when 2 Browser Tabs in Google Chrome?

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Validation when 2 Browser Tabs in Google Chrome?

Post by Fergal » Mon Nov 24, 2014 2:32 pm

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!

CookieMonster
Certified Professional
Certified Professional
Posts: 74
Joined: Mon Aug 14, 2006 7:17 pm
Location: CH

Re: Validation when 2 Browser Tabs in Google Chrome?

Post by CookieMonster » Mon Nov 24, 2014 3:02 pm

Hi Fergal,

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

Regards
Dan

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Validation when 2 Browser Tabs in Google Chrome?

Post by Fergal » Mon Nov 24, 2014 3:48 pm

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Validation when 2 Browser Tabs in Google Chrome?

Post by krstcs » Mon Nov 24, 2014 4:17 pm

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.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Validation when 2 Browser Tabs in Google Chrome?

Post by Fergal » Mon Nov 24, 2014 4:30 pm

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 :)