Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Robot Framework Test Automation

You're reading from   Robot Framework Test Automation Create test suites and automated acceptance tests from scratch

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher Packt
ISBN-13 9781783283033
Length 98 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sumit Bisht Sumit Bisht
Author Profile Icon Sumit Bisht
Sumit Bisht
Arrow right icon
View More author details
Toc

Flow control


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.

Breaking off without finishing

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 Loop

In the preceding example, Run Keyword if is used, which is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image