Overview in UFT Testing

24 Sep 202015 minutes to read

UFT (formerly known as HP Quick Test Professional - QTP) is an automated testing software designed for testing various software applications and environments. Syncfusion provides QTP add-in that contains custom libraries, that help UFT or QTP to recognize Syncfusion controls. These custom libraries are built with the help of .NET add-in extensibility.

Prerequisites and Compatibility

Prerequisites

The prerequisites are tabulated in the following table.

Testing Environments QuickTest Professional of version 9.5 and above or UFT QuickTest Professional .NET add-in or UFT
.NET Framework .NET Framework of version 3.5 , 4.0, 4.5 , 4.5.1 or 4.6
Other Requirement Essential Studio (User Interface edition – WPF) of the same version as the Essential QTP Add-on.

Compatibility

Operating Systems Microsoft Windows XP Microsoft Windows Vista Microsoft Windows 7 Microsoft Windows 8.1 Microsoft Windows 10

Installation

You can download the QTP Essential Test Studio and install using the below steps,

1.Double-click the Syncfusion Essential Test Studio Setup file.

NOTE

Setup - Syncfusion Essential QuickTest Professional dialog box opens.

Shows the QTP setup

2.Click Next. The User Information dialog box opens.

Add the information to install QTP setup

3.Enter the User Name, Organization and Unlock Key in the corresponding text boxes provided.
4.Click Next.

NOTE

The unlock key is validated.

5.Select the installation folder dialog box opens.

Select the location to installation of QTP setup

6.To install in the default location, click Next.

NOTE

You can also browse to choose a location by clicking Browse.

7.Installation type dialog box opens.

Select the installation type to install QTP setup

8.Choose from the options listed. For example, to install the complete setup, click Complete.
9.Click Next. The Ready to Install dialog box opens.

Shows the installation of QTP setup

10.Click Install to continue with the installation.

Enabling add-on support in UFT

You have to installed WPF Add-in while installing UFT by choosing below option.

Select the needed feature to install QTP setup

UFT - WPF Add-in installation

Configuring add-in assemblies for different .NET framework version

You need to configure Syncfusion add-in assemblies based on the framework version of the application that you are trying to automate.
For example, below are the steps to configure the custom add-in assemblies of syncfusion for SfDataGrid.

  1. You need to ensure that Syncfusion.CNGand SyncfusionTestObjects.XMLfiles are in the following location,
    C:\Program Files\HP\QuickTestProfessional\dat\Extensibility\WPF\Syncfusion
    C:\Program Files\HP\QuickTestProfessional\dat\Extensibility\WPF\

  2. Also, ensure thatSyncfusion.SfGridQTP.WPF.dll and Syncfusion.GridExt.WPF.dllare in the following location,
    C:\Program Files\HP\QuickTest Professional\dat\Extensibility\WPF\Syncfusion

  3. When your system does not contain Syncfusion.CNG , SyncfusionTestObjects.XML and
    Syncfusion.SfGridQTP.WPF.dllfiles in the above mentioned location, you have to copy the files from the below location based on the framework version of the application you are trying to automate,
    C:\Program Files\Syncfusion\Essential QTP\25.1.35\WPF\bin\

Configuring add-in based on your application framework version

By Default, Syncfusion QTP or UFT add-in configured based on the higher Framework version installed in your machine. if you have developed your application is lower framework version, you to configure the right version assemblies as below,

  1. Copy the custom add-in assemblies of Syncfusion from the below installed location based on the framework version of application you are trying to automate,
    C:\Program Files\Syncfusion\Essential QTP\25.1.35\WPF\bin\ <Version>

  2. Paste the copied assemblies to below location,
    C:\ProgramFiles\HP\QuickTestProfessional\data\Extensibility\WPF\Syncfusion\

Create, Record and Run the tests

Creating a new Test

1.Open QTP by double-clicking the QuickTest Professional icon.

NOTE

The QuickTest Professional – Add-in Manager window is displayed.

2.Select the WPF check box under the Add-in header. This ensures that WPF add-in is installed. Also, you need to check the Syncfusion add-in to detect the Syncfusion Controls. When it is not selected, you cannot access the Syncfusion controls.

Select the syncfusion checkbox for access the syncfusion control in QTP

3.Click OK.

NOTE

The QuickTest Professional – [Start Page] window opens. There are two tabs namely Start Page and Test in the main pane of the window. The content under the Start Page tab is displayed by default.

Shows the default QTP page

4.Click the New Test icon in the Start Page.

Click the new test icon in QTP starting page

5.A new test is created. You can also create a new test by selecting the Test tab in the main pane of the window or Test sub-menu under the New menu in the menu bar.
6.Click Record in the toolbar to start the recording.

Show the new test is created in QTP

NOTE

Record and Run Settings dialog box opens.

WPF UFT displays open the Record and Run Settings dialog box

7.Select the Windows Application tab.

NOTE

The content under the tab is displayed.

Show the content under the tabs while recording the test

NOTE

The Record and run only option is selected by default.

8.Select the following checkbox to ensure that only the applications opened by QuickTest and added applications are tested.

  1. Applications opened by Quick Test
  2. Applications opened via the Desktop (by the Window shell)
  3. Applications specified below

9.To add an application for testing, click the + button in the Application details.

NOTE

The Application Details dialog box opens.

Show the application details dialog box

10.For Application field, browse and select the path of the application that has to be tested by clicking Browse and select the path of application field while clicking button in WPF QTP
button.
11.For working folder field, browse and select the path of the working folder by clicking Browse and select the path of working folder field while clicking button in WPF QTP
button.
12.Select the Launch application check box, to launch the application immediately after clicking OK.
13.Select Include descendant processes check box, to include all the processes that are descendant to the current process.

NOTE

Both Launch application and Include descendant processes check boxes are selected by default

14.Click OK.

NOTE

The path of the application and working folder are displayed in the Application details frame as shown in the following screenshot.

Show the Record and Run Settings dialog of QTP

15.Click OK.

NOTE

The recording starts. The application in the given path is opened as shown in the following screenshot.

Recording the test in QTP

Running a Test

On recording, all the user actions performed in the control are just noted with the corresponding method names of the Syncfusion namespace. The errors can be checked while running a test. To run a test:

1.Click Run in the toolbar. The Run dialog box opens. The Results Location tab is selected by default.

Show the Run dialog window of QTP

Editing a Test

The editing of a test can be done either in the Keyword view or in the Expert view. You can switch between these views by selecting the required tab at the bottom left of the QTP screen.

Editing in Expert View

This view is especially provided for the experts in VB Script. In the Expert view, the VB scripts are generated while recording. You can also manually write scripts to the existing scripts in this view. So, this view can be used as a tool for managing the testing process in a more controlled manner. You can add scripts to trigger events manually.

The following image shows adding a script line to the Expert View pane.

Shows adding a script line to the expert view pane

Editing in Keyboard View

The keyword view is meant for people with no expertise in VB scripts. Keyword view contains the controls used, the user-actions or operations performed, values involved in the operation and the documentation summary in a table format. The controls used are listed under the Item header in a tree-view format as shown in the following screenshot:

Shows adding a script line to the keyboard view pane

Saving a Test

Saving a test is as simple as saving any other document or picture. To save a test:

1.Click the Save button in the toolbar. The Save Test dialog box opens.

Save the test result of QTP

2.Select the location, to save the file from the Look in drop-down list. 
3.Type the name of the file to be saved in the File name text box. 
4.Click Save. 
5.The test is saved.

Running a Saved Test

The tests that have been saved can be replayed later. For running such tests:
1.Click Open on the toolbar.

NOTE

The Open Test dialog box opens with a list of saved tests.

Save the result after run the test case in QTP

2.Select the required test. 
3.Click Open.

NOTE

The saved test is opened with its name and the complete path as the name of the window. By default, Expert View of the Test is opened.

Supported Controls

The following controls are supported for UFT/QTP testing

SfDataGrid

Method

Description

Parameters

Parameter Explanation

Return Type

void SetCurrentCell(int row,int col); To Set the CurrentCell. int row, int col Passing current row and column index to the SetCurrentCell method Void
void GroupColumn(string columnName); To Group the Column String columnName Passing MappingName for a column Void
void UnGroupColumn(string columnName); To Un Group the column String columnName Passing MappingName for a column Void
void SortColumn(string columnName,string state); To Sort the column string columnName, string state Passing MappingName for a column, passing sorting state whether Ascending / Descending Void
void BeginEdit(int row,int col); To Enter the Edit mode for particular cell int row,int col Passing current row and column index to the BeginEdit method Void
void EndEdit(); To EndEdit the current cell NA - Void
void GetRowCount(); To get the row count of the SfDataGrid NA - Int
void GetColumnCount(); To get the column count of the SfDataGrid NA - Int
void GetCellValue(int rowIndex, int columnIndex); To get the value of the cell int rowIndex, int columnIndex Passing row and column index for a cell Object

Properties

Description

Type

Data Type

Int RowCount Gets the RowCount of the SfDataGrid N/A Int
Int ColumnCount Gets the ColumnCount of the SfDataGrid N/A Int

Testing the SfDataGrid control in QTP

SfMulticolumnDropDownControl

Method

Description

Parameters

Parameter Explanation

Return Type

void SetSelectedIndex(int index); To set the SelectedIndex from the Popup Int index Passing columnindex to the SetSelectedIndex method Void
void ShowPopup(); To open the Popup NA - Void
void HidePopup(); To Close the Popup NA - Void

Testing the SfMultiColumnCDropDown control in QTP

SfDataPager

Method

Description

Parameters

Parameter Explanation

Return Type

void SetCurrentPage(int pageIndex To set the current page in SfDataPager Int pageIndex Passing currentpage index to the SetCurrentPage method. Void

Testing the SfDataPager control in QTP

GridDataControl

Method

Description

Parameters

Parameter Explanation

Return Type

bool IsColSorted(string colName); Identify whether the column is sorted or not. String colName Passing the MappingName of the column Bool
bool HasMappingName(string mappingName); Identify whether the given MappingName is present for the Grid. String MappingName Passing MappingName for a column Bool
bool IsGroupsExpanded(); Check whether the Groups are expanded or not NA - Bool
bool IsRecord(int recordIndex); Check the record based on the record index int recordIndex Passing record index Bool
bool IsRecordExpanded(int recordIndex); Check whether the record is Expanded int recordIndex Passing record index Bool
bool IsGroupRow(int rowIndex); Check whether the row is GroupRow int rowIndex Passing row index Bool
Int GetChildCount() Gets the Groups count NA - Int
Void ScrollToRowIint row) Move the cursor to specified row index int row Passing the row index Void
ScrollToCol(int col) Move the cursor to specified column index int col Passing the column index Void
Void MoveTo(int row) Move the currentcell to particular row index int row Passing the row index Void
Void SortColumn(string colName,string sortOrder) Sorting the column String colName, string sortOrder Passing the column MappingName and sort direction Void
Void GroupBy(string colName) Grouping the column Sting colName Passing the column MappingName Void
Void ExpandAllGroups() To expanding the all groups NA - Void
Void CollapseAllGroups() To collapsing the all groups NA - Void
Void ExpandGroup(int recordIndex) To expand the group based on the record index. int recordIndex Passing the record index. Void
Void CollapseGroup(int recordIndex) To collapse the group based on the record index. int recordIndex Passing the record index. Void
Void ExpandAllRecords() To Expand all nested records. NA - Void
Void CollapseAllRecords() To Collapse all records NA - Void
Void ExpandRecord(int recordIndex) To Expand the particular record based on the record index. int recordIndex Passing the record index Void
Void CollapseRecord(int recordIndex) To collapse the particular record based on the record index. int recordIndex Passing the record index Void
Void AddVisibleColumn(string MappingName, string HeaderText) To add the new visiblecolumn String MappingName, String HeaderText Passing the MappingName and HeaderText for the column. Void
Void InsertVisibleColumn(int insertAt, string MappingName, string headerText) To insert the visible column for particular index. int insertAt,string MappingName, string headerText Passing the column index, MappingName and HeaderText for the column Void
Void RemoveVisibleColumn(string colName) To remove the visiblecolumn String colName Passing the MappingName for a column Void
Void GetColSortOrder(string colName) To get the column sorting order String colName Passing the MappingName for a column Void
Void MoveCurrentCellTo(int rowIndex, int columnIndex) To move the current cell to particular row and column index. int rowIndex, int columnIndex Passing the row and column index Void
Void MoveCurrentCellTo(int rowIndex) To move the current cell to particular row index. int rowIndex Passing the row index Void
Void MoveTo(Object o) To move the current cell to particular row and column index. Object o Passing the underlying object Void
Bool isRecordAvailable(Object o) To check whether the record is available or not Object o Passing the underlying object Bool
Bool IsReadOnly(int row, int col) To check whether the cell is readonly or not int row, int col Passing the row and column index Bool
Void CellClick(int row, int col) To move the focus to the particular cell int row, int col Passing row and column index Void
Void ResizeColumns(int fromColumn, int to, double width) To resize the column int fromColumn, int to, double width Passing the from column index, to column index and width of the column Void
Void ResizeRows(int fromRow, int to, int height) To resize the row int fromRow, int to, double height Passing the from row index, to row index and height of the row Void
Void GetCellValue(int row, int col) To get the particular cell value int row, int col Passing the row and column index Void
Void GetCellType(int row, int col) To get the particular cell type int row, int col Passing the row and column index Void
Double GetCellProperty(int row, int col, string value)  To get the x/y/height/width for particular cell int row, int col Passing the row and column, string value Double
Void SetCurrentCell(int row, int col) To set the currentcell to particular row and column index int row, int col Passing the row and column index Void

