How to Switch between Tabs in Browse



I am opening new tab in Browser and I want to get text from the new opening tab .Now the tab that is opened is first one so automation is not able to read text and showing selector issues .Guys,anyone has solution for this?

Thanks in advance.


You need to be more specific with your selectors. For example you need to include the title of the page as well as just the fact that is a browser window e.g. “Chrome.exe”

Alternatively you are able to access the ProcessID or store the browser session as a browser type when you open it. This means you can then refer to that specific browser session rather than just the generic Chrome/Explorer browser.

Hope that helps.


Do note that for modern browsers using ProcessID is not a reliable way, as it’s not a 1:1 relationship.
Browser session (object) is a good way though.