Forum Discussion

Mark_S's avatar
Mark_S
New Contributor
6 years ago

Testing Multiple Environments

We're currently using test complete in one our dev environments. I've been given the task of setting it up to run against all 3 of our testing environments and I'm stuck. We're using Visual Studio to create a branch that works its way up through the different environments. Currently TC is part of the solution that its testing and each night, a build makes a copy and tests against it. First, I'm thinking I need to move TC into it's own solution since it can't be included in the production branch for the other environments. Second, how to I set tell TC which environment to run against and which URL to use? Can that be done in the build?

-thanks

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    We have a similar situation.  I handle it in my framework.  When I generate a new test run to execute, part of that generation includes referencing what we call a "run definition".  That includes several parameters and such to indicate a) what application is being tested, b) which test cases are included, c) what environment it executes in.

    Then, when the test run kicks off, it reads the environment part of the rundefinition into a ProjectSuite variable which we then reference anywhere in our test cases where we need to navigate to a new page manually (as opposed to clicking links).

    That's one solution... but something similar could work for you where you could have your build set a system environment variable and have your tests configured to read that value and utilize it anywhere a URL is referenced.

    • Mark_S's avatar
      Mark_S
      New Contributor

      Thanks for the quick response - that's where I'm stuck - how do I setup that generation? Is that in the build?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        In our case, the framework is created/generated separate from our build process.  So, if you want to have it created from your build, then yes, something in the build process of your application under test will need to generate the environment value to use.  

        As with many such things, there are many ways of achieving the same result.  How you set the environment is something that you'll have to do within your organizational process.  The key where it intersects with TestComplete is writing code in your automation that will read the environment value from whereever you have set it and utilize it within your tests.  We have code in TestComplete that reads the value from an SQL table and populates the project suite variable.  Your code may be different, depending upon how you choose to generate the value.