Forum Discussion
I have Test cases on Excel for Every Row 1 = Testcase 1, Row 2 = Testcase 2, when i run a request i am getting report as Request Pass/Fail but not the Test case name from Excel
Hi there, I am assuming that this is a data driven test and data is being used by a REST test step. you could add a groovy step to read Datasource data and dynamically update testcase name on the run.
for Ex: your test case structure would be
Datasource
Groovy Script
RestStep
DataSource Loop
Groovy script:
//Variables to store datasource values def TestData = context.expand( '${DataSource#Row}' ) //## get REST Step Name and dynamically change// def RestStep = testRunner.testCase.getTestStepAt(2) RestStep.setName("RestStep_$TestData")
- 6787 years agoRegular Contributor
- New2API7 years agoFrequent Contributor
Hi, your data source loop should go back groovy script in order get a new row value and update your test case.
for ex: attached image shows sample data source values.
lets assume if you want to append values from TestCaseName for each iteration then groovy script line should be -
def testInput = context.expand('${DataSource#TestCaseName}')
then follow steps mentioned in previous post.
TestCase.PNG image shows DataSource loop configuration.
Related Content
- 2 years ago
- 4 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 21 days ago