Robot Framework: Suite Teardown fails when using Close All Browsers Robot Framework: Suite Teardown fails when using Close All Browsers selenium selenium

Robot Framework: Suite Teardown fails when using Close All Browsers


A quick fix would be to add Run Keyword And Ignore Error to your Suite Teardown it will still execute the commands that are valid but will skip the error command something like this works

*** Settings ***Library  Selenium2LibrarySuite Teardown   Run Keyword And Ignore Error  Suite shutdown*** Test Cases ***Test Keyword    Open Browser  http://google.com  chrome*** Keywords ***Suite shutdown     Erro1234r # This should fail due to no keyword named Erro1234r, it skips this and closes all browsers     Close All Browsers


The version of selenium you are using could be causing this.

To see what versions of selenium support what python version you are using check out. https://github.com/robotframework/SeleniumLibrary/blob/master/README.rst#support

*** Settings ***Suite Setup    Open Database ConnectionTest Setup     LoginSuite Teardown    Suite shutdownLibrary    SeleniumLibrary*** Test cases ***......*** Keywords ***Suite shutdown    Disconnect from Database    Close All Browsers


The error BadStatusLine: '' propagates from python's httplib - the core module for http communication (as is obvious by its name :)), and comes from error in the communcation between selenium and the webdriver for the browser.
It has no connection with Robot Framework's SeleniumLibrary/Selenium2Library - it is just a wrapper (a very good one I must admit) over the selenium library.

So look for the error in that direction - the version of your installed selenium library does not work well with the installed chromedriver - one sent to the other data, that was unexpected for the recipient.
I'd suggest to upgrade to the latest versions of both - this hiccups do happen when one is (significantly) newer than the other.