Working with multiple testng.xml files

Mohammad Faisal Khatri
6 min readDec 6, 2022

Currently, I am working on an open source project to include all the collection of example codes related to automating a website using Selenium WebDriver. The project is available on github and can be checked out by anyone who wants to learn Web Automation using Selenium WebDriver.

Now, as the project grew, there was a need to create multiple testng.xml files for running different tests. These multiple files were created to segregate the tests and place all the tests related to a respective website in a single testng.xml(I have used different demo websites to demo different actions that can be automated using Selenium WebDriver).

I thought of throwing some light on the usage of multiple testng.xml file and how to execute tests. Now, since Maven is the build tool that is being used, a single testng.xml file is required to run all the tests in the project. Also, there were cases which had to be debugged for the test failures by running a single testng.xml file.

--

--

Mohammad Faisal Khatri

QA with 16+ years of experience in automation as well as manual testing. Freelancer, Blogger, Trainer, Mentor and open source contirbutor.