gl qtp day 1 & 2

33
© Copyright GlobalLogic 2008 1 Quick Test Professional By Rajat Gupta

Upload: pragya-rastogi

Post on 01-Dec-2014

607 views

Category:

Technology


5 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

1

Quick Test Professional

ByRajat Gupta

Page 2: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

2

Agenda

• Introduction to Automation Testing• QTP Testing Process• Add-in Manager• QTP Script Views • Object Repository• Checkpoints • Creating Output values• Actions • Results • Debugging Tests • User Defined Functions • Regular Expressions • Other Items

Page 3: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

3

Introduction to Automation Testing

• What is Automation Testing ?• Benefits

Page 4: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

4

QTP Testing Process

Quick 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.

Page 5: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

5

QTP Testing Process

5. Run Test – Check the behavior of your application

6. Analyzing the test results

7. Reporting defects

Page 6: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

6

Add-in Manager

• Default Add-ins

– ActiveX

– Visual basic

– Web

• Other Add-Ins

– Siebel

– Java

– SAP

– Oracle

– .Net and many more

QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test)

Page 7: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

7

QTP Window

Page 8: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

8

QTP – Keyword View

Page 9: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

9

QTP – Expert View

Page 10: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

10

Object Repository

• Object repository dialog box displays a test tree of all objects in the current action or the entire application.

• Using Object repository we can

a) Identify the Object

b) View the Object

Properties

Page 11: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

11

Object Spy

• Using the Object Spy, we can view the properties of any Object in the open application.

• We can also view Object Methods.

Page 12: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

12

How Quick Test Recognizes Objects

• For each object class, QTP has a default set of properties that it always learns.

1.Mandatory Properties.

2.Assistive properties.

3.Ordinal Identifier.• Usually, only a few properties are needed to uniquely identify an

object.

Page 13: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

13

Recording Modes

• 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.

• Analog Recording– Record the exact mouse and keyboard operations you perform in

relation to either the screen or the application window.

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

recognizes the specific object or the specific operation.

Page 14: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

14

Enhancing Tests

• Parameterize Test• Regular Expressions• Creating Checkpoints• Creating Output Values• Dividing Tests into Multiple Actions

Page 15: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

15

Parameterize Tests

To run the scenario with multiple sets of data.

Steps for Parameterization • Defining a Data Table Parameter• Adding Parameter Values to a Data Table• Modifying Steps Affected by Parameterization• Running and Analyzing a Parameterized Test

Demo…

Page 16: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

16

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 :

17/08/2008 (dd/mm/yyyy)

After Regular Expression:

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

Page 17: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

17

Synchronization

• Synchronization point enables the anticipated time problems between the application and QTP.

• A progress bar reaches 100% completion.• A status message appears.• A button becomes enabled.• A window opens and is ready for data entry.• A pop-up message appears in response to an operation.

Page 18: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

18

How to Synchronize the Test

We can synchronize the test by

1.Inserting a synchronization point

Insert Step Synchronization point

Window(“Flights”).WinButton(“Update order”).WaitProperty”enabled”,1,1000

2.Adding Exist and Wait statements

status=Window(“Flights”).Dialog(“Flights Table”).Exist

Wait(10)

Page 19: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

19

Checkpoints

• A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property.

• We can Insert checkpoint

1.From Menu

Insert Checkpoint Standard Checkpoint

2.From Keyword view

3.From the Active Screen

Page 20: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

20

Checkpoint Types

Standard Checkpoint Checks values of an object’s properties Check that a radio button is selected.

Image Checkpoint Checks the property values of an image

Check that the image source file is correct.

Table Checkpoint Checks information in a table Check that the value in a table cell is correct.

Page checkpoint Checks the characteristics of a Web page Check how long a Web page takes to load or if a Web page contains broken links.

Text / Text Area Checkpoint

Checks that a text string is displayed in the appropriate place in a Web page or application window

Check whether the expected text string is displayed in the expected location on a Web page or dialog box

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.

Page 21: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

21

Checkpoint Types Cont…

Database Checkpoint Checks the contents of databases accessed by an application or Web site

Check that the value in a database query is correct.

Accessibility Checkpoint Identifies areas of a Web site to check for Section 508 compliancy

Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines.

XML Checkpoint Checks the data content of XML documents

Note: 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.

Page 22: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

22

Text /TextArea Checkpoint

Checks the Current Text format with the Expected Text Format in a Web page or application window

Demo…

Page 23: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

23

Standard Checkpoint

Checks values of an object’s properties

Demo…

Page 24: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

24

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.

Demo…

Page 25: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

25

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…

Page 26: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

26

Accessibility Checkpoint

• Check if the images on a Web page include ALT properties,• required by the W3C Web Content Accessibility Guidelines

Demo…

Page 27: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

27

Output Values

• An output value is a step in which one or more values are captured at a specific point in your test and stored for the duration of the run session. The values can later be used as input at a different point in the run session.

• You can output the property values of any object. You can also output values from text strings, table cells, databases, and XML documents.

Demo for Text Output Value and Standard Output Value

Page 28: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

28

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.

Page 29: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

29

Types of Actions

We can divide Test Script into multiple actions by creating

new 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.

Page 30: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

30

Insert Call to a New Action

• You can add a new action during or after recording.• Select Insert -> Call to New Action from the QuickTest main menu.

The Insert New Action window appears.• Or use the “Call to New Action” icon on the toolbar to insert new

action.

Page 31: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

31

Splitting Actions

We 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

Page 32: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

32

Splitting Actions Cont…

Page 33: Gl qtp   day 1 & 2

© Copyright GlobalLogic 2008

33

Inserting Existing Actions

• We can insert an existing action by

– Inserting a copy of the action

It copied in its entirety, including checkpoints, parameterization,

and the corresponding action tab in the Data Table.

– Inserting a call to the original action 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).