Testing Excellence

  • QA Basics
  • Technical QA
  • Agile Testing
  • Questions
  • Quizzes
Home » Technical Skills » Run All Test Classes in a Package from testng.xml Suite

Run All Test Classes in a Package from testng.xml Suite

Updated: December 2, 2018 - Amir Ghahrai

<suite name="Suite1" verbose="1">
    <test name="all-tests">
        <packages>
            <package name="com.testingexcellence.tests.ui"/>
        </packages>
    </test>
</suite>

If you need to run all tests from multiple packages, you can use:

<suite name="Suite2" verbose="1">
    <test name="all-tests">
        <packages>
            <package name="com.testingexcellence.tests.ui"/>
            <package name="com.testingexcellence.tests.api"/>
        </packages>
    </test>
</suite>

If there are many packages with tests that all need to be executed, rather than listing all package names individually, we can use regular expression to include all packages, such as:

<suite name="Suite-3" verbose="1">
  <test name="all-packages">
    <packages>
      <package name=".*" />
    </packages>
  </test>
</suite>

Note, there is a “.” before the * in the package name, which indicates all package names.

Tags: Technical Skills





Selected Articles

  • Test Automation Problems
  • Test Automation Strategy
  • Agile Test Strategy example
  • How QAs add value in agile
  • Agile without automation
  • How agile killed managers
  • Agile testing challenges
  • Testing e-commerce websites
  • Role of QA manager in agile
  • Are you a good agile tester?
  • BDD tips and best practices
  • Myths of test automation
  • Test automation tips
  • Test automation pros & cons






Favorites Links

Java for Testers

Selenium Tutorial

Testing in Agile and DevOps

 

Copyright © 2019 All rights reserved · www.testingexcellence.com

  • About
  • Contact
  • Subscribe
  • Privacy Policy
  • Terms of Use