I've got a problem with using a loop in another existing loop in RF That is just an example of what I need: I have a list of people (@{people}) and each of the people has a list of items.
I do the following:
:FOR | ${person} | IN @{people}
\ | @{items}= | Create List | xpath=//div[@class='item']
\ | :FOR ${item} | IN @{items}
\ | \ | ...
The problem is on the second :FOR I got an error 'keyword :FOR is not found'. Do I do something wrong? Or is there any other way to include a loop in another loop?
According to User Guide, having nested for loops is not supported directly, but it is possible to use a user keyword inside a for loop and have another for loop there
*** Keywords ***
Loop over people
:FOR ${person} IN @{people}
\ @{items}= Create List xpath=//div[@class='item']
\ Loop over items @{items}
Loop over items
[Arguments] @{items}
:FOR ${item} IN @{items}
\ ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With