If you close a pop-up window using close window, all further Selenium2 keywords fail with an exception:
NoSuchWindowException: Message: Window not found. The browser window may have been closed.
Even keywords as "get window names" fail.
The same problem arises when the pop-up window is closed by mouse click or using Javascript window.close().
Minimal set-up for testing: Simple local html file with
click me
And a simple Robot test with
Open browser test.html
Click button bt1
${windows}= Get Window Names
select window cc
sleep 1s
close window
${windows}= Get Window Names
A "sleep" or "wait until keyword succeeds" after "close window" does not help.
This is not a Selenium issue. If you code the scenario (open and close a pop-up window) in Java and the Java API for Selenium, everything works fine. No exceptions arise.
Set-ups:
OS: Mac OS 10.10 and Windows 7
Browsers: Firefox, Chrome, IE10
Selenium 2.44
Selenium2Library 1.6, 1.5, 1.4
If you close a pop-up window using close window, all further Selenium2 keywords fail with an exception:
NoSuchWindowException: Message: Window not found. The browser window may have been closed.
Even keywords as "get window names" fail.
The same problem arises when the pop-up window is closed by mouse click or using Javascript window.close().
Minimal set-up for testing: Simple local html file with
click me
And a simple Robot test with
Open browser test.html
Click button bt1
${windows}= Get Window Names
select window cc
sleep 1s
close window
${windows}= Get Window Names
A "sleep" or "wait until keyword succeeds" after "close window" does not help.
This is not a Selenium issue. If you code the scenario (open and close a pop-up window) in Java and the Java API for Selenium, everything works fine. No exceptions arise.
Set-ups:
OS: Mac OS 10.10 and Windows 7
Browsers: Firefox, Chrome, IE10
Selenium 2.44
Selenium2Library 1.6, 1.5, 1.4