简体   繁体   English

Maven / TestNG / Selenium-我可以在一个testng.xml中设置多个测试套件,并在不同的时间运行不同的套件吗?

[英]Maven/TestNG/Selenium - Can I set up multiple tests suites in one testng.xml and run different ones at different times?

I am using Maven/TestNG/Selenium. 我正在使用Maven / TestNG / Selenium。 I have about 50 tests in one suite and one file right now what I want to do is separate tests into several suites: 我现在在一个套件中有大约50个测试,并且现在有一个文件,我要做的就是将测试分成几个套件:

Acceptance - Will have the five tests to accept the build Full Pass - The other forty-five tests Debug - The one testing I am currently coding and debugging 接受-将有五项测试来接受构建的完整通过-另一四十五项测试调试-我目前正在编码和调试的一项测试

I want to be able to run a particular suite as needed. 我希望能够根据需要运行特定的套件。 Can I do this from one testng.xml file or do I need multiple files? 我可以从一个testng.xml文件执行此操作,还是需要多个文件?

I think my testng.xml file will look something like: 我认为我的testng.xml文件如下所示:

 <suite name="ACCEPT">
  <test name="blah">   </test>
  <test name="foo">   </test>
</suite> 

<suite name="FULLPASS">
  <test name="T1">    </test>
 <test name="T2">    </test>
 <test name="T3">    </test>
</suite>
  1. You can refer other suites in suite.xml as shown here 你可以参考在suite.xml其他套房,显示这里
  2. If you're using surefire you can configure execution in POM using suiteXmlFiles tag or by passing system property -Dsurefire.suiteXmlFiles=suite.xml like shown here 如果您使用的万无一失,你可以使用配置POM执行suiteXmlFiles标签或传递系统属性-Dsurefire.suiteXmlFiles=suite.xml一样显示在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 Cucumber-Maven(TestNG)中运行 testng.xml - Can't run testng.xml in Cucumber-Maven(TestNG) 我想在设置方法中使用 selenium 执行多用户登录操作我没有使用 testng.xml 我只使用 maven pom.xml - I want to perform multiple user login action using selenium in set up method I am not using testng.xml I am using maven pom.xml only TestNG-如何通过testng.xml设置运行@Test方法的顺序? - TestNG - How can I set up the order of running @Test methods through testng.xml? 如何将动态参数传递给 testNG.xml 运行多个测试 - How to pass dynamic parameter TO testNG.xml run multiple tests 如何准备testng.xml以多次调用多个包中的多个方法(每次不同) - how to prepare testng.xml for calling multiple methods(different each time)from multiple packages multiple times 无法运行testng.xml SELENIUM - Unable to run testng.xml SELENIUM 无法为不同的浏览器运行testng.xml文件中的回归组 - Unable to run the Regression group in testng.xml file for different browsers 通过TestNG在不同的浏览器上运行硒测试 - Run selenium tests on different browsers via TestNG 使用testng.xml使用maven运行单个TestNG测试 - Run single TestNG test with maven by using testng.xml 如何运行套件中存在的单个/多个测试,即testng.xml - How to run individual/multiple tests present in suite i.e testng.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM