Suite section: <suite>

The <suite> section of the XML file can contain groups, listeners, parameters, and test sections. It also can have attributes added to it such as name, preserve-order, parallel, thread-count, verbose, and so on. Here's the format:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="My_Test_Suite" preserve-order="true" parallel="false"
thread-count="1" verbose="2">

</suite>

The suite name attribute can be used for reporting purposes and can be retrieved using the TestNG ISuite interface.

preserve-order tells TestNG whether or not to run the test classes in a random order, and if not, it then lets test class rules take effect: dependsOnMethods, sequential names, priority, and to name a few. This takes a true or false value.

parallel tells TestNG whether or not to run in single or multithreaded mode. The options for this attribute are false, test, classes, methods, and instances. The different options for parallel testing will be discussed in the next chapter.

thread-count determines how many threads to open to run the test suite in parallel. If a user designs the suite to run in parallel at the classes level, and the <test> section contains 10 classes, then they would want to set the thread-count = "10" to run each one in its own browser or mobile thread.

verbose tells TestNG how much data to print to standard output when running the tests, one being the least amount of data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.53.209