Forum Discussion
ankitaT
12 years agoContributor
If I am getting the scenario correctly, here is a solution I can offer.
make your endpoint url as a variable taken from project/suite property as in
${#Project#PIEndpointURL_REST}
Then, when u capture that id value in variable, define another string variable, and append this id. eg:
def url = context.expand(' ${#Project#PIEndpointURL_REST}')
def temp = url + id
log.info temp
Now as the last step, using groovy script, write this new value back to the project/suite property which is used as endpoint url. Like if u r defining the URl as a testsuite prop, then:
def ts = testRunner.testCase.testSuite.project.testSuites[<yourTestSuiteName>]
tc.setPropertyValue("PIEndpointURL_REST", temp)
Now next json request will take this newly written url with id as its endpoint.
Let me know if it helps.
All the best
Regards,
Ankita
make your endpoint url as a variable taken from project/suite property as in
${#Project#PIEndpointURL_REST}
Then, when u capture that id value in variable, define another string variable, and append this id. eg:
def url = context.expand(' ${#Project#PIEndpointURL_REST}')
def temp = url + id
log.info temp
Now as the last step, using groovy script, write this new value back to the project/suite property which is used as endpoint url. Like if u r defining the URl as a testsuite prop, then:
def ts = testRunner.testCase.testSuite.project.testSuites[<yourTestSuiteName>]
tc.setPropertyValue("PIEndpointURL_REST", temp)
Now next json request will take this newly written url with id as its endpoint.
Let me know if it helps.
All the best
Regards,
Ankita
Related Content
- 10 months ago
- 5 years ago
- 6 years ago
- 2 years ago
- 9 years ago
Recent Discussions
- 21 days ago