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