Forum Discussion
HimanshuTayal
Community Hero
Hi ABCDEFG
The code i have given to you, please replace
def endpoint = context.testCase.getTestStepByName("Request").getPropertyValue("Endpoint") def resourcePath = context.testCase.getTestStepByName("Request").resource
def data = endpoint + "/" + resourcePath def file = new File("D:/test.txt").write(data.toString(),"UTF-8")
The part i have BOLD, from the name of your request
And the answer to your second question is, just replace the Request with the Steps name you are having or you can apply loops as well on the Test Case.
Do Like and Accept if you Find the Solution
Thanks,
Himanshu Tayal
ABCDEFG
6 years agoContributor
Great HimanshuTayal. its working.
however when retrieving the 'resourcePath' path; its having a veribiage "RestResource:" right infront of the resource path, Do you know how to get the resourcepath with out this verbiage?
sample response == 'RestResource: /cloud-services/api/test/v1/health'
Else i have to write another block of code to trim it.
Thanks!