In order to import data from an existing database into a data table, you must specify the data to import using the DataDriver wizard. If you selected the Import data from a database check box, the DataDriver wizard prompts you to specify the program you will use to connect to the database. You can select either ODBC/Microsoft Query or Data Junction.
Note that in order to import data from a database, Microsoft Query or Data Junction must be installed on your machine. You can install Microsoft Query from the custom installation of Microsoft Office. Note that Data Junction is not automatically included in your WinRunner package. To purchase Data Junction, contact your Mercury Interactive representative.
Importing Data from a Database Using Microsoft Query
You can use Microsoft Query to choose a data source and define a query within the data source.
Note that WinRunner supports the following versions of Microsoft Query:
Setting the Microsoft Query Options
After you select Microsoft Query in the Connect to database using option, the following wizard screen opens:
You can choose from the following options:
Creating a New Source Query File
Microsoft Query opens if you chose Create new query in the last step. Choose a new or existing data source, define a query, and when you are done:
Alternatively, click View data or edit query in Microsoft Query and click Finish. After viewing or editing the data, choose File > Exit and return to WinRunner to close Microsoft Query and return to WinRunner.
Once you finish defining your query, you return to the DataDriver wizard to finish converting your test to a data-driven test.
Selecting a Source Query File
The following screen opens if you chose Copy existing query in the last step.
Enter the pathname of the query file or use the Browse button to locate it. Once a query file is selected, you can use the View button to open the file for viewing.
Once you are done, you click Next to finish creating your data-driven test. For additional information, see step 4
Specifying an SQL Statement
The following screen opens if you chose Specify SQL statement in the last step.
In this screen you must specify the connection string and the SQL statement:
Once you are done, you click Next to finish creating your data-driven test.
Once you import data from a database using Microsoft Query, the query information is saved in a query file called msqrN.sql (where N is a unique number). By default, this file is stored in the test folder (where the default data table is stored). The DataDriver wizard inserts a ddt_update_from_db statement using a relative path and not a full path. During the test run, when a relative path is specified, WinRunner looks for the query file in the test folder.
If the full path is specified for a query file in the ddt_update_from_db statement, then WinRunner uses the full path to find the location of the query file.
Importing Data from a Database Using Data Junction
You can use Data Junction to create a conversion file that converts a database to a target text file.
Note that WinRunner supports versions 6.5 and 7 of Data Junction.
Setting the Data Junction Options
If Data Junction is installed on your machine, the following wizard screen opens once you choose to import data from a Data Junction database:
You can choose from the following options:
Creating a Conversion File in Data Junction
Selecting a Data Junction Conversion File
The following wizard screen opens when you are working with Data Junction.
Enter the pathname of the conversion file or use the Browse button to locate it. Once a conversion file is selected, you can use the View button to open the Data Junction Conversion Manager if you want to view the file.
You can also choose from the following options:
Copy conversion to test directory: Copies the specified conversion file to the test folder.
Maximum number of rows: Select this check box and enter the maximum number of database rows to import. If this check box is cleared, there is no maximum.
Once you are done, you click Next to finish creating your data-driven test.
|
|
WinRunner Related Tutorials |
|
---|---|
LoadRunner Tutorial | HTML Tutorial |
QTP Tutorial |
WinRunner Related Interview Questions |
|
---|---|
SILK TEST Interview Questions | LoadRunner Interview Questions |
WinRunner Interview Questions | HTML Interview Questions |
QTP Interview Questions | Manual Testing Interview Questions |
OpenStack Interview Questions | Automation Testing Interview Questions |
API testing Interview Questions | Rational robot Interview Questions |
Selenium IDE Interview Questions | Performance Testing Interview Questions |
Test Director Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.