No keyword with name 'Open Browser' found

17,488

Solution 1

You need to include a line in your Settings section that says

Library | SeleniumLibrary

and you might also need to run

pip install --upgrade robotframework-seleniumlibrary

Good luck!

Solution 2

This type of error message may have several reasons : 1- The number of spacing between keywords and the variable; 2- Lack of loading of the test library; 3- ...

With robot framework the spacing is at least size 4. For exemple Library SeleniumLibrary

Here's a simple test case to open the chrome browser and enter the url https://google.fr :

Style 1 :

*** Settings ***
Documentation     Simple example using SeleniumLibrary.
Library           SeleniumLibrary


*** Test Cases ***
Valid Login
    Open Browser     https://google.fr    chrome

Style 2 :

*** Settings ***
Documentation     Simple example using SeleniumLibrary.
Library           SeleniumLibrary

*** Variables ***
${LOGIN URL}      https://google.fr
${BROWSER}        Chrome

*** Test Cases ***
Valid Login
    Open Browser     ${LOGIN URL}    ${BROWSER}

If you have any questions, don't hesitate to ask them. Good luck !

Solution 3

(I know it's been some time but if it can help others...)

Following that error message, you probably had an issue with the browser driver.

I struggled to find the "PATH" where geckodriver (for Firefox) should be, and a colleague helped me so I share ; hope it could help someone who, like me, would spend hours on stackoverflow and such:

echo $PATH

(I'm on macos so it should also work for Linux, not sure for Windows)

Then, a simple open /Library/Frameworks/Python.framework/Versions/3.7/bin (or any other path the previous line gave you), and copy the geckodriver exe there :)

Solution 4

In my guess that you don't install selenium library, in above case you may mispelled it to robotframework-seleliumlibrary instead of robotframework-seleniumlibrary. Follow the pip install instructment above, and have a try again~
(May I should comment at the corresponding reply, but it is low for my reputation = - =)

Share:
17,488
Vani
Author by

Vani

Updated on June 08, 2022

Comments

  • Vani
    Vani almost 2 years

    I am writing a simple test case where i am opening a chrome browser with the url using robot framework with python and selenium2library

    I HAVE TRIED ALL THE WAYS TO MAKE IT DONE ,LIKE INSTALLING AND UNINSTALLING THE PYTHON ETC

    HERE IS THE ERROR

    No keyword with name 'Open Browser' found.
    ------------------------------------------------------------------------------
    Check                                                                 | FAIL |
    1 critical test, 0 passed, 1 failed
    1 test total, 0 passed, 1 failed
    =============================================================================
    
    • Russell Smith
      Russell Smith almost 5 years
      Are you importing a library that includes that keyword, or have you defined that keyword yourself? If you are importing, do you get import errors? Without seeing a minimal reproducible example it's impossible for us to do anything other than guess. Please edit your question to include the smallest possible robot test that gives this error.
    • Russell Smith
      Russell Smith almost 5 years
      Please don't post code in the comments. You can edit your question to include additional details.
  • Vani
    Vani almost 5 years
    C:\Users\PC\IdeaProjects\untitled\Suite>pip install --upgrade robotframework-seleliumlibrary Collecting robotframework-seleliumlibrary ERROR: Could not find a version that satisfies the requirement robotframework-seleliumlibrary (from versions: none) ERROR: No matching distribution found for robotframework-seleliumlibrary
  • Vani
    Vani almost 5 years
    I am using the following version:Package Version ------------------------------- ------- pip 19.1.1 robotframework 3.1.2 robotframework-selenium2library 3.0.0 robotframework-seleniumlibrary 3.3.1 selenium 3.141.0 setuptools 41.0.1 urllib3 1.25.3
  • laasch
    laasch almost 5 years
    OK, so you have seleniumlibrary installed; do you have the Library line at the top?
  • laasch
    laasch over 4 years
    I think you should do as Bryan Oakley suggests above and post (at least some of) your code.
  • Willy satrio nugroho
    Willy satrio nugroho over 2 years
    Your answer is good. Why you should care about reputation if it help others ?
  • cross-hello
    cross-hello over 2 years
    Yeah, that is not need. Thank you, that is something I suffered ever.