Forum Discussion
4 Replies
- rupert_andersonValued Contributor
Hi,
REST requests have quite a fixed format as I am sure you're aware.
To set the enpoint property, its quite easy using a property expansion e.g.
GroovyTestStep (before REST Request TestStep)
context["host"]="localhost"
then in the REST Request TestStep you can get use the value of the host variable to set all or part of the endpoint e.g.
http://${host}:7070
If you mean how to set the resource, I'm sure this is possible by somehow updating the object model of the TestStep, but I find it easier in these situations to instead use an HTTP Request TestsStep, where you are able to control the full URL by using a property expansion like above e.g.
In the Request URL property put something like http://localhost:7070/${context} or simply set the whole url using a property expansion set in a previous TestStep.
Hope this helps,
Cheers,
Rup
- padmanabamNew Contributor
Hi,
Thanks for responding. I parameterized the resource url using Project level properties and I am able to successfully construct the dynamically URL. Thanks
- rupert_andersonValued Contributor
Hi,
Ok, no problem.
Glad to have helped,
Cheers,
Rupert
Related Content
Recent Discussions
- 11 days ago