QTP childobjects Usage

Source: Internet
Author: User

Childobjects:

Returns the collection of child objects contained within the object.

F1 Help explanation: Returns all child objects of the current calling object

This explanation is very abstract, below us a scenario, such as Page object, a page has 100 button buttons need to click, such as one of us to click, the code will need 100 lines, and requirements change, may increase to 200 button, Then we need to add 100 click Code lines, so the efficiency is very low, then there is no better application method, the answer is yes

Let's look at a piece of code first

Set odesc=description. Create ()
Odesc ("Micclass"). Value = "Webbutton"
Set buttons=browser ("Micclass:=browser"). Page ("Micclass:=page"). Childobjects (ODESC)
Nunberofbuttons=buttons.count
For i = 0 to NuberOfButtons-1
printf buttons (i). Value
Next

You can see what's not there, yes. All button clicks on a Web page are done using a descriptive programming +childobjects method

QTP childobjects Usage

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.