Managing Browser Tabs
Managing Browser Tabs
Hello, I was just wondering how Ranorex manages browser tabs. For example, if I want to close a browser tab, how can I accomplish that? If I want a test to focus on a certain tab, how do I do that? I searched for this question in the forum, but the responses appear to be dated.
Re: Managing Browser Tabs
Hi,
I'm afraid, there is no simple or automatic solution for handling browser tabs. Browser tabs are a part of browser form and each browser uses different structure of UI. So, in case you need to run the same test on multiple browsers, you will have to find an xpath, with common UI elements. For example, this xpath returns all browser tabs in IE, Chrome and FireFox:
To click specific browser tab, you must, of course specify tabname, so the xpath to find a specific tab, should look like this...
Of course, you can variabilize it and connect it to data connector of your choice...
And here is the result in spy, which displays the same tab in all three browser. You can see how different is the UI structure in each browser
I'm afraid, there is no simple or automatic solution for handling browser tabs. Browser tabs are a part of browser form and each browser uses different structure of UI. So, in case you need to run the same test on multiple browsers, you will have to find an xpath, with common UI elements. For example, this xpath returns all browser tabs in IE, Chrome and FireFox:
Code: Select all
/form[@processname='firefox' or @processname='chrome' or @processname='iexplore']//tabpagelist[@accessiblerole='PageTabList'][@visible='true']//tabpage
Code: Select all
/form[@processname='firefox' or @processname='chrome' or @processname='iexplore']//tabpagelist[@accessiblerole='PageTabList'][@visible='true']//tabpage[@accessiblename>'MacRumors: Apple Mac iPhone']
Code: Select all
/form[@processname='firefox' or @processname='chrome' or @processname='iexplore']//tabpagelist[@accessiblerole='PageTabList'][@visible='true']//tabpage[@accessiblename>$varName]

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration