How to Exclude Test Suites in Robot Framework ? We are using Maven

后端 未结 2 1201

We just started using Robot Framework using Eclipse and Maven. We want to run only certain test suites(test suites will have testcases).Is there any way to do that?

2条回答
  •  既然无缘
    2021-01-15 03:52

    There are no pybot options to exclude suites, other than to not include them on the command line in the first place. That being said, you have a couple of options to accomplish the same thing.

    The first option is to give all your tests tags, and then use the --exclude option to exclude tests with particular tags. For example, in my organization we use robot for both automated and manual tests. When we run in an unattended fashion we will exclude all of the test cases with the manual tag.

    If that is impractical, your other option is to enumerate the suites that you do want to run. This is tedious, but is made easier if you use an argument file. For example, you can create a file with the following contents:

    --suite fullsuite.subsuite1
    --suite fullsuite.subsuite3
    --suite fullsuite.subsuite4
    

    If you save it to a file named "skip2.args" you can then reference this on the command line with the --argumentfile option. For example:

    pybot --argumentfile skip2.args ./fullsuite
    

    You can combine these two techniques. For example, to skip "subsuite2" and also skip all tests tagged as manual, you can simply add the --exclude option to the .args file:

    --suite fullsuite.subsuite1
    --suite fullsuite.subsuite3
    --suite fullsuite.subsuite4
    --exclude manual
    

    For more information on command line options you can type pybot --help at the command line, or see the section All command line arguments in the robot framework user guide.

提交回复
热议问题