How to continue execution in Robot Framework if any condition of "For" loop fails

1,872 views
Skip to first unread message

RoboUser20

unread,
Feb 26, 2019, 6:18:08 AM2/26/19
to robotframework-users
Hi all,

I have keyword written in robot framework where for loop is used.

 User Create
    ${base_url}=  Fetch Base URL
${cookie} = Login Cookie
${header}= Set Header for Authentication
@{payload}= create user payload ${admin_user_filepath} ${create_admin_user} ${admin_name} ${admin_login} ${admin_usertype} ${admin_password} ${admin_telephone} ${admin_mail}
:FOR ${payload} IN @{payload}
\ ${usercreate}= user create ${base_url} ${payload} ${cookie} ${header}
\ should be equal as strings ${usercreate.status_code} 200
\ sleep 2s

TestData.xls

Name Login UserType Password Telephone Mail
RoboAutomation roboauto ADMIN Password@1234 98686552 ro...@automation.com
TestUser1 TestUser1 ADMIN Password@1234 78556565 test...@gmail.com
TestUser2 TestUser2 ADMIN Password@1234 464445454 test...@gmail.com
Now, if I have any incorrect data in second user, execution stops.
I want some keyword in robot that can help in continuing execution for third user

Aleh Barysevich

unread,
Feb 26, 2019, 10:03:21 AM2/26/19
to robotframework-users
You could use keyword Run Keyword And Continue On Failure. It will mark test as failed, but will move to next steps.
--
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 post to this group, send email to robotframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aleh Barysevich


Reply all
Reply to author
Forward
0 new messages