I am writing a custom Page Object library for Robot Framework like this one: robotframework-pageobjectlibrary
My page custom keywords (page objects) are in a separate folder and when I run my Robot Framework tests, I give their path with the --pythonpath option like this: robot --pythonpath ../resources/pageobjects lib-test/test.robot.
My directory structure looks like this:
CustomPageObjectLibrary
|--__init__.py
|--keywords.py
|--locatormap.py
|--pageobject.py
Resources
|--pageobjects
|__CountryPage.py
Tests
|--lib-test
|__test.robot
The contents of the CustomPageObjectLibrary are currently the same as in the linked repo except that I use the AppiumLibrary instead of the SeleniumLibrary.
CountryPage.py
from CustomPageObjectLibrary import PageObject
class CountryPage(PageObject):
PAGE_TITLE = "Country"
_locators = {
'germany': 'countryGermany',
}
# def __init__(self):
# super(PageObject, self).__init__()
def open_app(self):
self.appiumlib.open_application('http://localhost:4723/wd/hub', platformName='Android', deviceName='...', appPackage='...', appActivity='.MainActivity', uiautomator2ServerInstallTimeout=50000)
def choose_country(self, country):
# Convert country to lovercase
country = str(country).lower()
self.appiumlib.wait_until_element_is_visible(locator=self.locator.germany) self.appiumlib.click_element(locator=self.locator.germany)
My test:
*** Settings ***
Variables ../../resources/pageobjects/config.py
Library CustomPageObjectLibrary
Library AppiumLibrary
*** Test Cases ***
Navigate To Not Connected Screen
Open App
Choose country germany
I run this with the following command: robot --pythonpath ../resources/pageobjects lib-test/test.robot
The error what I get: No keyword with name 'Open App' found.
What could be the problem with this?
CustomAppiumLibrarylibrary, but it's not finding any keywords in it. Without seeing a simplified version of the library, there's not much we can do to help. - Bryan Oakley--pythonpath. My folder structure is the same as in your library @BryanOakley - Fogarasi Norbertexport PYTHONPATH=/path/to/root/dir- DUDANF