Using Robot Framework, I am trying to create a FOR loop in which a random value is selected from the list. After the random value is selected, the page for that value is opened, then I want to do validate the data available for that party, etc. And then the loop should exit if the value is matched.
Currently, I'm able to select a random value and go to that value page but not able to perform further actions as the scripts fail as the FOR loop finds another value from the list.
@{ORGANISATIONAL_NAME} JSK MARKETING KEDARNATH COMOTRADE PONDICHERRY SRI LAKSHMI
View Basic Info of the Party
${value} = Evaluate random.choice($ORGANISATIONAL_NAME) random
input text ${SEARCH_BAR} ${value}
log to console \nvalue: ${value}
click element ${SEARCH_BUTTON}
log ${value}
Run Keyword If '${value}' == 'JSK MARKETING' click element ${JSK_MARKETING}
... ELSE IF '${value}' == 'KEDARNATH COMOTRADE' click element ${KEDARNATH_COMOTRADE}
... ELSE IF '${value}' == 'PONDICHERRY SRI LAKSHMI' click element ${PONDICHERRY_SHRI_LAKSHMI}
... ELSE log to console condition didn't met
FOR ${value} IN @{ORGANISATIONAL_NAME}
log to console ${value}
click element ${BASIC_INFO}
wait until page contains Summary
Exit For Loop If '${value}' == 'JSK MARKETING'
click element ${BASIC_INFO}
wait until page contains Summary
Exit For Loop If '${value}' == 'KEDARNATH COMOTRADE'
click element ${BASIC_INFO}
wait until page contains Summary
Exit For Loop If '${value}' == 'PONDICHERRY SRI LAKSHMI'
END
The validations need to be performed over the selected random value from the list.