Based on the information updated in the question, it looks like you need to access the endpoint in the TearDown Script project.
It also seems that you will need to run the same test suite for different base url endpoint and domain . Not sure if even you might need to use credentials accordingly.
Given the foregoing, it would be easy to design level properties.
Here you have to go:
- Create a custom project-level property for the base url , say
BASE_URL as the property name and value http://10.0.0.1:8008 . Of course, change it with the actual value as necessary in relation to the tests performed. - Similarly, create another project-level property for the domain , say
DOMAIN_NAME and specify its value in accordance with the test. - Double-click on the service / interface, go to the
Service Endpoints tab. - Delete all existing values.
- Add a new endpoint by clicking the
+ icon. - Add
${#Project#BASE_URL} as an endpoint and ${#Project#DOMAIN_NAME} as domain values - If necessary, you use the same approach for credentials.
- Now click the
Assign button and select All requests and Tests from the drop-down menu. - 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')}"
If you want to change the domain or base url , simply change the values of the corresponding properties of the project before running the tests on different servers / environments.
EDIT:
Values for endpoint or domain can be transferred dynamically (without changing the value stored in the project) from the command line using the SOAPUI_HOME/bin/testrunner during test execution. For more information, see the documentation .
source share