Professional Documents
Culture Documents
– Keyword View
• Importing an Data Sheet
• Importing an Database
– Expert View
– Various functions available in QTP for data sheet
• Session Wrap-Up
• QTP has a inbuilt Data table that can be used for parameterizing tests
and for output operation.
• This allows the contents of the data table used in QTP to saved in
another Excel file.
Note: It becomes important to provides the Column name similar to the parameter name given to the action that is
being parameterized.
Parameter
Name
Column
Name
• This is applicable to all the parameters that have been declared in the
Excel sheet for QTP.
• This basically helps QTP to synchronize the terms else if the names
are different then test run might fail with an parameter not found error.
• The contents of the first sheet can be used for Global parameter and
that of the second can be for local.
Note: If in an Excel file you have declared parameters in more than two sheets then contents of first two sheets shall be
copied by default and not of the third. Since in Data Table by default there are only two sheets available Global and
Action1. To copy more than two sheets of Excel file the user will have to create more actions in the test.
• During the above operation one needs to be careful that current sheet in the
QTP Data table is empty else the contents of the calling Excel sheet shall
overwrite the current contents. Also this can be applicable for Global and local
parameter operation in QTP, by selecting the appropriate sheets.
• Now user will have to create an SQL statement manually and create a
connecting string as shown below and click finish.
• For an existing Excel QTP will overwrite the contents of the data table however
in the process will ask the user if he wants to do so.
• Similarly the user can also export an single sheet from the data table into an
Excel file.
• For an existing Excel file if the sheet names are similar to that of the data table
then QTP will overwrite the contents of the data table however in the process
will ask the user if he wants to do the same.
• Generally the exported contents get stored into an new sheet other than the
existing sheets in the Excel file.
• User can also export the contents of the Global and Local data sheet either into
the same Excel file in adjacent sheets or in different Excel files.
Accenture Confidential. For Internal use Only. 10
External Data Sheet
Add Sheet/Parameter Adds specified sheet or parameter to the run-time Data Table and returns the sheet and
method parameter respectively to set the properties directly.
Delete Sheet/Parameter Deletes the specified sheet/parameter from the run-time Data Table.
Export/Import Method Saves/ Copies a copy of the run-time Data Table to/from the specified location
ExportSheet Method Saves copy of a sheet in the specified location. If does not exists then creates one else
overwrites the existing sheet.
ImportSheet Method Imports a sheet of a specified file to a specified sheet in the run-time Data Table. The data in
the imported sheet replaces the data in the destination sheet..
GlobalSheet Property Returns the Value of the first sheet of the run-time Data Table which is known as the Global
sheet.
LocalSheet Property Returns the current (active) local sheet of the run-time Data Table.
Get/SetCurrentRow Method Retrieves the current row in the active sheet that is being used/Sets the row specified as the
for Data Table active row in the data table.
Get/SetCurrentRow Method Retrieves the current row in the active sheet that is being used/Sets the row specified as the
for Data Sheet active row in the data table sheet.
Questions?
Q & A….
Session Wrap-up
• External Data Sheet allows the user to call a external Excel file to
perform action with user defined
• External Data Sheet also allows the user to just call a single sheet in
the Excel file and not the complete file as a whole.
• Using this, contents of the Data table in QTP can be exported to an
external Excel file and can be made use of as parameters for some
different test.
• Data base contents can be imported and can be saved in an Excel file.
• Data.Table function used in Expert View helps to import, export, add,
delete sheets etc.