how to extract text from Json Node
Hello,
Can anyone help me in extracting text value from URL.
I have a Json node response in the following format:
JSON node =url
Value=http://aaa-test-bbb.websites.net/sample/c6e7b442-a33c-4bd3-bbbb-ef2d5873b661/l/TSKR4AM/details
I need to extract and pass the text highlighted in bold can be through property transfer or groovy script.
Appreciate quick response.
Thank you.
Brij
Hi,
It is not possible out of the box since we can get the URL with point and click but to extract a resource path value you need groovy,
https://www.soapui.org/getting-started/point-and-click-testing/point-and-click-with-xpath.html
You can add a groovy script test Step for example if,
def str ="http://aaa-test-bbb.websites.net/sample/c6e7b442-a
33c-4bd3-bbbb-ef2d5873b661/l/TSKR4AM/details" def vals = str.split("/")
def token = vals[6].toString()
testRunner.testCase.setPropertyValue("token",token)
You can then add this expansion to substitute the value,${#TestCase#token}
Thanks