Selenium with Java 44 - How to handle multiple windows | Difference b/w driver.quit & driver.close

preview_player
Показать описание

How to handle Multiple Window Handles in selenium webdriver :
 
When we have multiple windows in test automation, all we need to do is switching the focus from one window to another.

How To Get the Current Window Id in selenium webdriver?
getWindowHandle: Gets the current window handle, which is an opaque handle to this window that uniquely identifies it within this driver instance.

Possible Interview Questions on switch windows in selenium webdriver:
How to handle multiple Windows

Code :

@Test
public void WindowHandlesDemo1() throws InterruptedException
{
WebDriver driver = new FirefoxDriver();

{
}

{
}
// I'm switching a newly opened window and trying get an element from that window

// I want to close the newly opened window

{
}


}
Рекомендации по теме
Комментарии
Автор

Thank you for watching this video. Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.

AnkproTraining