set tag name for Robot Testcases

时间:2017-12-18 06:56:57

标签: robotframework

I want to run a robot testcase with specific tagname for identify my testcase in group of testcases. I tried to give the tagname in tagname tag box in Ride , but it is not working for some times.Is there any other way to give tagname for testcases..

2 个答案:

答案 0 :(得分:2)

Robotframework docs to the rescue: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#tagging-test-cases

Open testsuite in any text editor and check if testcases have [Tags] entry in their body. Additionally you can set default tags for whole test suite by using @email_type.header.gsub('<Lot_No>',"#{view_context.link_to tile, root_url + product_tile_path(params)}") in Default Tags

Tags are free text, but they are normalized so that they are converted to lowercase and all spaces are removed. If a test case gets the same tag several times, other occurrences than the first one are removed. Tags can be created using variables, assuming that those variables exist.

Example from docs (check the docs for details,how to run testcases by tags name is described in other part of docs http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#by-tag-names):

Settings

答案 1 :(得分:0)

标签为机器人测试执行提供了灵活性。

尝试以下方法。

  1. 在套件级别提供标签 - 套件下的所有测试用例都从套件继承标签。

  2. 为尚未准备好运行的测试用例提供标签(示例标签:NotReady / UnderTest等)

  3. 执行机器人测试用例按标签名称提供--include和--exclude选项

  4. 来自机器人用户指南的片段以供快速参考

      

    可以通过标签名称包含和排除测试用例   --include(-i)和--exclude(-e)选项。如果使用--include选项,则仅选择具有匹配标记的测试用例,并使用--exclude选项测试用例具有匹配   标签不是。如果两者都使用,则只使用标记匹配的测试   选择前选项,而不选择匹配后者的标签。

         

    - 包含示例   --exclude not_ready   --include regression --exclude long_lasting可以多次使用--include和--exclude来匹配多个标签。在这种情况下,如果测试具有与任何包含的标记匹配的标记,则选择该测试   标签,也没有匹配任何排除标签的标签。