【问题标题】:How to create script shell to execute class name in TestNg By jenkins如何创建脚本 shell 以在 TestNg 中执行类名 作者 jenkins
【发布时间】:2019-07-23 15:36:50
【问题描述】:

我想在 Jenkins 中通过 Script Shell 启动一些测试,我使用 TestNG 和 selenium Web 驱动程序。目的是在 TestNG 中启动一个类名,而不是所有测试。

我在jenkins中写了这个命令Script shell:

#!/bin/bash
java -cp F:\Selenium\SampleTestNG\lib\*;F:\Selenium\SampleTestNG\bin org.testng.TestNG "com.az.tests.TNR_Production_TestsA" testng.xml

【问题讨论】:

    标签: jenkins testng


    【解决方案1】:

    您应该使用-testclass 命令行参数来传递测试类集。

    在此处引用文档以供快速参考。

    可以在您的类路径中找到的以逗号分隔的类列表。

    所以你的shell脚本看起来像

    #!/bin/bash
    java -cp F:\Selenium\SampleTestNG\lib\*;F:\Selenium\SampleTestNG\bin org.testng.TestNG -testclass com.az.tests.TNR_Production_TestsA
    

    更多信息请参考官方文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-31
      • 1970-01-01
      • 2015-07-27
      • 1970-01-01
      • 2021-09-05
      • 1970-01-01
      相关资源
      最近更新 更多