0
votes

I want to import library SeleniumLibrary into Robot test file but resulted not found. What could be the error?

I have installed SeleniumLibrary into C:\Python27\Lib\site-packages and set the environment variables. I"m using python 2.7.9

*** Settings ***
Documentation  This is a simple test for Robot Framework
Library  SeleniumLibrary
#Set Selenium Speed 2 seconds

*** Variables ***
#${homepage} http://www.amazon.com
#${chrome_browser}   Chrome

*** Test Cases ***
Test title "Amazon"
    [Tags]  DEBUG

    Open Browser http://www.amazon.com chrome
    [Teardown]  Close Browser


*** Keywords ***

enter image description here

Please help. Thanks.

2
When you do a pip list does the module appear in the returned list of modules. If you have multiple python installations, are you sure you're using the right one? - A. Kootstra
When i run pip list, I found the robotframework-seleniumlibrary - nicholas
Please read the error message carefully, and take it literally. It is saying that it can't find a keyword named Open Browser http://www.amazon.com chrome. Notice it's not saying it can't find a keyword named Open Browser. That is a clue that shows you don't have enough spaces between each argument. - Bryan Oakley

2 Answers

2
votes

Your SeleniumLibrary looks perfectly fine, the problem is the way you are calling the KW.

The error you are getting here because of below line

Open Browser http://www.amazon.com chrome

There should be two or four spaces between Keywords and Arguments and Arguments and ... , otherwise it will treat whole line as KW , which never going to exist so change it like this

Open Browser    http://www.amazon.com    chrome

if it still throw an error, paste it here.

0
votes

Solve by using four spaces between keywords and argument and argument.