Exit from the test-cases

2,087 views
Skip to first unread message

Vinoth

unread,
Aug 28, 2013, 8:40:52 AM8/28/13
to robotframe...@googlegroups.com
Hi guys,
    If i run my robot framework file, If there is one test cast fail, i want to stop my all test-case after my failed test-case. Is there any possible in robot framework?

Kevin O.

unread,
Aug 28, 2013, 12:16:04 PM8/28/13
to robotframe...@googlegroups.com
You could raise a fatal error in a teardown...

*** Settings ***
Documentation     This is a test suite.

*** Test Cases ***
Failing Test
    Fail    oh geeze
    [Teardown]    Stop On Failure

*** Keywords ***
Stop On Failure
    Run Keyword If    '${TEST_STATUS}' == 'FAIL'    Fatal Error

Vinoth Kumar

unread,
Aug 29, 2013, 12:53:42 AM8/29/13
to robotframe...@googlegroups.com
Thanks Kevin.

Vinoth Kumar

unread,
Aug 29, 2013, 1:21:17 AM8/29/13
to robotframe...@googlegroups.com
Am i do like this....?
I tried this one, the result is

Parent suite setup failed:
Keyword teardown failed:
Non-existing variable '${TEST_STATUS}'.


 
*** Settings ***
Documentation     This is a test suite.
Suite Setup    Start


*** Test Cases ***
Failing Test
    Fail    oh geeze
    [Teardown]    Stop On Failure

*** Keywords ***
Stop On Failure
    Run Keyword If    '${TEST_STATUS}' == 'FAIL'    Fatal Error

Start

    Fail oh geeze
    [Teardown]    Stop On Failure   


On Wednesday, 28 August 2013 21:46:04 UTC+5:30, Kevin O. wrote:

Kevin O.

unread,
Aug 29, 2013, 10:08:24 AM8/29/13
to robotframe...@googlegroups.com
${TEST_STATUS} is new in 2.8.
Another approach is to use the  --exitonfailure argument to the test runner when running the tests.

Karthik V

unread,
Dec 8, 2016, 5:31:31 PM12/8/16
to robotframework-users
Hi Kevin , can you give me an example on how to use exit on failure. I am using RIDE btw.

Karthik V

unread,
Dec 8, 2016, 5:32:21 PM12/8/16
to robotframework-users
This worked. Thanks
Reply all
Reply to author
Forward
0 new messages