No response is getting printed for username and pass there when trying to use excel via testng data provider

@Test(dataProvider = “Authentication”)

public void testOnBoardingScreen(String userName, String password) throws Exception {

System.out.println(“Username is “ + userName + “and pass is” + password);

}

@DataProvider

public Object[][] Authentication() throws Exception {

ExcelUtils.setExcelFile(“src/test/java/testData/TestData.xlsx”, “Sheet1”);

sTestCaseName = this.toString();

/*

* From above method we get long test case name including package and class name

* etc. The below method will refine your test case name, exactly the name use

* have used

*/

sTestCaseName = ExcelUtils.getTestCaseName(this.toString());

/*

* Fetching the Test Case row number from the Test Data Sheet Getting the Test

* Case name to get the TestCase row from the Test Data Excel sheet

*/

iTestCaseRow = ExcelUtils.getRowContains(sTestCaseName, 0);

System.out.println(“itestcase row is “ +iTestCaseRow);

Object[][] testObjArray = ExcelUtils.getTableArray(“src/test/java/testData/TestData.xlsx”, “Sheet1”,

iTestCaseRow);

System.out.println(“yoo” +testObjArray.toString());

return (testObjArray);

}

CONSOLE:

Username is and pass is

Default Asked on July 11, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

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