Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add fix from SeleniumLibrary issue 220 #70

Closed
elizaleong opened this Issue Jun 25, 2012 · 3 comments

Comments

Projects
None yet
3 participants

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 <
reply@reply.github.com

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:

rtomac#70 (comment)

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

@emanlove emanlove added a commit to emanlove/robotframework-selenium2library that referenced this issue Jan 9, 2014

@emanlove emanlove Added test verifying browser closes if 'Open Browser' is incomplete.
This patch verifies the fix for #70.
21829ec

@emanlove emanlove was assigned Jan 9, 2014

Contributor

emanlove commented Jan 24, 2014

Fixed in #263.

@emanlove emanlove closed this Jan 24, 2014

@emanlove emanlove was unassigned by elizaleong Sep 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment