TestNG | Log level

Sometimes, you may find some odd behavior in your TestNG execution. To better understand some of the decisions TestNG makes, you can increase the log level of TestNG itself.

In your TestNG.xml file, you can add the verbose="10" attribute to the <suite> tag to have TestNG print the most detailed information available to your console output during execution. The attribute accepts levels between 1 and 10, so you will receive varying levels of details as you increase the value.

Copy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests" thread-count="10" verbose="10">
    <listeners>
        <listener class-name="org.uncommons.reportng.HTMLReporter"/>
        <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
        <listener class-name="utilities.TestListener" />
    </listeners>  
    <test name="Test Chrome implicitNotVisible">
    <parameter name="targetEnvironment" value="Chrome" />
    <parameter name="network" value="" />
    <parameter name="networkLatency" value="" />
    <classes>
        <class name="AmazonTesting.SleepTestSystem">
            <methods>
                <include name="implicitNotVisible" />
            </methods>
        </class>
    </classes>   
    </test>
</suite>

During execution, your console output will contain information regarding the "planned" tests, methods, and listeners that TestNG is going to run. You will also receive additional logic details from TestNG as it runs your tests.