user9574667
user9574667

Reputation:

How can we define, not one but a set of instructions for an if loop in robotframework?

I am trying to give more than one instruction after a "Run Keyword If" method, but the syntax allows me to give just one? How i can give multiple instructions after condition executed as true?

Upvotes: 2

Views: 88

Answers (2)

Pooja
Pooja

Reputation: 209

You can use the keyword Run Keywords with AND connector. Example given below:

 Run Keyword If  '${TEST1}'=='${TEST2}'  Run Keywords  Keyword1   AND   Keyword2

Upvotes: 3

Justin Wilkins
Justin Wilkins

Reputation: 341

If you want an easy to read solution you could create another keyword with all your other actions inside of it. For example.

run keyword if    '${a}'=='${a}'    my keyword

my keyword
[Documentation]    This is documentation
Action A
Action B

Upvotes: 4

Related Questions