My management is intrested to design test case as follows:
Create a test case as per UI design need, and perform some search criteria and which returns some number of records from database and display it to the user along with number of rows information.
What actually they need is, during the steps in the test case, is it possible to connecting sql/oracle db to get data for the similar criteria and number of records information and need to compare with UI display data.
Is it possible to write a code to conenct to db from test cases to compare data??
Please help me here...
10 Answers, 1 is accepted
I can able to connect successfully for sql server.. but am facing issues while connecting to oracle db....as my req is to connect to oracle.
while adding datasource....i hav selected oracle client data provider...given appropraite connection string to connect...but still connection is throwing us error...
as i observed the google that, do i need to have oracle client installation and ODAC for .net is needed for connecting to oracle ????
pls help me here in giving approp suggestions...
Are you attempting to data drive your test? It sounds like you want to compare what is displayed in the UI from a search with the contents of your Oracle DB, and I suspect the returned search results can be many. Data driven testing is good for providing input into a test, one row at a time. The test will execute once for each row of data.
This approach does not fit in the verification scenario where multiple results need to be verified in a single pass. If I have misunderstood your testing requirements, please correct me.
For this I would use a pure coded step that connects to my DB, extracts the data out of it to be compared, extracts the data from the UI to be compared, then performs that comparison by iterating through the data just extracted from the DB, displaying the results and/or failing the test if it does not compare correctly.
A quick Google search shows these results for how to connect to an Oracle DB from C# code:
We don't have an Oracle DB to test against, so we can't really assist writing such code.
the Telerik team
Iam done with by connecting to oracle database from adding databind to test script or case using oracleclient data provider successfully.
its really cool having such a great feature with simple connection string helped me to connect to oracle db data fetched
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=sidname)));User Id=username;Password=pwd;
Thanks again for great feature with simple work...
I just need few suggestions on my approach.
1. Assume, a silverlight app developed and hosted on 3 different machines which refer 3 different dbs
http://machine1 and its db is oracle present on server "dev"
http://machine2 and its db is oracle present on server "smoke"
http://machine3 and its db is oracle present on server "checkit"
i added a xls file having these 3 urls of with uid, pwd like
url uid pwd
i binded it to my test case or script and hence when i execute it takes one url from xls and using corresponding uid n pwd logins and executes search functionality.
i want to verify the search results like count of records w.r.t to their database.
do we have options of multiple data binds to same test script or case.????
for my test scripts or cases project, i added one xls file having above urls with uid n pwds info and three databinds with above dbs connections info...
how could i sync for each url corresponding db fecthing results should compare????
I can think of a few approaches to solve this problem:
1) Put all the data for each environment on one row in your Excel file (URL, user, pw, db server name). Then use the "Filter Data Between Rows" feature to a specific row of data as shown in the attached screen shot. Using this approach is a data driven test and your inputs, including the hostname comes from the data source.
2) Have 3 parent tests that are bound to 3 different data sources, one for each environment. They all call the same subtest which has Inherit Parent Data source checked.
3) Have 3 parent tests that have a coded step which sets the values to be used by the subtest. You do this with code like this:
the Telerik team
Our testers are more familiar with Visual Basic - would you have any insight to connecting to Oracle from a Test Studio Script using more of a VB coding solution?
Basically, we need to connect to one or more databases and execute a SQL query to get test data that we would drive into the test. In reviewing your C# examples from this forum conversation, it sounds like functionally it can be done. I just need some help putting it together.
We don't have any Oracle sample code, mainly because we don't have an Oracle server. A quick Google search on "how to connect to oracle using vb.net" came up with this page:
SetExtractedValue is available in VB.NET using the exact same parameters. Just leave off the trailing ; character. That's the only difference in the code sample of my previous post.
the Telerik team
Can you please give directions to connect to a sql server database? I am trying to connect to the database using the Script Step and everytime I execute it, it gives me an error.
We created this new code sample showing how to connect to a SQL database in code. Does this help?
the Telerik team