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

Execute a database script before or during test execution

2 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 19 Apr 2013, 05:06 PM
Hello again,

I would like to be able to run a database script before a test executes or even during test execution would be great.
I was wondering if it was possible.

For example, In my website I need to log in as a certain user to access their roles and privileges, but this user might be logged into the system.  So, I would like to be able to run a database script that terminates their session and it would allow me to log in as that user before my test executes.

Thanks for any help provided.

2 Answers, 1 is accepted

Sort by
0
Accepted
David
Top achievements
Rank 1
answered on 19 Apr 2013, 06:59 PM
I found a basic solution that I could use here for those who may have similar questions.

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/general/access-sql-database.aspx
0
Byron
Telerik team
answered on 22 Apr 2013, 05:20 PM
Hi David,

This is the correct solution: in code, create a SqlCommand object containing the query to execute the database script and send the query to the database. Please let us know if we can help you further.

All the best,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Byron
Telerik team
Share this question
or