Automated test tools QTP Learning

Source: Internet
Author: User

operating principle of QTP:

QTP will find the name of the object library by "User name input Box", find the following object name, and then find the Object Name Mapping property bag through the found object name, the script is to find the object name in the warehouse through the object name of the control, find the corresponding data and method through the object name.

QTP is written in the VBScript scripting language, where the object repository (object name and attribute value) is mainly:

Browser behind the parentheses is the name of the double quotation marks, which is the use of Object warehouse script, browser means the browser, browser name and other properties in the object repository, the page behind the browser is a subordinate relationship, save the way and browser is the same, There will be an action at the end of this line of code, such as click or select and so on.

advantages and disadvantages of QTP tools : 1. Able to replace part of the manual operation of the &&2. However, it is not always possible to get objects: objects in the Warehouse (object Repository) are inconsistent with objects in the program (object Spy), through object Spy re-record the script to resolve.

Note:

1. Set the browser address in automation--->record and Run Settings

2. Write the script in the warehouse resources--->object Repository Manager, Object--->add objects add objects, appear white palm Click the browser input box

3. Recording script generation code

Browser ("Who I Am (1998 Jackie Chan starring film) _ Baidu Encyclopedia"). Page ("Who I Am (1998 Jackie Chan starring movie) _ Baidu Encyclopedia"). Link ("Tadpole Regiment"). Click
Browser ("Who I Am (1998 Jackie Chan starring film) _ Baidu Encyclopedia"). Page ("Who I Am (1998 Jackie Chan starring movie) _ Baidu Encyclopedia"). Link ("Farami"). Click
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webedit ("UserName"). Set "1293"
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webedit ("password"). SetSecure "56E2274E673143184A92EE104AED051D380F26CF"
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webbutton ("Login"). Click
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webbutton ("Login"). Click
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webedit ("Verifycode"). Set "XUVN"
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Webbutton ("Login"). Click
Browser ("Farami _ Baidu Encyclopedia"). Page ("Farami _ Baidu Encyclopedia"). Link ("Login encountered a problem"). Click
Browser ("Recover Password-confirm account"). Page ("Recover Password-confirm account"). Webedit ("username"). Set "SDHFSHFSF"
Browser ("Recover Password-confirm account"). Page ("Recover Password-confirm account"). Webedit ("Veritycode"). Set "SJSHJFSJF"
Browser ("Recover Password-confirm account"). Page ("Recover Password-confirm account"). Webbutton ("Next"). Click

2. Be sure to close the browser you want to test before playing back.

Basic use of QTP:

Checkpoint, parameterization, automation, adding test output information


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.