Handling windows and tabs with selenium | Selenium Forum
10% Off Learning Discount Avail now

Handling windows and tabs with selenium

K
kapil khade Post 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

S

Instructor

Support Team Reply 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