Can robot framework click on plain text?

Viewed 38

I have a need to click on plain texts a few times to activate a module.My code is

FOR    ${index}     IN RANGE    6
    Log    ${index}
    Wait and Click Element                          text='SNAPSHOT'
END

And html block is

<div _ngcontent-lxw-c204=""><span _ngcontent-lxw-c204="">Versio: 5.8.4-SNAPSHOT</span><span _ngcontent-lxw-c204="" class="Test-version"></span><!----></div>

But always the error is cannot find the text .

1 Answers

From the code snippet, I would suggest doing it like this. Instead of using text attribute, I would use XPath expression.

Click Element    //*[contains(text(), "SNAPSHOT")]

I don't know the keyword Wait and Click Element. Can you please provide me with more info about this keyword?

Related