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