低于异常的是Testng,但是我的项目中没有显示错误

时间:2018-11-29 03:15:28

标签: maven selenium-webdriver testng

Default suite
Total tests run: 0, Failures: 0, Skips: 0
Configuration Failures: 1, Skips: 0
===============================================

[TestNG] No tests found. Nothing was run
Usage: <main class> [options] The XML suite files to run
  Options:
    -configfailurepolicy
      Configuration failure policy (skip or continue)
    -d
      Output directory
    -dataproviderthreadcount
      Number of threads to use when running data providers
    -excludegroups
      Comma-separated list of group names to  exclude
    -groups
      Comma-separated list of group names to be run
    -junit
      JUnit mode
      Default: false
    -listener
      List of .class files or list of class names implementing ITestListener 
      or ISuiteListener
    -methods
      Comma separated of test methods
      Default: []
    -methodselectors
      List of .class files or list of class names implementing IMethodSelector
    -mixed
      Mixed mode - autodetect the type of current test and run it with 
      appropriate runner
      Default: false
    -objectfactory
      List of .class files or list of class names implementing 
      ITestRunnerFactory 
    -parallel
      Parallel mode (methods, tests or classes)
      Possible Values: [tests, methods, classes, instances, none, true, false]
    -port
      The port
    -reporter
      Extended configuration for custom report listener
    -suitename
      Default name of test suite, if not specified in suite definition file or 
      source code
    -suitethreadpoolsize
      Size of the thread pool to use to run suites
      Default: 1
    -testclass
      The list of test classes
    -testjar
      A jar file containing the tests
    -testname
      Default name of test, if not specified in suitedefinition file or source 
      code 
    -testnames
      The list of test names to run
    -testrunfactory, -testRunFactory
      The factory used to create tests
    -threadcount
      Number of threads to use when running tests in parallel
    -usedefaultlisteners
      Whether to use the default listeners
      Default: true
    -log, -verbose
      Level of verbosity
    -xmlpathinjar
      The full path to the xml file inside the jar file (only valid if 
      -testjar was specified)
      Default: testng.xml

1 个答案:

答案 0 :(得分:0)

我认为这是一个配置问题。由于您在此处未提供pom.xml详细信息,因此我想指出一些对您有帮助的检查点!

  
      
  1. 将testng.xml添加到项目中,以指向需要执行的正确类。
  2.   
  3. 将pom.xml添加到具有以下所述准确信息的项目中。
  4.   
  5. 在pom.xml文件中包含maven-compiler-plugin。
  6.   
  7. 在pom.xml文件中包含maven-surefire-plugin。
  8.   
  9. 在maven-surefire-plugin下的pom.xml中,不要忘记添加suitexmlfiles标记,该标记将指定要执行的testng.xml文件。
  10.   

感谢和问候,

山丹Jaju