Forum Discussion

DLapus's avatar
DLapus
Occasional Contributor
10 years ago

Multiple Endpoint For a Project Running via command line

Hi,

We have a composite Project where our Authorization cases use a endpoint and all other cases uses a Different endpoint.

When Running Via Command Line , the endpoint we give overrides and applies to entire project.

Is there any Workaround or alternative solution.

1 Reply

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

    This is a bit tricky setup, as you can only pass one project endpoint.
    As endpoints are normally associated with environments, I suggest you consider them as such, so that the Authorization TestCases would be run in one environment using one endpoint and the other TestCases in the other environment with the other endpoint.
    So you will need to do some environment switching within your TestCases as those respective endpoints need to be used. Assuming two environments were setup: "Authorization" and "Main":

    Before the authorization, you would do this in a Groovy script or TestCase setup script:
    def env = testRunner.testCase.testSuite.project.getEnvironmentByName("Authorization") 
    testRunner.testCase.testSuite.project.setActiveEnvironment(env)


    Then after the Authorization:
    def env = testRunner.testCase.testSuite.project.getEnvironmentByName("Main") 
    testRunner.testCase.testSuite.project.setActiveEnvironment(env)


    Then you would not pass an endpoint when calling the TestRunner but indicate the main environment with the -E option instead.

    I hope this helps.

    Regards,

    Giscard
    SmartBear Support