How to run specific test cases from a test suite using Robot Framework

后端 未结 3 1612
耶瑟儿~
耶瑟儿~ 2021-02-03 22:45

I am new to Robot and am learning to write logic and test cases.

I have a test suite, "mytestsuite.robot", which has a lot of test cases. I have a couple of err

3条回答
  •  渐次进展
    2021-02-03 23:27

    You want to use the option -t or --test, but the option goes before the name of the file rather than after. This should work:

    robot -t testcase1 mytestsuite.robot
    

    The order of the command line arguments is covered in the user guide under a section titled Starting test execution, and is also available at the command line with the --help option (e.g. pybot --help)

    Be aware that the specific file name is optional. You could use only: robot -t testcase1 .

    Where "." means look for all files that contains the specified test. Robot will do the hard work of finding the specific test.

    You can use also willcard as * in the begining or finish of the test name, to match easily a test or to run multiple tests.

    robot -t "testcase1*" .

    Will match all tests that begin with "testcase1" in current folder.

    The user guide has a section titled Selecting test cases which covers this subject.

提交回复
热议问题