Friday, 5 June 2015

Running different suites using TestNG

Running different suites:


For this we require 3 files:


1. testng.xml (for 1st suite)
2. testng1.xml (for 2nd suite)
3. suite.xml (for running testng.xml and testng1.xml)

Please find below code for testng.xml



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >


<suite name="Suite1" parallel="tests">


  <test name="exampletest1.0_Mozila">

  <parameter name="browser" value="MFF"/>

    <classes>

       <class name="FirstMavenProject.zellaxSolutionsProject01.firstTest" />

    </classes>

  </test>

 

  <test name="exampletest2.0_Chrome" >

 

          <parameter name="browser" value="CH"/>

    <classes>

       <class name="FirstMavenProject.zellaxSolutionsProject01.firstTest" />

    </classes>

  </test>

    </suite>

Please find below code for testng1.xml



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >


<suite name="Suite2">


  <test name="exampletest1.0">

    <classes>

       <class name="FirstMavenProject.zellaxSolutionsProject01.firstTest" />

    </classes>

  </test>

  

    <test name="exampletest2.0">

    <classes>

       <class name="FirstMavenProject.zellaxSolutionsProject01.secondTest" />

    </classes>

  </test>

    </suite>

Please find below code for suite.xml


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >


<suite name="suite of suites">

    <suite-files>

        <suite-file path="testng.xml" />

        <suite-file path="testng1.xml" />

    </suite-files>

</suite>

No comments:

Post a Comment