Forum Discussion

sd's avatar
sd
Occasional Contributor
7 years ago
Solved

How I can run same test case into different test environments?

For example I want to automate login and logout function for user. I want to run same automated keyword test into Test environment A and Test environment B.  Somehow for username and password fields,...
  • tristaanogre's avatar
    tristaanogre
    7 years ago

    We do the same... we have multiple environments for testing our one application.  What we've done is the following:

    1) All NameMapping for pages "wildcard" the portion of the URL that changes between environments.  For example, environment A may have http://myServerA/FolderA/page.aspx and Environment B may have http://myServerB/FolderA/page.aspx.  So, in our name mapping, when we map the page, we map the URL as */page.aspx.

    2) We have a project level variable called environment which we set at the start of our test run based upon the data we pass in via our automation framework (SQL backend contains data to indicate environment).  We set that variable to our base URL for the environment. 

    3) When we have our code launch the application, we use the Browser.Run() command and pass to "Run" a code expression that concatenates the environment base URL with the primary landing page of the application.

     

    The over all effect is that, by configuring our SQL properly, we can say, "Run test cases against Environment A" or "Run test cases against Environment B" and the combination of the variable, the mapping, our launch code and the data from SQL and we have a dynamic set of tests that we can run against any environment we wish.