How to deal with multiple tabs

3,712 views
Skip to first unread message

Venom

unread,
Apr 6, 2012, 2:09:12 AM4/6/12
to robotframework-users
Hi,
I wonder if some of you have similar problem? During test execution
new browser tab is open and I have to check if user were properly
redirected by finding some element on newly opened page. So far tied
with :
Select window but it failed.


Thanks in Advance for any suggestions

Kevin O.

unread,
Aug 27, 2012, 12:03:55 PM8/27/12
to robotframe...@googlegroups.com
Please put the failure text in your posts so we can help you better.  Are you using Internet Explorer? Can you execute Get Window * keywords?

There is a fatal issue regarding multiple windows and IE described here: https://github.com/rtomac/robotframework-selenium2library/issues/10 

Kevin

N.T.

unread,
Apr 24, 2015, 5:04:19 AM4/24/15
to robotframe...@googlegroups.com, lukas...@gmail.com
Hi,

I have a similar issue and I hope my explanation will be more detailed.

So I have a test case where clicking an element opens another window. I just want to confirm if the new window has the element that it should have (eg. Facebook page should have the element for the Facebook cover profile), close that new window, return to the original window then open a new one again.

Here's the script I wrote. Am also placing the Suite Setup and Suite Teardown

Suite Setup       Open Homepage    ${URL}    ${BROWSER}    ${TITLE}
Suite Teardown    Close all Browsers

Get Window Titles
Click Element id=soc-fb
Get Window Titles
Select Window title= Our Page | Facebook
Page Should Contain Element id=fbProfileCover
Close Window
Select Window title=Our Page
Click Element id=soc-pin

And it causes a stack trace issue. I understand that this is because I closed a window, but I thought it would be okay as long as one window is open, which there is.

Here is the stack trace:

Documentation:

Takes a screenshot of the current page and embeds it into the log.

Start / End / Elapsed:20150424 17:45:30.042 / 20150424 17:45:30.134 / 00:00:00.092
17:45:30.133FAILNoSuchWindowException: Message: Window not found. The browser window may have been closed. Stacktrace: at nsCommandProcessor.prototype.execute (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command-processor.js:12343) at Dispatcher.executeAs/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9061) at Resource.prototype.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9208) at Dispatcher.prototype.dispatch (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9155) at WebDriverServer/<.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:12128) at createHandlerFunc/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2058) at ServerHandler.prototype.handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2391) at Connection.prototype.process (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1227) at RequestReader.prototype._handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1681) at RequestReader.prototype._processBody (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1529) at RequestReader.prototype.onInputStreamReady (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1397)
17:45:30.134WARNKeyword 'Capture Page Screenshot' could not be run on failure: NoSuchWindowException: Message: Window not found. The browser window may have been closed. Stacktrace: at nsCommandProcessor.prototype.execute (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command-processor.js:12343) at Dispatcher.executeAs/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9061) at Resource.prototype.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9208) at Dispatcher.prototype.dispatch (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9155) at WebDriverServer/<.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:12128) at createHandlerFunc/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2058) at ServerHandler.prototype.handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2391) at Connection.prototype.process (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1227) at RequestReader.prototype._handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1681) at RequestReader.prototype._processBody (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1529) at RequestReader.prototype.onInputStreamReady (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1397)
17:45:30.137FAILNoSuchWindowException: Message: Window not found. The browser window may have been closed. Stacktrace: at nsCommandProcessor.prototype.execute (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/command-processor.js:12343) at Dispatcher.executeAs/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9061) at Resource.prototype.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9208) at Dispatcher.prototype.dispatch (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:9155) at WebDriverServer/<.handle (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/driver-component.js:12128) at createHandlerFunc/< (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2058) at ServerHandler.prototype.handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:2391) at Connection.prototype.process (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1227) at RequestReader.prototype._handleResponse (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1681) at RequestReader.prototype._processBody (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1529) at RequestReader.prototype.onInputStreamReady (file:///c:/users/t~1/appdata/local/temp/tmpxxcuha/webdriver-py-profilecopy/extensions/fxdr...@googlecode.com/components/httpd.js:1397)

Thing is that there are other tests that will run after this test case is over and I want to get rid of the other windows before that. Is there a way for me to close a specific window, without causing the exception?

Thanks! 
Reply all
Reply to author
Forward
0 new messages