Top Banner
QuickTest Professional www.ramupalanki.com 07/03/22 For more QTP Scripts, visit www.ramupalanki.com
42
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Copyofqtppresentation 101229032428-phpapp01

QuickTest Professional

www.ramupalanki.com

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 2: Copyofqtppresentation 101229032428-phpapp01

Introduction to Automation Testing

• What is Automation Testing ?

• Benefits

• Automation Testing Process

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 3: Copyofqtppresentation 101229032428-phpapp01

QTP Testing ProcessQuick Test testing process consists of 7 main phases

1. Preparing to record– Test Environment– Test Conditions

2. Recording a session on your application– Navigate according to Test Conditions

3. Enhancing your test– Adding logic and conditional statements– Parameterization– Inserting checkpoints

4. Debugging your test– Check that it operates smoothly and without interruption.04/12/23 For more QTP Scripts, visit

www.ramupalanki.com

Page 4: Copyofqtppresentation 101229032428-phpapp01

QTP Testing Process5. Run Test

– Check the behavior of your application

6. Analyzing the test results

7. Reporting defects

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 5: Copyofqtppresentation 101229032428-phpapp01

QTP Layered ArchitectureLogical name

Physical Description

Application

Layer1

Layer2

Layer3

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 6: Copyofqtppresentation 101229032428-phpapp01

QTP Window Expert

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 7: Copyofqtppresentation 101229032428-phpapp01

Tree and Expert View Relation

• Test Objects hierarchy can be seen in both the TreeView and the Expert View

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 8: Copyofqtppresentation 101229032428-phpapp01

Object Spy• It is used to view object

properties and Methods

• Displays • Object hierarchy tree • Run-time object methods

or test object methods

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 9: Copyofqtppresentation 101229032428-phpapp01

Object Repository

Locate object in repository Find data-dependant

property

Parameterize property’s value

• Interface between QTP Script and the Application

• Contains Logical Name and physical Description

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 10: Copyofqtppresentation 101229032428-phpapp01

Recording Modes1. Normal recording

– Records the objects in your application and the operations performed on them. This mode is the default and takes full advantage of Quick Test’s test object model.

2. Analog Recording– Record the exact mouse and keyboard operations you perform in relation to

either the screen or the application window.

3. Low-Level Recording– Record on any object in your application, whether or not Quick Test

recognizes the specific object or the specific operation.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 11: Copyofqtppresentation 101229032428-phpapp01

Enhancing Tests

1. Parameterizing Test

2. Regular Expressions

3. Creating Checkpoints

4. Creating Output Values

5. Dividing Tests into Multiple Actions

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 12: Copyofqtppresentation 101229032428-phpapp01

Parameterizing Tests To run the scenario with multiple sets of data.

Steps for Parameterization

1. Defining a Data Table Parameter

2. Adding Parameter Values to a Data Table

3. Modifying Steps Affected by Parameterization

4. Running and Analyzing a Parameterized Test

Demo………………..

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 13: Copyofqtppresentation 101229032428-phpapp01

Demo…………..

How to provide the data to the respective Parameter through Tree View

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 14: Copyofqtppresentation 101229032428-phpapp01

Demo…………..How to provide the data to the respective Parameter through Expert View

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 15: Copyofqtppresentation 101229032428-phpapp01

Regular Expressions• Regular expressions enable Quick Test to identify Objects and text

strings with varying values.

• User has to identify the data projected to be change, like dates, so to accepts any dates, user can use regular expression.

Example :

Actual Date format :

05/19/2004 (mm/dd/yyyy)

After Regular Expression:

[0-1][0-9]/[0-3][0-9]/200[0-9]

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 16: Copyofqtppresentation 101229032428-phpapp01

Demo……

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 17: Copyofqtppresentation 101229032428-phpapp01

Demo……..

Click icon

Do the changes as, shown below and select Regular Expression.

QTP will take the year from 2000 -2009

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 18: Copyofqtppresentation 101229032428-phpapp01

CheckpointsUsed to check the current behavior of the application with the expected behavior.

Text /Text Area Checkpoint

Standard Checkpoint

Table Checkpoint

Page checkpoint

Database Checkpoint

Image Checkpoint

Accessibility Checkpoint

Bitmap Checkpoint

XML Checkpoint04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 19: Copyofqtppresentation 101229032428-phpapp01

Text /TextArea Checkpointchecks that Current Text format with the Expected Text Format in a Web page or application window

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 20: Copyofqtppresentation 101229032428-phpapp01

Table CheckpointChecks information in a table

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 21: Copyofqtppresentation 101229032428-phpapp01

Page checkpoint

• Checks the characteristics of a page

• Check how long a Web page takes to load or if a Web page contains broken links.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 22: Copyofqtppresentation 101229032428-phpapp01

Page checkpoint

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 23: Copyofqtppresentation 101229032428-phpapp01

Database Checkpoint

• Used to check current Database data with the Expected Database data.

• Check that the value in a database query is correct.

• Demo………

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 24: Copyofqtppresentation 101229032428-phpapp01

Bitmap Checkpoint

• Checks an area of a Web page or application after capturing it as a bitmap

• Check that a Web page (or any portion of it) is displayed as expected.

• Demo………….

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 25: Copyofqtppresentation 101229032428-phpapp01

Bitmap Checkpoint

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 26: Copyofqtppresentation 101229032428-phpapp01

XML Checkpoint

• Checks the data content of XML documents

• XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page.

• Demo………….

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 27: Copyofqtppresentation 101229032428-phpapp01

XML Checkpoint

XMLFile("Poem.xsl").Check CheckPoint("Poem.xsl_2")

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 28: Copyofqtppresentation 101229032428-phpapp01

Image Checkpoint

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 29: Copyofqtppresentation 101229032428-phpapp01

Accessibility Checkpoint

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 30: Copyofqtppresentation 101229032428-phpapp01

Creating Output Values

• This is just reverse to the Parameterization, In this case QTP takes the data from the application and displays the same in the Data Table.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 31: Copyofqtppresentation 101229032428-phpapp01

Creating Output Values

Window("Flight Reservation").WinEdit("Name:").Output CheckPoint("Name:_3")

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 32: Copyofqtppresentation 101229032428-phpapp01

Transactions

• A transaction represents the business process that you are interested in measuring

• You can measure how long it takes to run a section of your test by defining transactions.

• User can Plan the Scenario as transaction and use the Start Transaction and End Transaction while Recording.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 33: Copyofqtppresentation 101229032428-phpapp01

Transactions

Services.StartTransaction "Start"

Services.EndTransaction "Start"

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 34: Copyofqtppresentation 101229032428-phpapp01

Actions• Actions help to divide Test Script into logical units

• Usage : 1)We can design more modular and efficient tests.

2)Actions enable you to parameterize specific components of a test

3)Two or more tests can call the same action

4)Complex tests may have many actions and may share actions with

other tests.

• Example:04/12/23 For more QTP Scripts, visit

www.ramupalanki.com

Page 35: Copyofqtppresentation 101229032428-phpapp01

ActionsWe can divide Test Script into multiple actions by creatingnew actions or by inserting existing actions.

Kinds of actions:• Non-Reusable Action : An action that can be used only in the

test in which it was created, and only once.

• Reusable Action : An action that can be called multiple times by the test in which it was created (the local test) as well as by other tests.

• External Action : A reusable action created in another test. External actions are read-only in the calling test. They can be modified only in the test in which they were created.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 36: Copyofqtppresentation 101229032428-phpapp01

Creating New Actions• We can add new actions to Test Script during a recording session or

while designing Test Script.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 37: Copyofqtppresentation 101229032428-phpapp01

Splitting ActionsWe can split an existing action into two sibling

actions or into parent-child nested actions.

We cannot split an action and the option is disabled

• when an external action is selected• when the first line of the action is selected• while recording a test• while running a test• when you are working with a read-only test

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 38: Copyofqtppresentation 101229032428-phpapp01

Splitting Actions

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 39: Copyofqtppresentation 101229032428-phpapp01

Inserting Existing Actions• We can insert an existing action by inserting a copy of

the action into Test Script, or by inserting a call to the original action.

• Example:

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 40: Copyofqtppresentation 101229032428-phpapp01

Inserting Existing Actions• Copy of Action : It copied in its entirety, including checkpoints, parameterization, and the

corresponding action tab in the Data Table.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 41: Copyofqtppresentation 101229032428-phpapp01

Inserting Existing Actions• Calls to Actions: We can insert a call (link) to a reusable action that resides in your

current test (local action), or in any other test (external action).

Tree View

Expert View

04/12/23 For more QTP Scripts, visit www.ramupalanki.com

Page 42: Copyofqtppresentation 101229032428-phpapp01

Setting Action Properties

• The Action Properties enables to modify an action name, add or modify an action description, and set an action as reusable.

04/12/23 For more QTP Scripts, visit www.ramupalanki.com