I\'m working with Selenium Automation. In this, When i click a link in a current window, a new window opens. I just want to switch the control to the new window. But i can\'
Yes this is possible. First you need to save the refrence to current window.
String parentWindow= driver.getWindowHandle();
The after having clicked the link, you need to switch to the other window.
List allWindows = driver.getWindowHandles();
for(String curWindow : allWindows){
driver.switchTo().window(curWindow);
}
This is where you perform operations on new window, finally closing it with
driver.close();
and switch back to parent window
driver.switchTo().window(parentWindow);