Forum Discussion
- avidCoderSuper Contributor
Could you please explain or give some more insight for the same. What actually you want to report or validate?
- 678Regular Contributor
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
- New2APIFrequent Contributor
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")
- pkarun007Senior Member
Hi,
I have implemented data-driven test through Excel except the below issue:
In My excel i have the first column as test case name. All I want is, running the test suite should get the test case name from the first column of the excel and run the test steps in subsequent columns.
Let's assume if I have 3 test cases as below:
1. Test Case - valid employee
2. Test Case - valid address
3. Test Case - valid car
After running the test suite, I expect the below:
Test Suite
Test Case - valid employee
Test Case - valid address
Test Case - valid car
I'm not sure where to have the DataSource, Groovy Script, Request and DataSourceLoop to accomplish the above.
Attached file which i accomplished with the below issues:
1. My Groovy script is updating the test step with the test case name instead of having a separate test case as mentioned above.
Related Content
- 2 years ago
- 4 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 6 days ago