Handling windows and tabs with selenium | Selenium Forum
K
kapil khade Posted on 24/03/2020

Want to ask how to differentiate between whether we are handling a window or tab in selenium.

If there is  link on a page which opens a new window or a new tab. So, how can we validate whether it is a new tab or altogether a new window which got opened.

TIA


A
Ashish Thakur Replied on 29/03/2020

Well this seems quite confusing.

You can refer this post where people are discussing. I think this can be done use Javascriptexecutor

https://stackoverflow.com/questions/35159992/selenium-webdriver-determining-if-new-window-or-tab-has-opened-and-if-it-has-fo