Run keyword and continue on failure in one place

1,562 views
Skip to first unread message

Damodharan Baskaran

unread,
Aug 28, 2018, 6:54:42 AM8/28/18
to robotframework-users
Hi,

Below are some example of my test case file. I have prepared some 40 test cases that contains custom keywords. In all the places explicitly i have used 'Run Keyword And Continue On Failure'. Is there any way to use 'Run Keyword And Continue On Failure' at once in suite/test case/keyword?

*** Test Cases ***
Test
    Run Keyword And Continue On Failure    Open_Application
    Run Keyword And Continue On Failure    Login_Application    ${Default_Username}    ${Default_Password}

*** Keywords ***
Open_Application
    Run Keyword And Continue On Failure    Run Keyword If    '${Browser}' == 'Chrome'
    ...    Run Keyword And Continue On Failure    Chrome_Options
    Run Keyword And Continue On Failure    Run Keyword If    '${Browser}' == 'Firefox'
    ...    Run Keyword And Continue On Failure    Firefox_Options

Login_Application
    [Arguments]    ${Username}    ${Password}
    Log_Testcase_Info    46866    Login_Application
    Run Keyword And Continue On Failure    Input Text    ${I_txtUsername}    ${Username}
    Run Keyword And Continue On Failure    Input Password    ${I_txtPassword}    ${Password}


Thanks,
Damodharan B


Pekka Klärck

unread,
Aug 28, 2018, 12:00:42 PM8/28/18
to damodha...@gmail.com, robotframework-users
Could you clarify why you need to use `Run Keyword And Continue On
Failure` everywhere?

Cheers,
.peke
ti 28. elok. 2018 klo 13.54 Damodharan Baskaran
(damodha...@gmail.com) kirjoitti:
> --
> 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.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Damodharan Baskaran

unread,
Aug 29, 2018, 1:53:03 AM8/29/18
to robotframework-users
Hi Peke,

For example, i have 2 independent test cases contains internal custom keywords. If there is any keyword failed inside the custom keywords, i want to continue with other test case by declaring in the top level.

Expecting similar like 'On Error Resume Next' in UFT Tool(VBScript).


> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.

Tatu Aalto

unread,
Aug 29, 2018, 2:09:20 AM8/29/18
to damodha...@gmail.com, robotframework-users
Ugh

This is explained in the user guide[1], but in short: If failure happens in a test case, execution of that case is stopped, although the teardowns are always executed and then next test case started. Therefore the Run... keywords are not needed for continuing to the next test case.

Was this what you wanted? Also please read the section from the user guide[1], because it explains better the execution flow and the setups and teardowns actually work.


> 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.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

--
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.

Damodharan Baskaran

unread,
Aug 29, 2018, 5:04:17 AM8/29/18
to robotframework-users
Hi Tatu,

Thanks for the answer. It is working for test cases as you mentioned. My question is, cant i use 'run keyword failure' statement for custom keywords?
> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

--
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-users+unsub...@googlegroups.com.

Bala sudhakar Voleti

unread,
Aug 29, 2018, 5:10:24 AM8/29/18
to damodha...@gmail.com, robotframe...@googlegroups.com
I hope you are using Teardown after every test case.

Hi Tatu,

> 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.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

--
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.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
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.
Reply all
Reply to author
Forward
0 new messages