Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verification of presence of one text of 2 texts in the page using selenium2library & Robot Framework

I want to test if the page contains "TEXT1 or "TEXT2".

Page Should Contain TEXT1 or TEXT2.

Any suggestion how can I do this? Currently I can only check for one text.

like image 370
HamSmith Avatar asked Oct 22 '22 16:10

HamSmith


1 Answers

You can use

Page Should Contain Element

with a locator

xpath=//*[contains(text(),'TEXT1') or contains(text(),'TEXT2')]
like image 63
Petr Janeček Avatar answered Oct 28 '22 21:10

Petr Janeček