Forum Discussion

rabisankar's avatar
rabisankar
New Contributor
14 years ago

How to change the endpint url automatically

Hi,

I am new to SOAP UI.

I have multiple interfaces inside my project.
I have created a test suite with a test case for each operations in these Interfaces.
Now when my services move from DEV to TEST to PROD environment, how can I reuse these test cases without changing endpoint urls manually?

Detail scenario:
Interface1(wsdl1) has op1, op2 and op3
Interface2(wsdl2) has op4, op5 and op6

create a project and add both these wsdls
now create a test suite
Add test case1 -> test step1 -> Req for op1 (endpoint url for this is http://TestHost:8181/endpoint1)
Add test case2 -> test step1 -> Req for op2 (endpoint url for this is http://TestHost:8181/endpoint1)
Add test case3 -> test step1 -> Req for op3 (endpoint url for this is http://TestHost:8181/endpoint1)
Add test case4 -> test step1 -> Req for op4 (endpoint url for this is http://TestHost:8181/endpoint2)
Add test case5 -> test step1 -> Req for op5 (endpoint url for this is http://TestHost:8181/endpoint2)
Add test case6 -> test step1 -> Req for op6 (endpoint url for this is http://TestHost:8181/endpoint2)

Now when my services move to PROD environment, host and port will change for these urls.

How can I achieve this without modifying manually?

Please help me.

Thanks,
Rabi
  • You can open up the soapUI project file and do a find and replace or, even better, find and replace the server urn+port with ${#Project#EndPoint}

    Then save the file and reload it in SoapUI
    then click on the project root node in SoapUI, select Custom Properties tab bottom left then, add a new one called EndPoint and type the server:port in there and all your tests will use that.
  • rabisankar's avatar
    rabisankar
    New Contributor
    Thanks a lot Russel. That works.

    Just a follow-up question.
    How can I overwrite the project level property (i.e EndPoint) using a properties file and use it from commandline?
    My project name is TestProject and I tried the following command:

    C:\Program Files (x86)\eviware\soapUI-4.0.0\bin>testrunner.bat -sMyTestSuite C:\xyz\abc\My-soapui-project.xml -Dsoapui.properties.TestProject=C:\xyz\abc\Automation.properties -r

    C:\xyz\abc\Automation.properties file has Endpoint property value defined as Endpoint=Junk
    But it does not overwrite the Endpoint property value

    Thanks,
    Rabi
  • kamahade's avatar
    kamahade
    Regular Contributor
    Did you see runtime option -P ?? You could specify runtime properties via -P and then set Endpoint according to your project.