Forum Discussion

Kimdongart1's avatar
Kimdongart1
New Contributor
2 years ago
Solved

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 search, that provide me with the correct setup. But it saves the files with  the testCase name, and not the testStep name. 

I was wondering if there are some way to get testStep name. 

 

------------ My current script ---------------

String tcName = testRunner.testCase.getName()

 

File req = new File("filePath" + tcName + "_request.xml")

File res = new File("filePath" + tcName + "_response.xml")

 

req.write context.expand('${"RequestName"#Request}')

res.write context.expand('${"ResponseName"#Response}')

------------------------------

 

This saves files in folder as "tcName_request.xml" and "tcName_response.xml" , but would like to have them as "testStepName_request.xml" and "testStepName_response.xml"

2 Replies