Forum Discussion

SmartFace's avatar
SmartFace
Occasional Contributor
7 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
    Lucian
    7 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.

  • groovyguy's avatar
    groovyguy
    7 years ago

    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);
  • groovyguy's avatar
    groovyguy
    7 years ago

    Is it working for you now then? :)