Add fix from SeleniumLibrary issue 220
There was a bug against SeleniumLibrary 2.8 which is also present in robotframework-selenium2library I'm wondering if you could incorporate the fix here as it causes Close All Browsers to fail for Suite Teardown.
The problem is here: http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=220#c3
From what I read the same change could be applied to keywords/_browsermanagement.py's open_browser function.
From SeleniumLibrary's _browser.py:
try:
self._selenium.open(url, ignoreResponseCode=True)
self._debug('Opened browser with Selenium session id %s'
% self._selenium.sessionId)
except:
self._cache.register(self._selenium, alias)
raise RuntimeError("Open browser failed")
return self._cache.register(self._selenium, alias)
From Selenium2Library (which also needs to catch browser creation failures and register regardless):
browser = self._make_browser(browser_name,desired_capabilities,ff_profile_dir,remote_url)
browser.get(url)
self._debug('Opened browser with session id %s'
% browser.session_id)
return self._cache.register(browser, alias)
Can you give a test case/code demonstrating this issue?
This seems to work fine for me:
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Check for Teardown after bad URL
Set_Log_Level DEBUG
Open Browser http://iamnotarealwebsite.lol firefox
[Teardown] Close Browser
Problem was specific with chromedriver and ie driver. Firefox worked fine.
You can also look in google group selenium-user, https://groups.google.com/forum/?hl=en&fromgroups#!searchin/selenium-users/os.kill
Please let me know if you need more information than this. Thanks for the support!
On Fri, Jul 20, 2012 at 11:01 AM, hbmartin < [email protected]
wrote:
Can you give a test case/code demonstrating this issue?
This seems to work fine for me:
*** Settings *** Library Selenium2Library *** Test Cases *** Check for Teardown after bad URL Set_Log_Level DEBUG Open Browser http://iamnotarealwebsite.lol firefox [Teardown] Close Browser
Reply to this email directly or view it on GitHub:
https://github.com/rtomac/robotframework-selenium2library/issues/70#issuecomment-7136860
Eliza Leong | QA * Kiva http://www.kiva.org/ – Loans that Change Lives Join us on Twitter http://twitter.com/#%21/kiva, Facebookhttps://www.facebook.com/kiva and LinkedIn http://www.linkedin.com/groups/KIVA-2606?home=&gid=2606! * 875 Howard Street, Suite #340, San Francisco, CA 94103
Fixed in #263.