How to catch current data row of datasource - TestSuite/TestCase Level using Groovy Script
Hello,
As per reporting part, I am trying to publish results on HTML Report. During this course of development, i am trying to show log for failed testcase with details like (TestStepStatus, TestStep Messages, Data Row # etc.) using testStepResult.messages by looping through testCaseResult.getResults(). But i am unable to show/log Data Row# from messages to HTML Report only for failed test case.
Can you please assist me with if condition, wherein i can capture Data Row# for failed test case based on testStep status or testCase status.
I tried to trouble shoot using below 2 ways but got stuck half the way. Please look into same:
#1. Adding a Groovy Step, trying to figure out if condition - based on testcase/teststep status so that i can get current data row from Data Source using below :
def row = testRunner.testCase.testSteps["DataSource"].currentRow
#2. Tried to figure out if condition - to be added in Tear down script at TestSuite Level, so that i can filter out and display only data row from messages for failed test case . (PFA attached groovy script added as Tear down script)
As per known fact, TestSuite doesn't have testRunner class hence i am seeking for assistance, so that i can achieve to publish results on HTML report.
Regards,
Ashish