cancel
Showing results for 
Search instead for 
Did you mean: 

how to change DB connection string dynamically

SOLVED
Contributor

how to change DB connection string dynamically

Hi all,

 

I automated nearly 100 test cases by using test complete. Used 20 variables to read the data from external data sources.

In this 11 variables are used for fetching data from Sql Data Base. We have three different environments(Test,UAT,Live)

If i want to run the test cases in UAT(or) Live need to change database connection string 11 times in 11 variables.

 

Is there any way to do in effeicient way or is there any process in one place if i change the connection string it should get reflect in 11 variables.

 

Thanks in advance.

 

Regards,

Nakshatra.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: how to change DB connection string dynamically

You shouldn't need to store your connection string in several different places.  If the connection string is common, then you can store that in a single variable and consume that in all the places you need.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
4 REPLIES 4
Community Hero

Re: how to change DB connection string dynamically

You shouldn't need to store your connection string in several different places.  If the connection string is common, then you can store that in a single variable and consume that in all the places you need.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: how to change DB connection string dynamically

Thanks for the reply.

 

here I am using 11 variables and 11 different queries and same connection string.

 

Could  you please expalin me how to use single variable in all places. It will be helpfull.

 

Regards,

Nakshatra.

 

Community Hero

Re: how to change DB connection string dynamically

I'm not sure I understand the question.  You set up a global variable and store your connection string in there and utilize that in your tests.

 

It might be helpful to know a bit more about how you're setting things up.  Are these Keyword tests that you're doing a DB connection for a data driven loop?  Please give us an example of one of these 11 situations and we can, perhaps, answer your question in grated detail.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: how to change DB connection string dynamically

Thanks for the reply.

 

Create global variable and it''s working.

 

Regards,

Nakshatra.

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors