cancel
Showing results for 
Search instead for 
Did you mean: 

how to make the req URL variable for http testcase (to carry out the test in different environments)

SOLVED
Highlighted
New Contributor

how to make the req URL variable for http testcase (to carry out the test in different environments)

Hi everyone.. I am new to SOAP UI (using open source) and trying to explore the available options.

I need to create a test step HTTP Request for which I need to provide URL. The URL contains environment name hence I want to set it up as a variable. 

Ex: URL is 

https://api.<environment name>.base.be/ocapi/oauth/userdetails

How do I achieve this?

 

For SOAP and REST requests that I worked on earlier, I could use ${#Project#envName} to make environment name variable in the Endpoint URL, by setting the value as Project level parameter. However I am not able to do the same for Request URL

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Thank you Lucian for the solution.

Issue was with the Request Properties where the variable wasn't set correctly.

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Hi,

 

The project property approach that you've used before should work fine. For instance I created a project property called 'environmentHost' and gave it the value 'google.com'. 

 

2018-05-17_07h59_13.png

 

I then created an http request and referenced the property like:

 

http://${#Project#environmentHost}/

 

...and the property was successfully replaced in the request by its value.

 

2018-05-17_08h01_13.png



If my answer helped please click on the 'Accept as Solution' button.
Highlighted
New Contributor

Thanks for the quick response.

If I do that, this is what is happening. All the capital letters are appearing as small and it's not being recognized.

 

 

Highlighted

Well the property is only replaced with its value when the request is done. Can you post a sample project?

 

By the way, are you from Belgium? Smiley Very Happy



If my answer helped please click on the 'Accept as Solution' button.
Highlighted
New Contributor

Thank you Lucian for the solution.

Issue was with the Request Properties where the variable wasn't set correctly.

View solution in original post

Highlighted
Regular Visitor

Hi.

I tried out to define the value as variable (${#API TESTING#individualSearchId}) but this doesn't work. 

individualSearchId was set with property transfer.

Am I doing something wrong?

Or is there annother solution?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors