4

I have a situation where there is a test that gets data from a dataprovider. This dataprovider has a lot of rows (huge dataset). I would like to understand, if there is a way to find out which data the test failed for, when there is a failure. I run my tests through IntelliJ. One option I have in mind is to add an identifier to every row of data, but I would like to understand if there are better solutions.

Barett
  • 5,826
  • 6
  • 51
  • 55
user3325862
  • 121
  • 2
  • 7

1 Answers1

1

Where are you looking for the results. Testng gives output with the parameters passed to the @test from which you can identify which data set was the test executed for. Look in the testresults folder.

Shamik
  • 1,591
  • 2
  • 16
  • 36
  • Unfortunately, the data in dataprovider is dynamic. So it is not easy to trace which of the data failed. Does TestNg guarantee order of execution in the data provider? – user3325862 Dec 13 '14 at 04:34
  • Yes it maintains the order for dataset, You can also pass on something like TestCase 1, TestCase 2 as an extra parameter in the dataprovider object and use it to identify the testcase. And even if the data is dynamic the test case will show what the data was for the failed testcase. – Shamik Dec 13 '14 at 06:59