运行远程selenium测试会抛出错误:'[testng]未知选项:-sourcedir'

时间:2011-09-13 17:54:05

标签: ant selenium vmware jenkins testng

我有一个VM集群(所有Windows 7),我试图用它来运行Jenkins的持续集成。测试是用Java和我的本地环境(Windows 7)编写的。我可以远程连接到VM并运行我的测试而没有任何问题。

当我安排测试在Jenkins中运行时,我使用相同的命令行参数但在执行期间我得到:

...

start-server:

doTest:
   [testng] Usage: <main class> [options]
   [testng]  The XML suite files to run
   [testng] Unknown option: -sourcedir
   [testng]   Options:
   [testng]     -configfailurepolicy               Configuration failure policy (skip or
   [testng]                                        continue)
   [testng]     -d                                 Output directory
   [testng]     -dataproviderthreadcount           Number of threads to use when running
   [testng]                                        data providers
   [testng]     -excludegroups                     Comma-separated list of group names to 
   [testng]                                        exclude
   [testng]     -groups                            Comma-separated list of group names to be
   [testng]                                        run
   [testng]     -junit                             JUnit mode
   [testng]                                        Default: false
   [testng]     -listener                          List of .class files or list of class
   [testng]                                        names implementing ITestListener or
   [testng]                                        ISuiteListener
   [testng]     -methods                           Comma separated of test methods
   [testng]                                        Default: []
   [testng]     -methodselectors                   List of .class files or list of class
   [testng]                                        names implementing IMethodSelector
   [testng]     -objectfactory                     List of .class files or list of class
   [testng]                                        names implementing ITestRunnerFactory
   [testng]     -parallel                          Parallel mode (methods, tests or classes)
   [testng]     -port                              The port
   [testng]     -reporter                          Extended configuration for custom report
   [testng]                                        listener
   [testng]     -suitename                         Default name of test suite, if not
   [testng]                                        specified in suite definition file or
   [testng]                                        source code
   [testng]     -suitethreadpoolsize               Size of the thread pool to use to run
   [testng]                                        suites
   [testng]                                        Default: 1
   [testng]     -testclass                         The list of test classes
   [testng]     -testjar                           A jar file containing the tests
   [testng]     -testname                          Default name of test, if not specified in
   [testng]                                        suitedefinition file or source code
   [testng]     -testnames                         The list of test names to run
   [testng]     -testrunfactory, -testRunFactory   The factory used to create tests
   [testng]     -threadcount                       Number of threads to use when running
   [testng]                                        tests in parallel
   [testng]     -usedefaultlisteners               Whether to use the default listeners
   [testng]                                        Default: true
   [testng]     -log, -verbose                     Level of verbosity
   [testng]

停止服务器: [selenium-shutdown]获取:http://localhost:4444/selenium-server/driver/?cmd=shutDown [selenium-shutdown]收件人:/var/lib/jenkins/jobs/HomePage/workspace/result.txt [selenium-shutdown]预计关机期间的DGF错误

我的Jenkins实例在另一个盒子(ubuntu)上运行。我刚刚在那个盒子上升级到Ant 1.8.2。这可能是一个问题吗?我已经看到这个问题有几个地方,但还没有具体的答案,感谢任何帮助,谢谢。

1 个答案:

答案 0 :(得分:1)

出于某种原因,Jenkins将“-sourcedir”传递给TestNG,这不是公认的选项。