Forum Discussion

SmartFace's avatar
Occasional Contributor
6 years ago

HTTP Request test step - dynamic url update from previous test step response url property value?

Please, could someone help me with updating HTTP Request test step url automatically with the value from the previous REST Request test step response?

  • Lucian's avatar
    6 years ago

    Click on the HTTP test step and look into the navigation bar for 'HTTP Request Properties'. Look for the 'Endpoint' property and make sure the value is not empty.

  • So this is one of those instances where the required test step (HTTP request) does not appear to support property expansion. You could put in a groovy script test step that sets the endpoint from the URL in the test case. I am not directly sure if that's possible, but I am looking into it.


    UPDATE: Of course I found the answer after I posted. Try putting this into a groovy test step:


    def URL = context.expand( '${#TestCase#URL}' )
    context.testCase.testSteps["HTTP Request"].setPropertyValue("EndPoint", URL);
  • Is it working for you now then? :) 

12 Replies