quicktest pro 8.2 tutorial
TRANSCRIPT
QucikTest Professional 8.2QucikTest Professional 8.2
TutorialTutorial
Automated Testing
QTP Introduction
Preparation
Record
Enhance
Run & Debug
Reference
OutlineOutline
Drawbacks of manual testing
Time-consuming and tedious
Impossible to test each feature thoroughly
Benefits of AT
Fast (快速 ) Reliable (可靠 ) Repeatable (可重复 ) Programmable Comprehensive (全面 ) Reusable(可重用 )
QTP Introduction
What is QTP? Mercury QuickTest Professional is functional test and
regression test automation solution that address every
major software application and environment. Basic purpose: to test standard web object,
ActiveX controls and Visual Basic controls Structure: B/S and C/S
Testing process
Preparation
Record
Enhance
Run & Debug
Analyze
Preparation
Testing Plan:
What process and web?What’s the expected?When to begin and end?
Computer:Close unneeded software (anti-virus, etc)
Internet Explorer settings
QTP:QTP 8.2 or newer
Required add-in
Record
QuickTest Window Hop to record?
Enhance your test
Add comment Creating checkpoints Parameterizing TestsSuggestions:
Playback of it first
Add Comment ‘ ‘Browser("Browser").Page("Page_2").WebEdit("#hobby").Set "Reading
novels" Browser("Browser").Page("Page_2").WebButton("Submit").Click
Rem Rem <<<<<<<<<<<<<check the output Browser("Browser").Page("Page_3").WebElement("input_text_1").Check
CheckPoint("input_text_1") Browser("Browser").Page("Page_3").WebEdit("#hobby").Set "Watching TV" Browser("Browser").Page("Page_3").WebButton("Submit").Click
Creating checkpoints
A checkpoint is a verification point that compares a current value for a specified property with
the expected value for that property.
Effect: it enables you to identify whether your Web site or application is functioning correctly. Pre-defined checkpoint User-defined checkpoint
User-defined checkpoint
Dim Style , index Style =
Browser("Browser").Page("Page_22").WebEdit("#Aim").GetROProperty("outerHTML")
index = InStr (Style, "color=read") If index <>0 Then
Reporter.ReportEvent micPass, "HTML compared", "OK"Else
Reporter.ReportEvent micFail, "HTML compared", "Trouble"End If
Parameterizing Tests
A parameter is a variable that is assigned a value from an external data source or generator.
It greatly increases the power and flexibility of your test or component.
Parameters’ types
Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.
Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply.
Parameters’ types (Continued)
Environment variable parameters enable you to
use variable values from other sources during the run session.
Random number parameters enable you to
insert random numbers as values in your test
or component.
Two types of Data sheets
Global Sheet Usage: it will be available to all actions and control the number of test iterations.
Local Sheet Usage : it will be available in that action only and control the number of action iterations.
Advanced configuration
Regular expression
Use Data Table formula
Run & Debug
Wait() and sync Msgbox() Object Spy Debug toolbar
Analyze
Read test report Why it fails if it exits
Features of QTP
Active Screen (脚本的离线维护 ) Keyword View & Expert View ( 2 种视图方式) Auto-Documentation Generator : Step & Function Check Point :Standard, Table, Text, etc.. DataTable: Global & Local Parameterizing (参数化 ) Object Spy (对象识别器 ) Object Repository (对象仓库 )
What’s not mentioned
Split Action Insert Action Find objects VBScript Descriptive Programming ……
Plus
Keyword driven Testing It deploys the concept of Keyword-driven testing to radically simplify It deploys the concept of Keyword-driven testing to radically simplify
test creation and maintenance.test creation and maintenance.
When to use QTP?When to use QTP? When the system is relatively stable Functional testing & Regression testing How long and how frequent
Qualification
Be familiar with the system
Have a better understanding of QTP
Others
Resource
QTP Help \\192.168.1.1\bpm_testing\06_Testing_Tools\QTP Resource
http://www.51testing.com/cgi-bin/forumdisplay.php?fid=69 http://www.qaforums.com/cgi-bin/forums/ultimatebb.cgi?ubb=forum;f
=20;DaysPrune=1000
http://www.4028.cn/supgbk/articlelist.php?id=7 http://support.mercury.com
Any Questions?Any Questions?
Summary
QTP is one Keyword-driven testing tool Keyword-driven testing tool suitable for functional testing and regression testing.
Testing Process Preparation Record Enhance Run & Debug Analyze