Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use ExitOnFailure feature #21

Closed
thet opened this issue Mar 17, 2014 · 8 comments
Closed

how to use ExitOnFailure feature #21

thet opened this issue Mar 17, 2014 · 8 comments

Comments

@thet
Copy link
Member

thet commented Mar 17, 2014

i can't find how to use the --runmode ExitOnFailure feature, which stops test execution on test failures. i used it like so:
$ ./bin/robot --runmode ExitOnFailure src/bda/plone/shop/tests/robot/test_shop_orderprocess.robot
then, robot complained:
[ WARN ] Option --runmode is deprecated in Robot Framework 2.8 and will be removed in the future.
and apparently it didn't work.

http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.3#stopping-test-execution

@thet
Copy link
Member Author

thet commented Mar 17, 2014

ok, these docs say:
--exitonfailure
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.8.4#stopping-when-first-test-case-fails

but using it like so seems also not to work:
$ ./bin/robot --exitonfailure src/bda/plone/shop/tests/robot/test_shop_orderprocess.robot

it just does not stop test execution

FYI, this is related: xyb/robotframework-debuglibrary#6
a post-failure debug console like the post-mortem debugging feature would just be awesome

@datakurre
Copy link
Member

What do you mean that it does not stop? How should.it work? According to the docs, it should skip the rest of the steps, run teardown and mark the test failed (and skip rest of the tests).

Johannes Raggam kirjoitti Mon Mar 17 2014 17:43:01 GMT+0200 (EET):

ok, these docs say:
--exitonfailure
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.8.4#stopping-when-first-test-case-fails

but using it like so seems also not to work:
$ ./bin/robot --exitonfailure src/bda/plone/shop/tests/robot/test_shop_orderprocess.robot

it just does not stop test execution


Reply to this email directly or view it on GitHub:
#21 (comment)

@thet
Copy link
Member Author

thet commented Mar 18, 2014

Aha, then I was misunderstanding the docs on this point.
I want to stop test execution, keep the browser open at the keyword which failed and not do the teardown. Then I'd have a chance that to investigate on that error. Often errors occur on wrong selectors, then it would just be helpful to see the DOM tree at the state, where it failed.

Didn't you show me in Cologne a command line option which does exactly this?

@datakurre
Copy link
Member

In Cologne, we used robotframeworm-debuglibrary's debug-keyword.

If you use p/a/robotframework/keywords.robot, you could require with p.a.robotframework [debug] -extras and type Debug -keyword into your test.

Otherwise, just require robotframework-debuglibrary, import it with Library command in settings and use debug keyword.

To go further, selenium2library has import argument "run_on_failure" and keyword Register keyword to run on failure. That feature defaults to Capture page screenshot, but you could change that to Debug (from debuglibrary or p.a.robotframework/keywords). I think, we could make that use a variable and then it could be overridden from commandline.

Johannes Raggam kirjoitti Tue Mar 18 2014 13:11:04 GMT+0200 (EET):

Aha, then I was misunderstanding the docs on this point.
I want to stop test execution, keep the browser open at the keyword which failed and not do the teardown. Then I'd have a chance that to investigate on that error. Often errors occur on wrong selectors, then it would just be helpful to see the DOM tree at the state, where it failed.

Didn't you show me in Cologne a command line option which does exactly this?


Reply to this email directly or view it on GitHub:
#21 (comment)

@thet
Copy link
Member Author

thet commented Mar 18, 2014

yeah, i remember the debug statement, which i'm using in my tests.

your "to go further" suggestion sounds good! that would also close the feature-request issue i opened here: xyb/robotframework-debuglibrary#6

@datakurre
Copy link
Member

Hmm... as a second thought, even it would be nice to have the debug keywords even without keywords.robot, it may not be wise to move it to selenium.robot. I'll move it back to keywords.robot.

@datakurre
Copy link
Member

Done. So, whenever you are using plone/app/robotframework/keywords.robot and p.a.robotframework >= 0.9.0 (to be released soonish) you can just run your test against robot-server with bin/robot-debug and you'll automatically drop into debugger at the first failing step.

@thet
Copy link
Member Author

thet commented Apr 25, 2014

this is awesome! thanks for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants