HP QTP Data Table Methods

HP Quick Test Professional Data Table Methods


They are number of QTP Data Table methods to create Data Driven Framework ,below are the details.

1. Add Sheet
2. Delete Sheet
3. GetSheetCount
4. GetRowCount
5. GetSheet
6. Value
7. SetCurretRow
8. SetNextRow
9. SetPrevRow
10.Import /Import Sheet
11.Export /Export Sheet



Please find the details below

Add Sheet:

This method is used add new sheet to the run time data table
Syntax: DataTable.AddSheet("Sheet Name")

Delete:

This method is used to Delete one sheet using this method
Syntax: DataTable.DeleteSheet("Sheet Name")
Example : DataTable.DeleteSheet("Test_Cases")

GetSheetCount:

This method is used to Count number of sheets in Run time Data Table.
Syntax: DataTable.GetSheetCount

GetRowCount:

This method is used to count number of rows in the first excel sheet of the run time data table.
Syntax: DataTable.GetRowCount

GetSheet:

This method is used to get specified excel sheet from run time data table.
Syntax: DataTable.GetSheet("Sheet Name") or DataTable.GetSheet("SheetID")

Example : 
Sheet 1- 1
Sheet 2 - 2

DataTable.GetSheet(1)

Value:

This method is used to set or get value of cell data in specified the current row of the run time data table.
To Get Data
Syntax:

Variable Name = DataTable.Value(Parameter_Name,Sheet Name) or

Variable Name = DataTable(Parameter_Name,Sheet Name)

To Set Data
Syntax: DataTable.Value(Parameter Name,SheetName) = Value/Variable

DataTable(ParameterName,SheetName) = Value/Variable

Ex:
Uname = DataTable.Value("Username","rajeshk")
Pwd = DataTable.Value("Password","xxxxxxxxxx")

Browser("Gmail Login").Page("Gmail Login").WebEdit("Username").Set Uname
Browser("Gmail Login").Page("Gmail Login").WebEdit("Password").Set Pwd

SetCurrentRow:

This method is used to set specified row as current row in the run time data table.
Syntax: DataTable.SetCurrentRow(RowNumber)
Ex: Username = "Rajesh"
DataTable.SetCurrentRow(3)
DataTable.Value(3) = Username

SetNextRow:

This method is used to set the row after the current row as New Row in the Run time DataTable.
Syntax: DataTable.SetNextRow

SetPrevRow:

This method is used to set specified row as before the current row as new current row in Run time data table.
Syntax: DataTable.SetPrevRow

Import:

This method is used to import Excel file -Number of sheets to the run time Data table.
Syntax: DataTable.Import "Path of the Excel file"
DataTable.Import "E:\Automation\HP QTP\Testing.xls"

ImportSheet

This method is used to import specified excel sheet into Run time data table.
Syntax: DataTable.ImportSheet "Path of Excel file","Source Sheet","Destination Sheet"

Example:
DataTable.AddSheet "Test_Cases_App"

DataTable.ImportSheet "E:\Automation\HP QTP\Testing.xls","Test_Cases","Test_Cases_App"

Export:

This method is used Export Excel file in to specified location from another location
Syntax: DataTable.Export "Path of Excel file"

Export Sheet:

This method is used to export specified sheet into specified location
Syntax: DataTable.ExportSheet "Path of File","Sheet Name/Source Sheet"

DataTable.ExportSheet "E:\Automation\HP QTP","AutomationTesting.xls"

HP QTP Data Driven Testing

DATA DRIVEN TESTING



  1. Data Driven testing is used to test the application with multiple data.
  2. We will use Excel for data driven testing,
  1. Data Table enables you to run the tests with multiple set of data using Excel ..etc sources
  2. Data Table is used to store number of data and we can parameterize the data to the test script.
  3. In QTP there are two types of sheets by default
    1. Global Sheet
    2. Action1 Sheet
  4. One Data table have 256 sheets and in that one one sheet is Global ,Remaining 255 sheets are Action Sheets.

Two Types of Data tables

  1. Design Time Data Table
  2. Run Time Data Table

Difference between Design Time Data Table and Run Time Data Table

Design Time Data Table Run Time Data Table
This data table is viewed in QTP main test i.e in Expert View below. This data table is viewed in QTP test Results page
This data table is created priot to the test scripts execution. This data table created after the test execution

Creation of Data Driven Testing using Data table

  1. Software Testers will check the application,how it will perform the same action with multiple set of data.
  2. We can create a data driven test with a loop that can run multiple times with the different set of data.

Software Testing Life Cycle process


Software Testing Life Cycle Process(STLC)
Software Testing process accomplished the integration of Test Process
Software Testing Process follows below stages

Software Testing Life Cycle(STLC)


1.Test Initiation
Test initiation means initiating the Testing or Starting the Testing process,so inorder to start the Testing process we need some major activities should be completed those are below mentioned
  1. Project plan should be approved
  2. Project Manager should be appointed
  3. Test Estimation should be prepared.
  4. Should identify the risks,Resources
  5. Prepare the Test Templates,Guidelines for the project.

2.Test Planning

Software Testing Requirements Specification

Types of Requirements

1.Business Requirement Specification
2.Software requirement Specification
3.Functional Requirement Specification


Business Requirements Specification:

  1. Business requirements specifies the requirements in terms of business requirements which gives brief details about requirements
  2. It is a high level requirements containing project requirements from stakeholders.
  3. BRD contains benefit case and problem statement from stakeholders system.

Software Requirements Specification:

  • Software Requirement document is an organizations understanding of a stakeholder system requirements,dependencies of a particular system.
  • Software requirement document contains clear requirement details about each module of software related and requirements of the system
  • In this documents all the requirements looks very clear which tells about clear flow of the requirements.

  • Functional Requirements Specification:

    1. Functional requirement document provides functionality of the application/software in the form of screen shots/Elements validations etc.
    2. It provide complete details about the application functionality and provide clear picture about the system .Helps to prepare Test Scenarios,Test Cases. etc