Based on the information updated in the question, it looks like you have to access the endpoint in the TearDown Script
of the project.
It also appears that you would need to execute the same set of tests against different base url
of the endpoint and domain. Not sure even you might need to use the credentials accordingly.
Considering the above, it would be easy to project level properties.
Here you would go:
- Create a project level custom property for base url, say
BASE_URL
as property name and value as http://10.0.0.1:8008
. Of course, change it with actual value as needed with respect to the tests to be executed.
- Similarly create another project level property for domain, say
DOMAIN_NAME
and provide its value according the test.
- Double click on service / interface, click on
Service Endpoints
tab.
- Remove all the existing values.
- Add a new endpoint by clicking
+
icon.
- Add
${#Project#BASE_URL}
as endpoint and ${#Project#DOMAIN_NAME}
as domain values
- If required, you use the same approach for the credentials.
- Now click on
Assign
button there and choose All requests and Tests
option from the dropdown.
- Similarly, do the same if you have multiple services / interfaces.
How to access the above values in TearDown Script
?
log.info "Endpoint : ${project.getPropertyValue('BASE_URL')}"
log.info "Domain : ${project.getPropertyValue('DOMAIN_NAME')}"
When you want to change domain
or base url
, just change the values of the respective project properties before you run execute the tests against different servers / environments.
EDIT:
The values for the endpoint
or domain
can passed dynamically (without even changing value saved in the project) from command line using SOAPUI_HOME/bin/testrunner
utility while executing the tests. For more details, refer documentation