Forum Discussion
smadji
11 years agoContributor
Although I am not seasoned myself - I have used property to store my URL and used property expension to call the property from the URL field.
So when I change environments I do it within the property only. One change and all is well with the world.
steps:
1. create a custom property at the project level
2. go to a request and remove the URL
3. Use this link and my example bellow to construct the 'new' url (which calls the property) http://www.soapui.org/Scripting-Propert ... nsion.html
Example:
${#Project#end_point}
my property is named 'end_point'
dont forget the dollar sign and the rest of the brackets
4. Add it to the URL list (use the drop down in the URL to choose the add option)
5. go to all your requests and update the URL from the drop down
-- Note for soap: Because in SOAP the URL shows in soap as it's full URL (end point, and part of the request), you wont be able to use the drop down for the saved URL. Instead copy paste the endpoint part into the endpoint of the URL leaving the rest of the URL intact.
2 mistakes that I made when doing it the first time:
1. Since my API is under development and the versions increase - I added the version to the URL. That was a big fail. Specially when the automation was used within a building tool (Jenkins in my case), also - this worked for rest and not soap so I ended up having 2 endpoint properties.
2. avoid having more then 1 endpoint property if possible, trying to add bits of the rest of the URL into the endpoint is going to make your life more complicated (specifically issue in soap requests)
So when I change environments I do it within the property only. One change and all is well with the world.
steps:
1. create a custom property at the project level
2. go to a request and remove the URL
3. Use this link and my example bellow to construct the 'new' url (which calls the property) http://www.soapui.org/Scripting-Propert ... nsion.html
Example:
${#Project#end_point}
my property is named 'end_point'
dont forget the dollar sign and the rest of the brackets
4. Add it to the URL list (use the drop down in the URL to choose the add option)
5. go to all your requests and update the URL from the drop down
-- Note for soap: Because in SOAP the URL shows in soap as it's full URL (end point, and part of the request), you wont be able to use the drop down for the saved URL. Instead copy paste the endpoint part into the endpoint of the URL leaving the rest of the URL intact.
2 mistakes that I made when doing it the first time:
1. Since my API is under development and the versions increase - I added the version to the URL. That was a big fail. Specially when the automation was used within a building tool (Jenkins in my case), also - this worked for rest and not soap so I ended up having 2 endpoint properties.
2. avoid having more then 1 endpoint property if possible, trying to add bits of the rest of the URL into the endpoint is going to make your life more complicated (specifically issue in soap requests)
Related Content
- 6 years ago
- 5 years ago
- 14 years ago
- 2 years ago
- 10 years ago
Recent Discussions
- 7 days ago