Hi @detlefs ,
I think, the language only plays a role, if you use the text of the button as locator strategy. If use, for example, the ID and xpath as locator, you should be fine:
Click xpath://*[@id='login']
So you usually should not have any difficulties with the language.
Furthermore, since locators are hard to interpret, you could extract them in a configuration file:
WEBAPPLICATION= {
'URL': 'http://my-application/index.html',
'USER': 'service-robot',
'PASSWORD': '123456,
'PAGE_OBJECT_ELEMENT' : {
'MAIN_MENU' : 'xpath://*[@id="navigationTree"]',
'LOGIN_SCREEEN' : {
'INPUT_NAME' : 'xpath://*[@id="loginName"]',
'INPUT_PASSWORD' : 'xpath://*[@id="password"]',
'BUTTON_ANMELDEN' : 'xpath://*[@id="anmeldenButton"]'
},
}
}
When starting the test case, you pass the configuration file with --variablefile
on to robot:
robot --variablefile page_object_elements.py my_testcase.robot
In you test case, you then reference your page object elements:
*** Variables ***
${PO_LOGIN_SCREEN} ${WEBAPPLICATION}[PAGE_OBJECT_ELEMENT][LOGIN_SCREEEN]
*** Test Cases ***
Test Login
Open Browser ${WEBAPPLICATION}[URL]
Input Text ${PO_LOGIN_SCREEN}[INPUT_NAME] ${WEBAPPLICATION}[USER]
Input Password ${PO_LOGIN_SCREEN}[INPUT_PASSWORD] ${WEBAPPLICATION}[PASSWORD]
Click ${PO_LOGIN_SCREEN}[BUTTON_ANMELDEN]
If you have any difficulties with the UI language after all, maybe you can adopt the pageobject-pattern in your favor, for instance replacing IDs with localization keys.
Best regards,
Markus