I have situation, when click on button opens the new browser window with search results.
Is there any way to connect and focus to new opened browser window?
And work with it, then return back to original(first) window.
I have situation, when click on button opens the new browser window with search results.
Is there any way to connect and focus to new opened browser window?
And work with it, then return back to original(first) window.
This script helps you to switch over from a Parent window to a Child window and back cntrl to Parent window
Modify registry for IE:
Source: Selenium WebDriver windows switching issue in Internet Explorer 8-10
For my case, IE began detecting new window handles after the registry edit.
Taken from the MSDN Blog:
Internet Options:
Code:
The above code includes an if-check to make sure you are not switching to the parent window as
Set<T>
has no guaranteed ordering in Java.WebDriverWait
appears to increase the chance of success as supported by below statement.Quoted from Luke Inman-Semerau: (Developer for Selenium)
Related Posts:
If you have more then one browser (using java 8)
Surya, your way won't work, because of two reasons:
I use iterator and a while loop to store the various window handles and then switch back and forth.