How to switch to the new browser window, which opens after click on the button?
You can switch between windows as below:
// Store the current window handle
String winHandleBefore = driver.getWindowHandle();
// Perform the click operation that opens new window
// Switch to new window opened
for(String winHandle : driver.getWindowHandles()){
driver.switchTo().window(winHandle);
}
// Perform the actions on new window
// Close the new window, if that window no more required
driver.close();
// Switch back to original browser (first window)
driver.switchTo().window(winHandleBefore);
// Continue with original browser (first window)
WebDriver switch to browser opened after click on button
The IEDRIVER has problems when there are other sessions open , just close them in the task manager and the problem is solved .
session cookie lost when click made to a link that opens a window with window.open()
How to click A button on the second window of the browser using Selenium with python
By clicking Google Plus button a new window is open.
You have to switch driver to that new window.
So after clicking on the Google Plus button
new_window = driver.window_handles[1]
driver.switch_to_window(new_window)
Now on the new window you should find an element by the following xpath
//div[@data-identifier='your_email@gmail.com']
and click it
Related Topics
How to Gracefully Handle the Sigkill Signal in Java
How to Find Files That Match a Wildcard String in Java
Handling Interruptedexception in Java
How to Send Large Messages with Kafka (Over 15Mb)
Java Event-Dispatching Thread Explanation
Differencebetween & and && in Java
Which Overload Will Get Selected for Null in Java
Run a Jar File from the Command Line and Specify Classpath
Why Should Java 8's Optional Not Be Used in Arguments
How to Read a Resource File from a Java Jar File
Why Is Creating a Thread Said to Be Expensive
Jtable Not Showing Up on Jframe (Java)
Why Doesn't Java Offer Operator Overloading
Group a List of Objects by an Attribute
If Profiler Is Not the Answer, What Other Choices Do We Have
Why Does the Tostring Method in Java Not Seem to Work for an Array