Forum Discussion

AJohansen's avatar
AJohansen
New Contributor
10 years ago

Using multiple endpoints on the same environment

I need to do some A/B testing on a REST service, ie. I need to do the same request towards different hosts, and compare the results.

I first tried to do this by adding another Service Endpoint to the service, and choose which endpoint to use in each test request. But this doesn't work, because the Project that I'm working in has environments configured, and the endpoint specified by the environment overrides the endpoint of every Test Request (the endpoint field in the Test Request editor is greyed out).

I have also tried selecting the Endpoint property under Rest TestRequest Properties (left sidebar, below the workspace), but this seems to change the endpoint of *all* Test Requests that use the same Resource.

How can I set the endpoint of each Test Request independently, without removing all environments from the project? Or is there a better way of doing this?

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    You could create another environment for the endpoints you do not want to be changed and then switch to that environment using a groovy test step before those requests are ran. You can switch environments dynamically with below code in a Groovy test step.

    testRunner.testCase.testSuite.project.setActiveEnvironment("your environment")



    Regards,
    Marcus
    SmartBear Support