Page 1 of 1

Unable to close tab?

Posted: Wed Jul 16, 2014 11:24 am
by Eamonn
Using Ranorex 5.0.3 Release, I am testing on Google Chrome version 35.0.1916.153 m.

Can open a Help page via a Help icon on the Application page I'm testing. The Help page opens as a new tab. However, I can not close this tab. I have recorded closing it using Ctrl W keys but when run Ranorex fails. I have recorded locating the 'X' on the tab and using the mouse click on the x in the tab but the Ranorex is seeking the location on the URL address from which the Help page was opened rather than the URL of the help page. I have recorded the closing of the help tab by right clicking on the tab and mouse clicking on the close option. This method also failed.
I then opened the help page twice and ran the Test Case. The Test Case successfully closed each help tab except the last open help tab which it again failed.
Can anyone explain why this is happening or how I could close the last help tab?

Re: Unable to close tab?

Posted: Fri Jul 18, 2014 2:38 pm
by Support Team
Hi Eamonn,

In order to close a specific tab of your Chrome instance, you could for instance use the webdocument-adapter.

For example:
WebDocument webd = @"/dom[@pageurl='http://edition.cnn.com/AFRICA/']";
webd.Close();
This will close only the tab with the specific 'pageurl'. It is also possible to use other attributes to create the webdocument.

The pageurl attribute can be found in the Spy as shown in the screenshot below.
PageUrl.png
regards,
Markus (S)

Re: Unable to close tab?

Posted: Thu Mar 19, 2015 11:39 am
by Eamonn
Markus, Thank you for your reply, this information is most helpful.
Eamonn