Forum Discussion

SanketSarode's avatar
SanketSarode
New Contributor
3 years ago

how to run test suite for all environments one after another

Hello, how can we run test suite that is configured for some environments, i.e. CI, INT and I want to run my test suite in all the environments one after the another without manual intervention....?

  • groovyguy's avatar
    groovyguy
    3 years ago

    You might be able to write a groovy script that gets the collection of environment names, and loops through them. As it does so, it could run the test suite in each environment as it goes through the list. Would that be sufficient?

     

  • CoreyVernon's avatar
    CoreyVernon
    SmartBear Alumni (Retired)

    Hello SanketSarode,

     

    One way to switch between environments is to include a setup or teardown script that calls the specific environment you want to move to. An example of that script would look like this:

     

    // Replace the project and environment names with those you need
    def proj = testRunner.testCase.project.workspace.getProjectByName("Sample Project")
    proj.setActiveEnvironment("Test Environment")
     
    To call the environment during runtime you can generate a command argument that calls the environment you want. The ReadyAPI documentation discusses this in further detail. I have provided a link below. 

    https://support.smartbear.com/readyapi/docs/testing/environments/index.html
     
    I hope this helps.
     
    Corey
  • Thanks Corey, this works only when we have only 2 environments.. what if there are 4-5 environments and run tests one after the other without manual intervention/or manual trigger to run on specific environment. Thanks for taking time to provide solution.

    • groovyguy's avatar
      groovyguy
      Community Hero

      You might be able to write a groovy script that gets the collection of environment names, and loops through them. As it does so, it could run the test suite in each environment as it goes through the list. Would that be sufficient?