Reading data from database table
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2010
12:28 AM
02-04-2010
12:28 AM
Reading data from database table
I have been able to record keyword tests were data from excel is read and used as input data in my test using the Excel DDT driver (as per the sample video). Is there a similar way to do the same but read data from a database table rather than a spreadsheet?
7 REPLIES 7
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2010
01:31 AM
02-04-2010
01:31 AM
Hi Michelle,
You can use DDT.ADODriver object to connect to a database and access its tables via ADODB.
This object has built-in methods to handle data in tables.
For more information refer TestComplete help topics : "DDT.ADODriver" or
http://www.automatedqa.com/support/viewarticle.aspx?aid=8359&hlite=DDT.ADODriver
Hope it helps you...
You can use DDT.ADODriver object to connect to a database and access its tables via ADODB.
This object has built-in methods to handle data in tables.
For more information refer TestComplete help topics : "DDT.ADODriver" or
http://www.automatedqa.com/support/viewarticle.aspx?aid=8359&hlite=DDT.ADODriver
Hope it helps you...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2010
02:58 AM
02-16-2010
02:58 AM
I have had a look at that link but it doesn't really describe how you go about using the ADODriver i.e do I use a code expression for the connection string or is it a constant etc?? And what is the syntax do I use for the connection string?
I have attached the screen shot - what are the parameters I need to enter
Thanks
Michelle
I have attached the screen shot - what are the parameters I need to enter
Thanks
Michelle
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2010
12:06 AM
02-23-2010
12:06 AM
Hi Michelle,
You can find examples of connection strings here.
You can find examples of connection strings here.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2010
10:20 PM
03-14-2010
10:20 PM
Hi
This does not help me enough. I am very new to this application so basically what I want to know (in a simple step by step way) is how to look up the data in a table in my orcale schema and use that data as a value in my test.
So for example I am testing orders.exe application and I want to take a value from a column my 'address' table and use that to populate the orders form in the the orders.exe application.
How do I go about doiung this?
This does not help me enough. I am very new to this application so basically what I want to know (in a simple step by step way) is how to look up the data in a table in my orcale schema and use that data as a value in my test.
So for example I am testing orders.exe application and I want to take a value from a column my 'address' table and use that to populate the orders form in the the orders.exe application.
How do I go about doiung this?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2010
01:19 AM
03-16-2010
01:19 AM
Hi, Michelle,
Try something like this. This is untested, uses DelphiScript, and uses MSSQL but the concepts should be the same and should show how to build something like this.
Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
Try something like this. This is untested, uses DelphiScript, and uses MSSQL but the concepts should be the same and should show how to build something like this.
function GetTableValue;
var
lADOObject;
lADOCommandObject;
begin
lADOObject := DDT.ADODriver;
lADOConnectObject := DDT.ADODriver.ADOConnectionObject;
lADOObject.ADOConnectionObject.ConnectionString := Provider = 'SQLOLEDB; User ID = sa; Password = testing; Initial Catalog = QASCRIPTS30; Data Source = qatest02\SQLExpress; LoginPrompt := False;';
lADOObject.ADOCommandObject.CommandText := 'SELECT Name from Customers where CustomerID = 1';
Result := lADOObject.Value[0];
end;
Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2010
04:06 AM
03-16-2010
04:06 AM
I am using keyword tests not scripts
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010
12:58 AM
03-18-2010
12:58 AM
Hi Michelle,
Currently, it is not possible to accomplish your task without any scripting.
As you are using keyword tests, you can execute the function suggested by Robert by using the Run Script Routine operation. Please note that the value returned by the script function needs to be stored in [url= http://www.automatedqa.com/support/viewarticle/?aid=2538]a keyword test variable[/url], [url= http://www.automatedqa.com/support/viewarticle/?aid=3075]a project variable, or a project suite variable[/url]. For example, you can change the following code line of Robert's code:
Result := lADOObject.Value[0];
like this
// Please note that you need to create the Var1 variable before executing the routine.
Project.Variables.Var1 := lADOObject.Value[0];
Then, you will be able to work with the value stored in this variable in the way you want.
-----
Alexander
Customer Care Manager
Alexander
Customer Care Manager
