Maven 使用mvntest命令并行执行测试

Maven 使用mvntest命令并行执行测试,maven,testing,parallel-processing,testng,Maven,Testing,Parallel Processing,Testng,我有两个测试SignInTest和SignUpTest,我想使用mvntest命令并行执行它们。下面是我的testng.xml的内容 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Big Basket"> <suite-files> <suite-file path="./Customer.xml" /> </suite-file

我有两个测试SignInTest和SignUpTest,我想使用mvntest命令并行执行它们。下面是我的testng.xml的内容

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Big Basket">
  <suite-files>
   <suite-file path="./Customer.xml" />
  </suite-files>
</suite>
但是当我选择testng.xml时,右键单击并选择RunasTestNG套件,并行执行这两个测试


你能帮我解释一下我犯了什么错误吗?

直接指定你的customer.xml文件。可能你有几个testng.xml文件,而maven surefire插件发现了一个错误?您是否尝试过
-DsuiteXmlFile
选项,例如
mvn测试-DsuiteXmlFile=src/java/test/testng
?我会尝试让您知道。谢谢,testng.xml文件在哪里?在资源目录的根目录或其他地方?我已通过将testng.xml复制到我的项目根文件夹中修复了上述问题。现在,当我给出命令mvn test时,我看到以下错误消息
<suite name="Customer" parallel="tests" thread-count="2">
  <test name="Sign Up Test" >
    <classes>
      <class name="com.bigbasket.customer.SignUpTest" />
    </classes>
  </test>
  <test name="Sign In Test" >
    <classes>
      <class name="com.bigbasket.customer.SignInTest" />
    </classes>
  </test>
</suite>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
19.1:test (default-test) on project BigBasket: Execution default-test of goal or
g.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an er
ror in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: Suite file E:\
Selenium\BigBasket\testng.xml is not a valid file
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(Te
stNGXmlTestSuite.java:98)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider
.java:120)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameCla
ssLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork
edBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
121)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException