Kimdongart1
2 years agoNew Contributor
get teststep name/label
Hi. Im pretty new to this, so i need to ask. Have googled alot, but no answer. Problem: "Save/export request and response as file into folder" I have a groove script i found via google sear...
- 2 years ago
Hi Kimdongart1 ,
See my reply in recent topic https://community.smartbear.com/t5/ReadyAPI-Questions/Get-test-step-name-via-property-expansion-in-groovy-step/m-p/244399#M57574
To get a test step name you could just type "testRunner.testCase.getTestStep" followed by a "Ctrl+space" to see the autocomplete options:
So:
String testStepNameStep1 = testRunner.testCase.getTestStepAt(0).getName()
File req = new File("filePath" + testStepNameStep1 + "_request.xml")
File res = new File("filePath" + testStepNameStep1 + "_response.xml")