qtp mgl presentation

29
Client Logo Functional Testing with Mercury Quick Test Professional

Upload: techgajanan

Post on 04-Jun-2015

619 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Qtp Mgl Presentation

Client Logo

Functional Testing withMercury Quick Test

Professional

Niranjan Dash, Rajini G.SHARP Automation

Page 2: Qtp Mgl Presentation

Client Logo

Agenda

Basic Automation using QTP- Functional Testing Overview- Functional Testing Elements- Script Development with QTP- QTP Automation Benefits- Record and Run- Checkpoints and Synchronization

Advanced QTP Features- Parameterization- Multiple Actions- Recovery Scenario- Runtime Objects & Test Objects- Object Identification- Test Results

Page 3: Qtp Mgl Presentation

Client Logo

Functional Testing Overview Definition

“Certify the application from a business perspective”

Process Validate application functions against the functional

specification, i.e., functions yield the expected results? Report and track defects Measure test coverage and track application quality

Page 4: Qtp Mgl Presentation

Client Logo

Functional Testing Elements Test Environment (People, Processes, Hardware)

- Dedicated people, infrastructure, test database(s)

Test Case Inventory (Excel or TestDirector)- Documented inventory of tests (Step, Action, Data, Expected Result)

Test Script Development (QuickTestPro)- Convert documented test case into reusable automated script

Test Case Execution (Manual, QTP, or TestDirector)- Execute test cases, document results

Defect Reporting (Excel or TestDirector)- If Actual Result = Expected Result, raise defect

Test Coverage (Excel or TestDirector)- What percentage of application functions tested?

Quality Measurement (Excel or TestDirector)- Trended rate of finding / fixing defects

Page 5: Qtp Mgl Presentation

Client Logo

QTP Automation Benefits

Page 6: Qtp Mgl Presentation

Client Logo

Script Development with QTPScript Development with QTP

Page 7: Qtp Mgl Presentation

Client Logo

QTP Demonstration

Page 8: Qtp Mgl Presentation

Client Logo

Record and RunRecord and Run Recording levels

Standard recording Analog recording Low level recording

Run modes Normal Speed Update run

Page 9: Qtp Mgl Presentation

Client Logo

Data types in QTPData types in QTP Some of the supported data types in QTP:

- String, Integer, Boolean, Decimal, Date, Variant

Variable Declaration-Dim sText-Dim iNumber-Dim aArray() ‘Dynamic Array-Dim aArray(10, 2, 5)

Variable Assignment-sText = “String Value”-iNumber = 10-aArray = (“ABC”, “XYZ”)

Page 10: Qtp Mgl Presentation

Client Logo

Scripting in QuickTestProScripting in QuickTestProNote: VB Script is used in QuickTestPro for automating Testcases.

Function Screen_Display(sButtonName1,sButtonName2) Window("OsaSimulator").Page("Page").WebButton("name:="&sButtonName1).Click Window("OsaSimulator").Page("Page").WebButton("Apply").Click Window("OsaSimulator").Page("Page").WebButton("name:="&sButtonName2).Click bScreen = Window("OsaSimulator").Page("Page").WebEdit("Screen").Exist If bScreen Then reporter.ReportEvent micPass, "Custom Step", "Pass: Verify the " & sButtonName2 & " screen displays" Report_Result 4, "Verify the " & sButtonName & " screen displays", "Pass" Else reporter.ReportEvent micFail, "Custom Step", "Fail: Verify the " & sButtonName2 & " screen displays" Report_Result 4, "Verify the " & sButtonName & " screen displays", "Fail" End IfEnd Function

Page 11: Qtp Mgl Presentation

Client Logo

Expected Result “Checkpoints”

Page 12: Qtp Mgl Presentation

Client Logo

Window("Flight Reservation").ActivateWindow("Flight Reservation").WinButton("FLIGHT").Check CheckPoint("FLIGHT")Window("Flight Reservation").WinObject("Date of Flight:").Type "111111"Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"Window("Flight Reservation").WinButton("FLIGHT").Check CheckPoint("FLIGHT_2")Window("Flight Reservation").WinButton("FLIGHT").ClickWindow("Flight Reservation").Dialog("Flights Table").WinButton("OK").ClickWindow("Flight Reservation").WinEdit("Name:").Set "aaaa"Window("Flight Reservation").WinButton("Insert Order").ClickWindow("Flight Reservation").WinButton("Update Order").WaitProperty "enabled", true, 10000Window("Flight Reservation").WinButton("Button").Click

Page 13: Qtp Mgl Presentation

Client Logo

SynchronizationSynchronization

Options to Synchronize tests Call wait Exist wait property Sync

Page 14: Qtp Mgl Presentation

Client Logo

Advanced QTP FeaturesAdvanced QTP Features

Page 15: Qtp Mgl Presentation

Client Logo

Parameterizing TestingParameterizing Testing Different groups of parameters

Data table parameter Other parameters

Data driver

Page 16: Qtp Mgl Presentation

Client Logo

Working with Multiple ActionsWorking with Multiple Actions Action Creating Actions

Divide the test into multiple actions- Step > Split Action

Inserting call to new action- Insert > Call to New Action

Inserting existing- Insert > Call to Copy of Action - Insert > Call to Existing Action

Setting action as Reusable

Page 17: Qtp Mgl Presentation

Client Logo

Recovery Manager and Recovery Manager and ScenariosScenarios

Use of recovery scenario Recovery scenario consists of the following

Trigger event Recovery Operation Post recovery test run option

To create a recovery file Open the recovery scenario manager

- Define a trigger event that interrupts the run session

- Specifying the recovery operations required to continue

- Choosing a post recovery test operation- Specifying a name & description for the

recovery scenario- Specifying whether to associate this scenario to

the current test or all new tests

Page 18: Qtp Mgl Presentation

Client Logo

Page 19: Qtp Mgl Presentation

Client Logo

Page 20: Qtp Mgl Presentation

Client Logo

Importance of Object Importance of Object RepositoryRepository

Object repository Object identification Identification techniques

Mandatory & Assistive property Ordinary identifier Smart identification

How can we add objects to repository By recording Through active screen Add objects

Types of repositaries Per action mode (.mtr) Shared mode (.tsr)

Page 21: Qtp Mgl Presentation

Client Logo

Page 22: Qtp Mgl Presentation

Client Logo

Test Objects & Runtime ObjectsTest Objects & Runtime Objects

Test Objects (TO)

• Used by QT to represent objects in AUT

• TO property set created and maintained by QT, captured from AUT during recording

• Based on runtime object properties, but not necessarily 1-1 mapping

• QT uses stored TO properties to identify AUT objects during test run

• Access TO properties using GetTOProperty

• Access TO methods directly

Run-Time Objects (RO)

• Actual live objects in AUT • RO property set created and

maintained by AUT, ‘queried’ from RO by QT

• Access runtime property values (runtime value of property defined by QT) using .GetROProperty

• Access native object properties using .Object

• Access native object methods using .Object

Page 23: Qtp Mgl Presentation

Client Logo

Object Identification & Smart Object Identification & Smart IdentificationIdentification

QTP identifies run-time objects based on TO properties whose values are compared with the RO values

Recorded Mandatory + Assistive properties become mandatory object description used during replay

Smart Identification used when the object can’t be identified (during replay only)

Smart Identification is only invoked during replay, if enabled for the particular object class.

During the recording phase QTP records properties for Smart Identification, but doesn’t use them until Smart Identification is invoked

Page 24: Qtp Mgl Presentation

Client Logo

Object Identification & Smart IdentificationObject Identification & Smart Identification

MatchObject

Description

Create a list of objects (within the parent object) that match the description (mandatory + recorded assistive properties) that were recorded for this object.

OneObject?

ReturnObject

MultipleObjects?

Are there more than two objects in the list? (If there was only one, we’d have returned it).

ErrorObject

not found

Selector?Does this object have a location, index, or creation time selector?

UseSelector

ErrorMultipleobjects

If the selector for this object identifies an object in the original set, return the object.

If not – error.

Match baseproperties

Create a list of objects under the parent object that match all the base properties for this object class.

OneObject?

OptionalProps?

Filter bynext optional

property

“Forget everything we know,

start over from scratchand look for the object

based on what we think it should look like”

SmartID?

Legend

YesNo

Is Smart Identification turned on for this object class?

Smart ID successfully used to identify object (but used ordinal identifier)

Warning: Identification would probably not have been possible without Smart ID – check your Object Repository!

Page 25: Qtp Mgl Presentation

Client Logo

Smart IdentificationSmart Identification

Properties for Smart ID are recorded, but not used during replay

When Smart ID is invoked, QT uses the properties that were recorded to identify the object

Base and Optional Filter properties for Smart Identification must be set before-hand (so that QTP knows to record them).

Use only if required. Because QTP has to record more properties, enabling Smart Identification degrades performance

Page 26: Qtp Mgl Presentation

Client Logo

Smart IdentificationSmart Identification

Configuring Smart IdentificationTools Object Identification

Disable for specific object Disable for test run Temporarily disable Smart Identification during replay

Set App = CreateObject("QuickTest.Application")App.LaunchApp.Test.Settings.Run.DisableSmartIdentification = True …App.Test.Settings.Run.DisableSmartIdentification = False

Smart Identification in Test Results Smart Identification Warning in Test Results

Page 27: Qtp Mgl Presentation

Client Logo

Test ResultsTest Results

Page 28: Qtp Mgl Presentation

Client Logo

Questions?Questions?

Page 29: Qtp Mgl Presentation

Client Logo

Thank you!Thank you!