Testing the GridDataControl in QTP

GridTreeControl

Method

Description

Parameters

Parameter Explanation

Return Type

Void ExpandAllNodes() To expand all nodes in GridTreeControl - - Void
Void ExpandNode(int rowIndex) To expand the particular code int rowindex Passing the row index Void
Void CollapseAllNodes() To collapse the all nodes - - Void
Void CollapseNode(int rowIndex) To collapse the particular node Int rowindex Passing the row index Void

Testing the GridTree control in QTP

Grid Control

Method

Description

Parameters

Return Type

bool SetCurrentCell(int row, int col) Sets the CurrentCell based on Row and Column parameters. int row, int col bool
bool SetChkBoxCell(int row, int col, bool val) Sets the CheckBoxCell value by using Row, Column and Value parameters. int row, int col, bool val bool
bool IsFormulaCell(int row, int col) Finds whether the cell is a formula cell. int row, int col bool
int GetSelectedRowIndex() Gets the selected row from Grid. NA int
int GetSelectedColIndex() Gets the selected Column from Grid. NA int
void SetCellData(int row, int col, string val) Sets the cell data by using Row, Column and Value parameters. int row, int col, string val void
void InsertColumns(int col, int count) Inserts the column by using Count and Target parameters. int col, int count void
void InsertRows(int row, int count) Inserts the row by using Count and Target parameters. int row, int count void
void RemoveColumns(int col, int count) Removes the columns by using Row parameter. int col, int count void
void RemoveRows(int row, int count) Removes the Rows by using Row parameter. int row, int count void
void MoveRows(int removeAtRowIndex, int count, int insertAtRowIndex) Moves the row by using From and Target parameters. int removeAtRowIndex, int count, int insertAtRowIndex void
void MoveColumns(int removeAtColIndex, int count, int insertAtColIndex) Moves the column by using From and Target parameters. int removeAtColIndex, int count, int insertAtColIndex void
void CellClick(int row, int col) Performs a click action to the cell by using row and column parameters. int row, int col void
void ResizeColumns(int fromColumn, int to, int width) Resizes the column by using column parameter. int fromColumn, int to, int width void
void ResizeRows(int fromRow, int to, int height) Resizes the row by using row parameter. int fromRow, int to, int height void
void SetScrollPosition( int vScrollPosition, int hScrollPosition) Sets the scroll position based on vScrollPosition and hScrollPosition parameters. int vScrollPosition, int hScrollPosition void
void SelectRange(int topRow, int leftCol, int bottomRow, int rightCol) SelectRange by using Top,Left,Right and Bottom parameters. int topRow, int leftCol, int bottomRow, int rightCol void
void ScrollInToView(int row, int col) Scrolls the cell into view, based on Row and Column parameters. int row, int col void
void HideRows(int fromRow, int to) Hides rows based on Row parameter. int fromRow, int to void
void HideCols(int fromCol, int to) Hides columns based on Column parameter. int fromCol, int to void
void ShowHiddenRows(int fromRow, int to) Shows the hidden Rows in Grid. int fromRow, int to void
void ShowHiddenCols(int fromCol, int to) Shows the hidden Columns in Grid. int fromCol, int to void
string GetCellType(int row, int col) Gets the CellType as a string value based on Row and Column parameters. int row, int col string
string GetCellBackground(int row, int col) Gets the background color as string value based on Row and Column parameter. int row, int col string
string GetCellForeground(int row, int col) Gets the foreground color as string value, based on Row and Column parameters. int row, int col string
string GetFormattedText(int row, int col) Gets the formatted text as string value based on Row and Column parameters. int row, int col string

Properties

Description

Type

Data Type

Int RowCount Gets the RowCount of the SfDataGrid N/A Int
Int ColumnCount Gets the ColumnCount of the SfDataGrid N/A Int

Chart

Method

Description

Parameters

Type

Return Type

Refresh links

SetScrollPosition To record the scrolling of Chart Area. (int area, int axis, double zoomposition) NA Void NA
ChartSegmentDragging Denotes the Segment that is dragged. (int series, int segment) NA Void NA
ChartZoomedIn To record the Zoom in of Chart Area (int areaindex, double xzoomFactor, double yzoomFactor) NA Void NA
ChartZoomedOut To record the zoom out Chart Area. (int areaindex, double xzoomFactor, double yzoomFactor) NA Void NA
ChartZoomReset To record the Chart Area reset. (int areaindex, double xzoomFactor, double yzoomFactor) NA Void NA
ChartPanning To record the panning of Chart Area. (int area, double zoomXPosition, double zoomYPosition) NA Void NA
LegendLocationChanged To record the change in location of Legend. (double dockX, double dockY) NA Void NA
ContextMenuOpening To record the ContextMenu support. (double isOpen) NA Void NA
InteractiveCursorLocationChanged To record the Interactive Cursor. (double offsetX, double offsetY, int areaindex) NA Void NA

SfChart

Method

Description

Parameters

Return Type

void SelectionChanged(int selectedIndex, int seriesIndex) To record select the segment /series by using selected index and series index parameter int selectedIndex, int seriesIndex void
void ZoomChanged(double zoomFactor, double zoomPosition, int axisIndex); To set the zoom factor and zoom position to the chart axis in order to zoom-in/ zoom-out chart. double zoomFactor, double zoomPosition, int axisIndex void
void PanChanged(double zoomPosition, int axisIndex) To set the zoom position to the chart axis in order to pan the chart. double zoomPosition, int axisIndex void
void ResetZoom(int axisIndex); To reset the zoom position and zoom factor value to the chart axis. int axisIndex void
void DraggingAnnotation(double x1, double x2, double y1, double y2, int index) To set the selected annotation position by X1, X2, Y1 and Y2 parameters. double x1, double x2, double y1, double y2, int index Void

PivotGrid

Method

Description

Parameters

Return Type

void ShowGroupingBar()

Sets the GroupingBar properties of PivotGrid when ShowGroupingBar value is true.

N/A

void

void ResizeColumns(int left, int right, double width);

Resizes the column of internal Grid for desired width.

int left, int right, double width

void

void ResizeRows(int top, int bottom, double height);

Resizes the row of internal Grid for desired height.

int top, int bottom, double height

void

bool LoadInBackgroundCompleted()

Returns the value as true once the LoadInBackground action has been completed.

N/A

bool

bool AllowSelection()

Returns the value when selecting the cells of internal Grid.

N/A

bool

bool AllowSelectionWithHeaders();

Return the value when selecting the value cells along with headers of PivotGrid.

N/A

bool

void CellClick(int rowIndex, int colIndex);

Performs the click action to the cell of internal Grid by using specific row, column.

int rowIndex, int colIndex

void

void ExpandAll()

Expands all the rows or columns of PivotGrid.

N/A

void

void CollapseAll()

Collapses all the rows or columns of PivotGrid.

N/A

void

bool SortBegin()

Indicates whether the sorting operation has been started when sorting the values of PivotGrid.

N/A

bool

bool SortCompleted()

Indicates whether the sorting operation has been completed when the values of PivotGrid have sorted.

N/A

bool

bool CanDrop()

Returns the value when the PivotItem has been dropped between GroupingBar fields.

N/A

bool

bool ContextMenuOpening()

Returns the value when opening the context menu of PivotItem.

N/A

bool

bool FilterPopupOpened() Returns the value when clicking the filter popup of any PivotItem to filter the values. N/A bool
bool FilterActionCompleted() Indicates whether the filtering action has been completed if the values are added in filters of PivotGrid. N/A bool