Reverse For Loop in Robot Framework

2,513 views
Skip to first unread message

chintamani bapat

unread,
Feb 11, 2016, 1:27:03 AM2/11/16
to robotframework-users

Hi,

Here is the easy way to write reverse for loop in Robot Framework


: FOR ${TC_COUNTER} IN RANGE  7 0 -1 

                DO SOMETHING

Mallikarjunarao Kosuri

unread,
Feb 12, 2016, 10:20:18 PM2/12/16
to robotframework-users

You could try like this


*** Settings ***
Library           String

*** Test Cases ***
For-Loop-In-Range
   
@{reverse_list}=    Evaluate  list(range(7,0,-1))
   
: FOR    ${INDEX}    IN    @{reverse_list}
   
\    Log    ${INDEX}


I hope this could solve your problem

Sheetal Shahare

unread,
Oct 15, 2020, 12:50:12 AM10/15/20
to robotframework-users
In Dynamic web table how to iterate reverse
e.g  when i process 4 files then 4 jobs will be displayed in web table accordingly 
these files getting processed in sequentially (one by one) .

e.g in data table 

job 4 - pending
job 3 - pending
job 2 - pending
job 1 - running

once job 1 completed successfully then job 2 , job 3  and job 4 will be picked up for processing.


Note : Number of jobs in dynamic table depends on number of files to be processed.

how do i  iterate reverse in dynamic data table?
Please let me know anyone have solution for this?
Reply all
Reply to author
Forward
0 new messages