【问题标题】:Selenium XML/Propeerties file Test suite?Selenium XML/Properties 文件测试套件?
【发布时间】:2014-09-11 05:37:53
【问题描述】:

我想通过 XML 或属性文件来配置运行哪些 selenium 测试,哪些不运行。

例子

testCase1=false
testCase2=true
testCase3=true

现在如果我开始 selenium 测试,它必须只运行 2 和 3。

有没有可能?

另外,我是否需要多个端口来同时运行测试?

【问题讨论】:

    标签: selenium selenium-webdriver selenium-grid


    【解决方案1】:

    如果您使用TestNG,您可以使用@Test(enabled = false),即enabled 参数作为@Test 注释。见这里:http://www.tutorialspoint.com/testng/testng_ignore_test.htm

    【讨论】:

    • "@Test(enabled = false)" 在我们构建项目后进入类文件。但我想在属性文件或 xml 上进行配置。
    • 你想在一个类中执行多个类还是测试方法?
    【解决方案2】:

    I wanted to configure which selenium tests to run and which not to by either XML or through properties file.

    这取决于您使用哪个框架来运行测试。

    对于 JUnit,您可以使用 @Ignore 跳过测试方法。

    对于 TestNG,您可以将测试方法 enabled=false 设置为 German Petrov 回答

    互联网上有大量可用的信息。谷歌一下。

    Also do i need multiple ports to run tests simultaneously?
    

    不,你不需要多个端口,你可以设置并行测试执行,TestNG对其提供更好的支持。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-15
      • 1970-01-01
      • 1970-01-01
      • 2011-07-14
      • 1970-01-01
      • 1970-01-01
      • 2020-12-10
      • 1970-01-01
      相关资源
      最近更新 更多