Wednesday, 15 January 2014

TestNG - Verbose Attribute [Selenium Users]

Verbose Attribute lets you obtain clear reports through IDE console. This attribute will be placed inside the <Suite> tag of testng.xml as shown below:

<suite name="Suite" parallel="tests" verbose="2">

There are 10 levels of Verbose, starting from 1 to 10.
verbose="1"  —  verbose="10"

Verbose="10" gives more test details on console output whereas verbose="1" display less details.
Let me explain with an example:



Verbose "1"

1| Open testng.xml make sure verbose="1"


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests" verbose="1">
    <test name="Test1">
        <classes>      
            <class name="bundle.Verb"/>
            <class name="bundle.Noun"/>
       </classes>
    </test>
    <test name="Test2">
        <classes>
            <class name="bundle.Adjective"/>      
        </classes>
    </test>

</suite> <!-- Suite -->



2| The IDE console looks like




Verbose "2"

1| Open testng.xml make sure verbose="2"


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests" verbose="2">
    <test name="Test1">
        <classes>      
            <class name="bundle.Verb"/>
            <class name="bundle.Noun"/>
       </classes>
    </test>
    <test name="Test2">
        <classes>
            <class name="bundle.Adjective"/>      
        </classes>
    </test>

</suite> <!-- Suite -->



2| The IDE console looks like




Verbose "10"

1| Open testng.xml make sure verbose="10"


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests" thread-count="2" verbose="10">
    <test name="Test1">
        <classes>      
            <class name="bundle.Verb"/>
            <class name="bundle.Noun"/>
       </classes>
    </test>

</suite> <!-- Suite -->


2| The IDE console looks like


4 comments:

  1. Thanks for the great information in your blog Selenium Training in Chennai

    ReplyDelete
  2. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete
  3. Nice Article,

    But below line is incorrect:-

    There are 10 levels of Verbose, starting from 1 to 10.
    verbose="1" — verbose="10"

    You can define verbose value > 10 as well.

    ReplyDelete
  4. Amazing, thanks a lot my friend, I was also siting like a your banner image when I was thrown into Selenium.When I started learning then I understood it has got really cool stuff.
    I can vouch webdriver has proved the best feature in Selenium framework.
    Thanks a lot for taking a time to share a wonderful article.
    Selenium Training Course |
    Selenium Training in Velachery

    ReplyDelete