Forum Discussion

hutabarat2014's avatar
hutabarat2014
Contributor
10 years ago

[Res] Populate Endpoint The Easiest Way

Hello,


I am wondering about something.

Say, I got 4 different endpoints (A, B, C and D) that I can use at any given time.

Say, I got 200 Test Cases and each has roughly 6 steps.

Each step requires an endpoint.

If, today, I am using endpoint A and then tomorrow I plan to use endpoint D, then how can I change the endpoint for every test steps using the easiest way?

I do not wish to go through each step and change manually the endpoint in the endpoint field.

Thank you very much.


Leo

9 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Easiest way is to define your endpoints at service interface which I believe can be limited, then select the endpoint and assign to all test steps. Hope this helps.
  • Hi nmrao,

    This is exactly that I have been doing.

    I assigned 4 different endpoints in the project property and every time I need a different endpoint, I have to go to each test step and change it manually.

    I wish there was something that would change that endpoint all in one go.

    Thanks,
    Leo
  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi Leo,

    if you're using SoapUI Pro 4.5 or higher, you can use the Environment functionality, which is ideal in this situation.

    I assume you have this endpoint property created at your Project level.
    If yes, you can easily create 4 environments with 4 different settings in your project - just go to your Project level, open tab Environments and create 4 environments here (lets say envA, envB, envC and envD).
    Set your data to all properties in all environments.

    Then click on tab SOAP Services or REST Services (depending on your services) and set this value for all your interfaces for property Endpoint:
    ${#Project#endpoint}

    Now all your services pointing to endpoint specified in your Project level, in current Environment.
    Environments can be easily switch - just open any TestSuite or TestCase editor and you'll see a ComboBox with your environments right next to the toolbar.

    These environments can be also switched by Groovy script:

    testRunner.testCase.testSuite.project.setActiveEnvironment("envA")


    More details can be found here:
    http://www.soapui.org/Environments/envi ... oapui.html

    I hope it will help you

    In case of any further questions, feel free to ask

    Regards,
    Marek
  • nmrao's avatar
    nmrao
    Champion Level 3
    I believe that you did not get my point right. You do not have to go to each step of your test case.

    You may see in the figure multiple endpoints.
    Select any end point and then clickon assign button. You would see a popup as shown in the figure, and select the option that is shown and you are done.
  • Hi All,

    Thank you for all your responses.

    I was away for a couple days.

    I will try your solutions and keep you updated.

    Many thanks,
    Leo
  • Hi again,

    After trying those 2 different options, at this minute I am adopting Marek's solution.

    nmrao's solution is good too.

    But, Marek's is more descriptive, so the user can see immediately what environment they are testing in.

    Many thanks for your help.

    Kind regards,
    Leo
  • Hi Rao,

    Just wondering about the MODE dropdown in the Service Endpoints.

    We have got:
    (1) OVERRIDE
    (2) COMPLEMENT
    (3) COPY

    What are those, Rao?

    Thank you,
    Leo
  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Hi Leo

    Go with the Environments feature which is available in soapUI Pro post 4.5. It's just matter of selecting pre-defined environment from the drop down.

    If you run your projects headless (command line) you can pass in this environment name as -E parameter. This way you can run any environment you want.

    Regards