How to check in robotframework if the page has an element and netx to take a condition?

497 Views Asked by At

Example:

In Ruby/capybara I would do:

if page.has(element)?
do somenthing

elsif page.has(element2)?
do another thing

else

print "Do nothing"

How could i do it in robotframework ?

*** Keywords ***
given I need to verify some conditions

1

There are 1 best solutions below

0
rajansu On

Seems you want to implement conditional logics. For that there is keyword called "Run Keyword If" in Robotframework. Please try to look documentation for that.

Here is a link that might be helpful.

https://blog.codecentric.de/en/2013/05/robot-framework-tutorial-loops-conditional-execution-and-more/