TestNG Output

Hi,

http://www.toolsqa.com/selenium-webdriver/testng-data-provider-excel/

Final Test Case – What is the expected result for this Test Method.
I have provided 2 sets of Test data(User name & Password). But TestNg shows me
Total tests run: 1, Failures: 0, Skips: 0.

How will i get the “Total tests run: 2, Failures: 0, Skips: 0” ?

Many Thanks,
Revathi

Add Comment
  • 3 Answer(s)

    Hi Smitha,

    Code is provided in the ToolsQA site only. The test method runs twice for the provided test data, since i have provided 2 sets of Username & Password. But Test NG displays Total tests run: 1, Failures: 0, Skips: 0. result.

    I want to know what should we do to get Total tests run: 2, Failures: 0, Skips: 0 as a result.

    Thanks,
    Revathi

    Train Answered on May 8, 2015.
    Add Comment

    I am providing test data from excel sheet as 2 columns then how do i control this scenario?

    Thanks,
    Revathi

    Train Answered on May 8, 2015.

    Please use comment section…

    on May 9, 2015.
    Add Comment

    It should display “Total tests run: 2, Failures: 0, Skips: 0”.. Even I got the  exact result only.

    Just do check the execution. Is it closing the browser window? is the test executing properly.

    If you want you can simply check this

    
    public class DataProviderTest{
    private static WebDriver driver;
    @DataProvider(name = "Authentication")
    public static Object[][] credentials() {
    // The number of times data is repeated, test will be executed the same no. of times
    // Here it will execute two times
    return new Object[][] { { "testuser_1", "Test@123" }, { "testuser_1", "Test@123" }};
    }
    // Here we are calling the Data Provider object with its Name
    @Test(dataProvider = "Authentication")
    public void test(String sUsername, String sPassword) {
    System.out.println(sUsername+"\n "+sPassword);
    }
    }
    
    
    Train Answered on May 8, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.