I’m automating UI tests to my Silverlight App and I’m using Visual Studio 2010 for it. Some tests required a setup to my Oracle Database.
Things i’ve done:
1 – A setup.sql file where I connect to my Database and perform actions on it. I had this file as an existing item to my project and I add as a Deployment on TestSettings.
Code:
CONNECT USERNAME@DATABASE,
CREATE TABLE TABLE_NAME,
EXIT
2 – A set.bat file where I call the setup.sql file. I had the path of this file on Setup and Cleanup tab on TestSetings.
Code:
sqlcmd -S MARIALISBOA -i setup.sql
3 – I wrote a TestInitilize method on my TestClass.
Code:
[TestInitialize()]
public void Initialize()
{
System.Diagnostics.Process.Start("setup.bat");
}
4 – I connected do my Database throw Visual Studio (Data -> Add New Data Source).
I run a test on Visual Studio but the class isn’t created on my database.
Could anyone help me? I’m trying to solve this problem since Monday and I starting to lose my mind
While it does not solve your initial problem, a solution would be to use something similiar to this;
For example (Please note that this is SQL Server, use OLE DB connection or similiar);
An example of how I use this within my test;
In your case, you could call;
Any good?