This is a migrated thread and some comments may be shown as answers.

Reusing SQL data driven tests in various environments

3 Answers 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 15 Nov 2019, 04:46 PM

Current Environment setup for a customer facing website that retrieves data from our internal application with proper permissions.

Dev site connected to Dev database

QA site connected to QA database

UAT site connected to UAT site

 

Each of the above sites are connected to our internal site and all have different data.  No data base shares the same data.

We've just started using Test Studio and I've created a few tests for just navigating through the site to verify pages are all loading.  Now it's time to do something a little more complex like searching for an item in a specific status.

So there is a single test case currently - 'Batch cancelled status'

I have it connected to the QA SQL data base so that when the test runs it will find a set of items that I want per the TSQL written.  Works great, no issues.

Now I want to use that same test for Dev and UAT, preferably without having to create two more test that are identical other than the database connections.  I don't want to have to maintain 3 sets of tests for each of the many situations we have for various scenarios in many different status.  This could become a nightmare when changes to the site will eventually be made.

Any advice on this topic would be greatly appreciated.  Thanks!

3 Answers, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 18 Nov 2019, 01:10 PM

Hello William,

Thank you for sharing details about the scenario you need to automate. I understand that you want to execute the same test against different environments and I will try to help you with that.

I assume that the Dev, QA and UAT sites have different URL and you are using the BaseURL and CompareMode features to switch between the different environments. If that is not the case, please let me know and share a zipped sample project for me to analyze. That should allow you to run the test against the different site by changing the baseURL value.

You mentioned that the different database has different data. If you need to enter different text in the same field for the different environments, you can consider data driving the test and switching between different external sources for each environment. I would like to get a better understanding of the test scenario and try to find the best solution for you. For that I will need you help, to share more details and a sample of the test case.

I am looking forward to hearing from you and continue our discussion.

Regards,
Plamen Mitrev
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
William
Top achievements
Rank 1
answered on 18 Nov 2019, 03:45 PM

We're not running the BaseURL and CompareMode because I don't think our websites meet the criteria.  Examples of our sites are as follows for each environments login:

https://dev.application.company.local/login.aspx

https://QA.application.cmpany.local/login.aspx

https://UAT.application.company.local/login.aspx

 

From the site I've read the Base url would need to be something more along the lines of https//:application.company.QA.local/login.aspx. with the base being https//:application.company.  Is there a way to do the base with the above url's as they are setup?  If so that'd be great but when I've tried I've had no luck.

We are using data driven tests, I have our dev SQL connection string setup and using TSQL finding the data I need to inject into the test.  What is the best way to switch between different external sources for each environment is really the base of the question I'm asking.  I know I could go into each data driven test and change the binding manually before running it, pointing it to a binding in the correct environment.  I'm guessing there is a better way of doing it as that would become tedious once you get up to a couple hundred tests and want to be able to push out test for various environments at the same time.

I've zipped the project file but I guess it's still to big, I'll try to send it to you directly.

 

 

0
Plamen Mitrev
Telerik team
answered on 20 Nov 2019, 02:36 PM

Hello William,

I am happy to help you configure the BaseURL setting and CompareMode to suit the specifics of your test scenario. The part of the URL, which we consider as BaseURL is everything before the first "/" slash. In your case, this is "https://dev.application.company.local", which can be interchanged for the different environments from the Test Studio Project ribbon. Along with this, you need to configure all "Navigate to" steps to have only the rest of the URL, for example "/login.aspx". You can explore the additional information in this article.

As for the CompareMode configuration, it actually depends on the structure of the application under test and you can get a better understanding of it here. This will determine the structure of pages and elements in the elements repository. You might need to merge some page nodes that are already recorded. I would advise you to create a separate new project and experiment a bit with a brand new recorded test with those configuration.

I understand the 3 applications have their own database with different data there. This makes it hard to automate in the straight forward way, because you need to switch the external data source for each of them. The easiest way would be to have the same test data on each of them and work with that, but I assume that this is not an option for you. This is why I want to suggest using Execution Extension. More specifically the OnInitializeDataSource method, which allows you to define the data source before the test execution starts. This approach has some specifics for remote execution, which you can find at the bottom of the linked article.

I remain available to assist you further and explore a small sample project. We can both have the same project to test and explore the above topics in more details. I will try to advise you how to optimize it and automate the test scenario.

Regards,
Plamen Mitrev
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
William
Top achievements
Rank 1
Share this question
or