017qtp descriptive Programming

Source: Internet
Author: User

I. When to use descriptive Programming

During the test, some interface elements occur dynamically or dynamically, but are not added to the object library during recording.

Ii. operating principles of descriptive Programming

When a test script written in descriptive programming is running, qtp uses the object description provided in the test script to find the object. The location of the search is not the object library, it matches the version of the temporary object created by qtp when the test program is running.

Iii. Usage of descriptive Programming

One method is to directly describe

(1) how to write an object in the object library

Dialog ("login"). winedit ("agent name:"). Set "Mercury"

Dialog ("login"). winedit ("agent name:"). Type mictab

(2) statement when no object exists in the object library

Dialog ("login"). winedit ("attached text: = agent name:"). Set "Mercury"

Expression: testobject ("propertyname1: = propertyvalue1", "propertyname2: = propertyvalue2 "...)

Another method to use the description object is as follows:

Set mydesc = description. Create ()

Mydesc ("attached text"). Vale = "agent name :"

Dialog ("login"). winedit ("mydesc"). Set "Mercury"

Iv. Characteristics of descriptive programming:

If descriptive programming is used at a certain point in the test object hierarchy, subsequent test objects under the test object hierarchy will be described using descriptive programming. (This indicates descriptive programming of level-1 directory use cases. Level-2 directories must use descriptive programming)

017qtp descriptive Programming

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.