Search code examples
robotframework

Right format of the element path


I'd like to know what is the right (official) way to use element path in Robot Framework. According to the doc: enter image description here

Let's say I want to use xpath. If I understand the right way to use it in a KW for example:

Wait Until Page Contains Element    locator=xpath://*[@id="post-message-container"]

But in many cases, googling it, I found this:

Wait Until Page Contains Element    xpath=//*[@id="post-message-container"]

Surprisingly both work, but I don't think the second one should. Could you help me to solve this confusion?


Solution

  • There is no strategy=value examples in the official documentation because their recommended syntax is strategy:value. However, if you look at another similar library called Browser library , you will find that they have used syntax strategy=value. I guess it just depends on the library and their recommendations.