Object Locator parameterization

Hi ,

In RF , here we are hardcoding locators , is there any way we can parameterize and read them from any file so that in case of any change we need not to change in all files.

Neha Dua

I use config file for that:

    "Input username" : "xpath://*[@id='username'],
    "login button" : "xpath://button[@id='login']"

If that file is called main_page_pom.py you can reference it in your robot file:

*** Settings ***
Variables    main_page_pom.py

*** Tasks ***
Login user
    Input Text    ${MAIN_PAGE}[input username]
    Click button    ${MAIN_PAGE}[login button]


1 Like

you can use an {} and string format