Step1: Store the Main window handle
Step2: Click on the Link which will open the new Browser window
Step3: Switch to the new open browser window.
Step4: Return to the Main window
String Parentwindow = driver.getWindowHandle( );
Step2: Click on the Link which will open the new Browser window
Step3: Switch to the new open browser window.
for ( String currentwindow : driver.getWindowHandles())
driver.switchTo( ).window(currentwindow);
{
// Perform your operations on the current window
driver.close( )
}
Step4: Return to the Main window
driver.switchTo().window(Parentwindow);
really helpful !
ReplyDelete