Created a sample Python script( Elements.py) with a function like below:
from robot.api.deco import keyword
@keyword("join two strings")
def join_two_strings(arg1, arg2):
return arg1 + " " + arg2
Then I have imported into Robot Framework script(.robot file) as a Library:
*** Settings ***
Library AppiumLibrary
Library Selenium2Library
Library BuiltIn
#Here is the import of Custom Lib
Library Elements.py
*** Variable ***
*** Test Cases ***
Example that calls a Python keyword
${result}= join two strings hello world
Should be equal ${result} hello world
After running above the script, getting error like "No keyword with name 'join two strings' found." even though where I have imported the Custom library.
Error Message:
[ ERROR ] Error in file C:\Users\ramana.gouda\PycharmProjects\SafeMobile\Test_Suite\TestCase_346.robot: Test library 'Elements.py' does not exist.
TestCase 346 :: Creating internal cases using device
Example that calls a Python keyword | FAIL |
No keyword with name 'join two strings' found.