Isssue/Clarification in Robotframework 4.0 For loop & If Loop usage

18 views
Skip to first unread message

Sreeram R

unread,
Mar 24, 2021, 6:37:35 PM3/24/21
to robotframework-users
Hi,

I tried converting the For loop from older version to the latest version 4.0 of Robot framework.

Can you please confirm what I am missing?

Older Version of RF Framework

:FOR ${Select_TC} IN @{Selected_TC_List}
\ ${Module_Name_list} Split String ${Select_TC}
\ ${Module_Name} Get From List ${Module_Name_list} 0
\ Log ${Module_Name}
\ ${Module_Content} Should Match Regexp ${Batch_Config_File} ${Module_Name}[\\s\\'A-Za-z0-9\\-\\#]+
\ ${Get_YES_TC} Get Regexp Matches ${Module_Content} [TC][\\-0-9A-Z]+\\s+\\'YES\\'
\ Run Keyword If @{Get_YES_TC} != []
\ ... Append To List ${Selected_TC} ${Get_YES_TC}
:FOR   ${TC_List} IN @{Selected_TC}
\ Populate_Exec_TC_List_Selected ${TC_List}
:FOR ${ALL_TC} IN @{All_TC_List}
\ ${Module_Name_Match}       Should Match Regexp     ${ALL_TC}     Module_([A-Za-z0-9\\_\\-]+)
\ ${Module_Name} Get From List ${Module_Name_Match} 1
\ ${ALL_Mod_TC_List} Get Regexp Matches ${Recursive_TC} Test_Suite\\/${Module_Name}\\/[TC][\\-0-9A-Z][\\_\\-\\.0-9A-Za-z]+\\.robot
\ Append To List ${ALL_Module_List} ${ALL_Mod_TC_List}
:FOR   ${All_TC_List} IN @{ALL_Module_List}
\ Populate_Exec_TC_List_ALL ${All_TC_List}

Newer Version Snippet.

image.png

Output

image.png


Anil Shrestha

unread,
Mar 24, 2021, 6:52:04 PM3/24/21
to its...@gmail.com, robotframework-users
Can you attach your new version  FOR loop?

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/CADgTJcFKp1iFGO11WoTyDfA9cApCw14CRZH00s7YNuwortsLmw%40mail.gmail.com.

Anil Shrestha

unread,
Mar 24, 2021, 6:54:06 PM3/24/21
to its...@gmail.com, robotframework-users
Remove line 10 END.
image.png
image.png
Reply all
Reply to author
Forward
0 new messages