Hi Neerja, to run multiple test cases using TestNG test suite in selenium, perform these steps one by one:
-
Right click on Project folder, go to New and select ‘File‘.
-
In New file wizard, add file name as ‘testng.xml‘ and click on Finish button.
-
It will add testng.xml file under your project folder.
-
Now add below given code in your testng.xml file. After giving appropriate names and adding your test cases in <classes> tag, your testng.xml file will looks like this:
-
Now run the xml file by right click on the testng.xml file and select Run As > TestNG Suite.
For further understanding, you can refer to the Selenium Training.