testng.xml Testng
Testng
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite Name" >
<test name="TestA" allow-return-values="true">
<classes>
<class name ="listnerDemo.Testcases" />
</classes>
</test>
<listeners>
<listener class-name="listnerDemo.CustomerListner"/>
</listeners>
</suite>
*********************************** if you need to run multiple packages ****** **
let me give an example if you have three sets that have several cases, then create an XML tree file and write the code, as described above, for all three packages
then create a testng.xml file that will contain the code below
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<Suite name="Data driver testng project">
<Suite-files>
<Suite-files path="C:\Arpan\Study Documents\Selenium\Selenium Framework\Core_Framework_TestNG\suiteA.xml" />
<Suite-files path="C:\Arpan\Study Documents\Selenium\Selenium Framework\Core_Framework_TestNG\suiteB.xml" />
<Suite-files path="C:\Arpan\Study Documents\Selenium\Selenium Framework\Core_Framework_TestNG\suiteC.xml" />
</Suite-files>
</Suite>
Then run testng.xml Run as Testng, then it will run the entire program from these three packages
source
share