Qtp test wintoolbar Control

Source: Internet
Author: User

The Windows notification area (usually the area where the QQ Software is minimized) cannot be recorded by qtp, but qtp is the wintoolbar that can recognize the objects in this area.

 

You can use the getitemscount method of wintoolbar to obtain the number of buttons displayed in the Windows notification area. You can use the getitem method to obtain the text of the buttons, so that you can compare them one by one, find the button to be clicked. Finally, press the button to perform the operation.

 

The following is an example of clicking the QQ icon in the Windows notification area:

Btncount = Window ("window"). wintoolbar ("notification area"). getitemscount

For I = 1 to btncount

Set BTN = Window ("window"). wintoolbar ("notification area ")

Btnname = BTN. getitem (I)

Print btnname

Ifbtnexist = instr (1, btnname, "QQ", 1)

If ifbtnexist> 0 then

BTN. Press BTN. getitem (I)

Exit

End if

Next

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.