Next, you need to create a corresponding Database Query for this Database Checkpoint. In QTP 10, we have two options to create a database query: one is through the establishment of Microsoft Query, this method is relatively simple, but you need to install Microsoft Office in Microsoft Query; Another way is to manually create, if you If you are familiar with manually creating ODBC data sources and SQL statements in Windows, you can choose this method.
Establishment of a database query using Microsoft Query screen as shown below, Microsoft Query can help us establish a data connection, select the data source and build qeury database: Finally Microsoft Query will establish good query returns to QTP Tables database checkpoint top of the dialog with a blue check mark in a cell indicates will participate in the implementation of the test as reference data checking, we can select those cells of data as our baseline data.
In the bottom box has three property pages, a first genus of the currently selected page show how the configuration of the reference data, may be a constant or read from the data table, or from a software under test read output data Into.
Move to next record — We have a method MoveNext which we can use in a loop until the max record in recordset. Below example illustrates the use of this method to get all the records from table.
Do while MyRecordset. Value MyRecordset. MoveNext Loop. I have listed her some example which you may encounter in your test. Function 3 — Number of Records We can traverse through all the records in the recordset to get the number of records in recordset. If you need to update, insert or delete records from database, you can use this function. But if you are working on the database for application under test, you should not perform such actions until unless it is required or a database used for QTP.
Fields n. Name Next. GetSheet "DBImport". MoveNext Loop Next. Apart from this, if you need to connect to a excel file using ADODB connection, you will have to specify a different connection string, which will be like. Open navigation menu. Close suggestions Search Search.
User Settings. Skip carousel. Carousel Previous. Carousel Next. What is Scribd? Uploaded by vvenkat Did you find this document useful? Is this content inappropriate? Report this Document. Flag for inappropriate content. Download now. Related titles. Carousel Previous Carousel Next. Jump to Page. Search inside document.
Check CheckPoint "DbTable" When you will run the script QTP will check the database whether the record is updated with the customer name or not and will give you the result as pass or fail. Example 1 illustrates the usage of function mentioned above. Open ConnectionString In the same you can now connect to any database using the connection.
A typical tnsnames. Recordset to get the recordset object. Recordset" Before starting let us first understand the properties and methods of recordset object which will help further.
Value End If Result In this example we are using the function 2 by passing the required query and we get the result recordset in the MyRecordset object. In the same way we can use other methods as well for different operations Move to next record — We have a method MoveNext which we can use in a loop until the max record in recordset.
Anton Chuvakin. Miaka Yuuki. Lee Davis. Ramesh Kesavan. Kumar Jayaram. Saurav Maddy. Shalini Jhunjhunwala. Manimala Vidyasagar. Amanda Miller. To connect to this database we will need to create a connection string for Access which is used in the above function. On the user DSN tab, click Add. And follow rest of the wizard. Now in place of the connection string you need to have the DSN that you provide while creating.
In the same you can now connect to any database using the connection. And use the TNSname as the Datasource in your connection string. An article by Saket. You can follow the complete series here. I recommend you to subscribe by email below and have new UFT articles sent directly to your inbox. Hello, this is vishal just now i am downloading qtp But frankly I myself donto know the relevance on the same. Wish you to oultine some insights from your usdage of the same on this?
End Function. Thanks Saket, it showing object as True now. But the object state is 0 closed instead of open. I have to use this statement again in the script after calling the function:. Can you check if your getconnection function is working properly, check the connectionstring.
I will suggest you to remove the error handling statement from the function and see if it throws any error there.
0コメント