Get browser tab by domain?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mrt
Posts: 257
Joined: Mon Mar 16, 2020 11:31 am

Get browser tab by domain?

Post by mrt » Tue Jan 17, 2023 7:14 pm

Dear all,

in one of my TestSuites I open multiple browser tabs for multiple domains, e.g. in this case using Chrome.
After TestSuite ends, I want to close them in teardown section.

But counting how many I have opened and then "blindly" closing a certain amount of active tabs does not feel right to me.
Also closing the whole browser window does not.

Is there any way to either "remember" each opened tab (so they can be precisely closed afterwards) or do get a tab in e.g. Chrome by its domain in Ranorex?

thanks!

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Get browser tab by domain?

Post by IvanF » Fri Jan 20, 2023 5:12 pm

Hi, are the tabs you open always the same within the suite? If yes, do they get their own repository items or is there focusing/whitelisting that prevents it?
GoogleTabsinRepository.png
You do not have the required permissions to view the files attached to this post.

mrt
Posts: 257
Joined: Mon Mar 16, 2020 11:31 am

Re: Get browser tab by domain?

Post by mrt » Mon Jan 23, 2023 3:29 pm

Hello, no, they do not have their own repository item, there is just one DOM object with repo path:

Code: Select all

/dom[@domain=$myDomain and @state='complete']
so at runtime I do not know the page title.
Of course I could track and save all opened page titles, but I wonder if there isn't a better (simpler) solution to get a browser Ttab by domain?