-
Book Overview & Buying
-
Table Of Contents
Robot Framework Test Automation
By :
At times during the loop iteration, there may be cases where the execution needs to be changed, which can be done either to skip the present and continue with the next iteration or to terminate the loop entirely.
Sometimes, the loop contents need to be processed in such a manner, which is not iterative in nature. In this case, we need to issue special commands that allow us to manipulate the contents of the flow of contents within the loop irrespective of the iteration status. In most conventional programming languages, this is specified by the continue and break constructs. Robot Framework offers a similar approach by providing some special keywords for this purpose in its default library.
By using the Exit For Loop or the Exit For Loop If built-in keywords, it is possible to terminate the loop and continue with the further statements:
| | | Run Keyword If | ${val} > 10 | Exit For LoopIn the preceding example, Run Keyword if is used, which is...
Change the font size
Change margin width
Change background colour