Unable to close tab?

Ask general questions here.
Eamonn
Posts: 63
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Unable to close tab?

Post by Eamonn » Wed Jul 16, 2014 11:24 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Unable to close tab?

Post by Support Team » Fri Jul 18, 2014 2:38 pm

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)
You do not have the required permissions to view the files attached to this post.

Eamonn
Posts: 63
Joined: Wed Jul 16, 2014 9:30 am
Location: Dundalk, Ireland.

Re: Unable to close tab?

Post by Eamonn » Thu Mar 19, 2015 11:39 am

Markus, Thank you for your reply, this information is most helpful.
Eamonn