5

i'm trying to skip a specific test case using keyword, is there are any keyword to do that ? what i'm trying to do is to check if file name have "skip" word then i want to skip it. is there are any keyword like : Skip Test , Skip Execution If ...

@{regex}=  Get Regexp Matches  ${TEST NAME}  Skip
${lenght}=  Get Length  ${regex}
Skip Execution If  '${lenght}'>'0'  
2
  • Where did you hear that they added a "skip" status in 2.9? There is no such feature in 2.9. Commented Dec 29, 2015 at 12:13
  • sorry it was a mistake Commented Dec 29, 2015 at 12:55

3 Answers 3

6

Nowadays, there are the following keywords added, in Robot Framework: Skip and Skip if

Sign up to request clarification or add additional context in comments.

Comments

2

Ideally, tests that should not be run should be excluded from the run using tags or other means. Another option is to still run the tests, but simply check for your skip condition at the start of the test and pass the test without executing anything. There are two keywords, Builtin.Pass Execution and Builtin.Pass Execution If, useful for that.

http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Pass%20Execution%20If

5 Comments

is there are any way to do it without using tags ?
By file location, file name, and by test suite and test case names: robotframework.org/robotframework/latest/…
i success to skip the test but i didn't got "Skip" status , how can i get it ?
There is no skipped test status yet in Robot Framework. Check out github.com/robotframework/robotframework/issues/2087
If you used Pass Execution to skip your tests, you can pass an optional SKIP tag at the end so that the case will be tagged as SKIP in the log/report. Eg: Pass Execution Skipping this test SKIP. Here SKIP is the tag that will be added to this test case and it will show up in your log/report as a tag. Source: robotframework.org/robotframework/latest/libraries/…
0
Get request
    Create Session    mysession    ${base_url}    disable_warnings=True
    ${end_point}=    Set Variable    /api/users/2
    ${body}=    Create Dictionary    name=xyz    job=Engineer
    **Skip**
    ${response}=    DELETE On Session    mysession    ${end_point}
    Log To Console    ${response.status_code}

1 Comment

Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. Would you kindly edit your answer to include additional details for the benefit of the community?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.