Forum Discussion

HHaynes's avatar
HHaynes
Contributor
15 years ago

extracting endpoint from previous test step

I want to echo the endpoint of the previous request into the log of the Groovy step that follows it. This is for the situation where the test suite is run from command line - and the runner wants to observe the activity of the script as it runs (including confirming the endpoint that's being used). What's the simple way to grab the endpoint from the previous REST test step?

1 Reply

  • Finally got a chance to do a bit of research and answered my own question...

    def endpoint = testRunner.testCase.getTestStepByName( "YOURTESTSTEPHERE" ).getTestRequest().getEndpoint();


    then when outputting the info log...

    log.info("endpoint [${endpoint}]")


    simple as that