Unusual Issue with Application when using WebDriver

68 views
Skip to first unread message

Purusothaman Ramanujam

unread,
May 26, 2016, 2:03:46 PM5/26/16
to Selenium Users
Hi all,

I have an web application and when it's launched a new window opens and the first parent window closes automatically. This is the default behavior of the application which is not in my control.

Since the parent window closes during the launch, I am unable to perform any action using web driver object. This issue occurs only in IE (v11) and in Chrome/FF, the parent window is not closed.

Code Used:

driver.get("my_web_app_url");


When the above code executes, a new window(without address bar) is shown after closing the initial window.

So I get the below exception for any kind of action I do on the driver object. We are not able to switch to the newly launched window.

org.openqa.selenium.NoSuchWindowException: Unable to get browser


Selenium version : 2.51
IE : 11

PS: Application needs to be tested only in IE 11 and its not a public URL. 

David

unread,
May 27, 2016, 12:29:11 PM5/27/16
to Selenium Users
Some thoughts:
  • how about for IE(11), just navigate to the URL of the popup directly rather than the original window that launches the popup. This way you don't have to deal with this issue. If you need  to validate the original URL launches a popup, you could do a try/catch and set a flag on the catch of the error you mentioned to know that it was caught and also to check window count > 1 (in the event it works w/o error somehow), and if either result true (window count > 1 or flag true) then the URL did launch a popup.
  • have your developers enable a test mode, where it won't close the original window after launching popup. Or at least perhaps add a time delay for when it will close. Perhaps it closes too fast for IE11 for Selenium to detect/handle.
  • if you have access to a web server (internal, public, etc.), host a webpage with iframes/frames that loads the original URL. Or just a link to the original URL that opens a popup (which then opens the final popup, the intermediate popup would then close). I'd think starting up IE driver this way, you'd be able to switch windows. In the frames case, it might cause the source/origin window to not close. In the intermediate popup case, since you opened IE driver from a different origin window, that window still exists, and you get the final popup, the one in the middle gets closed - hopefully in that setup, IE driver still has a window reference to work from and would then allow you to switch windows.

R.Purushothaman

unread,
Jun 2, 2016, 6:43:03 AM6/2/16
to seleniu...@googlegroups.com

Hi,

Thanks for suggestion. We already are using Your last idea of using iframe.

But the real big problem is that the subsequent pages also open in a new window which can't be controlled.

Any help on this case?

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/g16EiLjDyz8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0cfb5472-4522-4951-af8b-e8b08f7c3a48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages