Andy Williams
Andy Williams

Reputation: 907

Using Data Provider and TextNG XML together

I can't figure out how to integrate TestNG XML with Data Providers from an Excel Sheet.

I have confirmed my code Data Provider syntax is correct as my test runs successfully when I run it from the Test Level (See Below)

Excel DataProvider screen shot

However, when I try to implement the Data Provider Using the TestNG XML Configuration (I am trying to run usernames and passwords against multiple browsers) I am getting a Java IOException and (as those can be pretty vague) I am not sure how to proceed.

Please see the screenshots included below of the same test set up implementing the Parameters in the before method as well as the TestNG XML.

Thanks for any help!

testng.xml screen shot 1

testng.xml screen shot 2

Upvotes: 1

Views: 426

Answers (1)

juherr
juherr

Reputation: 5740

Even if it is working at test level, TestNG is doing what it supposed to do (calling methods). So, the problem is located in your LoginDataSheet#getTableArray(...) which is throwing an IOException depending on how you run your test.

Upvotes: 1

Related Questions