From the course: Robot Framework Test Automation: Level 2

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

IF/ELSE: Making decisions

IF/ELSE: Making decisions

- [Instructor] Using if statements to help make decisions within your script logic is going to be a very powerful thing for you. What we want to do with If Else logic is to test a condition and then based on the results of that condition, we want to take the correct action. This ability comes to us from the BuiltIn library so there's nothing to add or install and it's really based around a keyword called run keyword if and it looks just like this. You run keyword if a certain variable value equals some other value and that could be an integer, could be a string, whatever. Then after that evaluation, you're going to specify a keyword that should run if that condition is true. You can also have one or more Else If clauses and what that means is you can say if a certain value equals something then do this keyword and then you can say else, if that same value equals something different or even a different value equals something then run that same keyword or a different keyword and you can…

Contents