Forum Discussion
Hi,
Thanks for the reply, but what i am trying to do is, on the Test Case level
I have set two properties
SIT - https://10.91.35.41:37093/Services
UAT - https://10.91.37.160:37093/Services
Now on the Setup Script i am trying this
UISupport.prompt("Please select the enviornment", "Environment", ['SIT', 'UAT'])
Now when i select the SIT in the drop down it has to take the SIT properties and run all the test steps.
Thanks,
Kalyan
Hi Kalyan,
Ok, no problem.
So if I am understanding you right:
- you have a TestCase with two properties (SIT=... & UAT=...)
- The TestCase contains multiple Test Request TestSteps
- Depending on the prompt you want to set the endpoint URL of the Request TestSteps to the URL contained in either SIT pr UAT.
So, in a Groovy TestStep how about:
import com.eviware.soapui.support.UISupport
//Conditionally set endpointURL based on result
def result = UISupport.prompt("Please select the enviornment", "Environment", ['SIT', 'UAT'])
if (result=='SIT') context["endpointURL"]=testRunner.testCase.getPropertyValue("SIT")
else context["endpointURL"]=testRunner.testCase.getPropertyValue("UAT")
//Just to check, print it out
log.info context["endpointURL"]
Then in the Request TestSteps, use a property expansion to insert the value of context["endpointURL"] into the endpoint URL box e.g. ${endpointURL}
Is this what you wanted?
Cheers,
Rup
- garlapati9910 years agoOccasional Contributor
Thanks for the help, it works now.
- rupert_anderson10 years agoValued Contributor
Excellent, no problem :-)
If you're happy please can you mark the solution as complete?
Thanks,
Rup
- saib7 years agoOccasional Contributor
Hi
Working same scenario i.e. Endpoint parameterization - but getting endpoint as null.
import com.eviware.soapui.support.UISupport
//Conditionally set endpointURL based on result
def result = UISupport.prompt("Please select the enviornment", "Environment", ['SIT', 'UAT'])
if (result=='SIT')
context["endpointURL"]=testRunner.testCase.getPropertyValue("SIT")
else
context["endpointURL"]=testRunner.testCase.getPropertyValue("UAT")//Just to check, print it out
log.info context["endpointURL"]
Can anyone please advise.
- garlapati997 years agoOccasional Contributor
Please try the below code
def project = UISupport.prompt("Select Environment","Project",['SIT', 'UAT'])
if(project = 'SIT'){
it.properties['Endpoint'].value = project
}
Related Content
- 6 years ago
- 2 years ago
- 2 years ago
- 2 years ago
Recent Discussions
- 2 hours ago
- 3 hours ago
- 8 hours ago
- 10 hours ago