'No keyword with name "launch browser" found Robot Framework
I have 2 files: in userkeywords.robot I have the test case file as follows:
\*\*\* Settings \*\*\*
Library SeleniumLibrary
Library OperatingSystem
Resource ../Resources/resources.robot
\*\*\* Variables \*\*\*
${url} https://login.salesforce.com/?locale=it
${browser} chrome
\*\*\* Test Cases \*\*\*
TC1
${PageTitle}= launch browser ${url} ${browser}
input text id:username user
input text id:password mypass
In the other: resources.robot I have all the keywords which I separated from the main file:
\*\*\* Settings \*\*\*
Library SeleniumLibrary
Library OperatingSystem
\*\*\* Keywords \*\*\*
launch browser
\[Arguments\] ${appurl} ${browser}
open browser ${url} ${browser}
maximize browser window
${title}= get title
[Return] ${title}
For some reason I get the following error message:
PS C:\\temp\\TestCases\> robot .\\userkeywords.robot
TC1 | FAIL |
No keyword with name 'launch browser' found.
I am using VS code
I tried to put both files in the same folder but still get the error
Solution 1:[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
Solution 2:[2]
You need to recheck where your resources.robot file present.
I suspect Resource ../Resources/resources.robot
causing this issue.
Also, these '' all over may be something not present in your code, right?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dharman |
Solution 2 | Sujit Neb |