rf-practice
FOR Loops

Context

When you need to apply the same action to many items, loops keep the suite concise. A list variable together with a FOR loop replaces repeated keyword calls with a single readable block.

Theory

A FOR-IN loop repeats a block of keywords for every value in a sequence. It starts with FOR, declares a loop variable, uses IN to separate it from the values, and ends with END. List variables are defined with @{NAME} and unpack into individual values when used after IN.

Task

  • Create a list variable @{FRUITS} with values: apple, banana, cherry.
  • Create a test case named Loop Test that loops over @{FRUITS} and logs each fruit.

Checks

Defines a *** Variables *** section
Defines a list variable named FRUITS
FRUITS contains apple, banana, and cherry
Has a test case named Loop Test
Uses a FOR loop over @{FRUITS}
Logs each fruit inside the loop
Loop Test passes
Output contains cherry