11. YAML - senthilpazhani/SeleniumComplete GitHub Wiki

TestNG supports YAML as an alternate way of specifying your suite file. For example, the following XML file:

 <suite name="SingleSuite" verbose="2" thread-count="4">     
   <parameter name="n" value="42" />     
    <test name="Regression2">
     <groups>
       <run>
         <exclude name="broken" />
       </run>
     </groups>
  
     <classes>
       <class name="test.listeners.ResultEndMillisTest" />
     </classes>
   </test>
 </suite>

and here is its YAML version:

 name: SingleSuite
 threadCount: 4
 parameters: { n: 42 }
  
 tests:
   - name: Regression2
     parameters: { count: 10 }
     excludedGroups: [ broken ]
     classes:
      - test.listeners.ResultEndMillisTest

Here is TestNG's own suite file, and its YAML counterpart. You might find the YAML file format easier to read and to maintain. YAML files are also recognized by the TestNG Eclipse plug-in. You can find more information about YAML and TestNG in this blog post.

⚠️ **GitHub.com Fallback** ⚠️