简体   繁体   中英

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. I have about 50 tests in one suite and one file right now what I want to do is separate tests into several suites:

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?

I think my testng.xml file will look something like:

 <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
  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM