Traversal of container neutron objects in testcomplete

Source: Internet
Author: User
Tags testcomplete

1. Requirement: select only one specified value in a container control.

2. Capture the target container: assign a value after namemapping

Set detailprodgroups = aliases. dbcproductsdetailcontainer. detailprodgroup

The container layout is as follows (each row includes checkbox, image, textview, label, and so on ):

650) This. width = 650; "Title =" qq 41031153125.png "alt =" wKioL1RTO2HAua8oAAC8rRTJ-dg765.jpg "src =" http://s3.51cto.com/wyfs02/M00/4D/8F/wKioL1RTO2HAua8oAAC8rRTJ-dg765.jpg "/>

3. Implementation idea: only capture the container layer, then obtain the sub-object based on the Child method or the item method (different methods of the control), and then match the sub-object name in the loop.

4. Code pasting:

For i =0 To DetailProdGroups.BandCount-1        ‘get the name of child controls        strProductName=DetailProdGroups.Child(i).ComponentTitle        ‘set the status of checked all false        DetailProdGroups.Child(i).BandCheckbox.Checked=false        If productname <>"" Then            ‘only select product "productname"            If Instr(strProductName,productname)>0 Then                DetailProdGroups.Child(i).BandCheckbox.Checked=true             End If        Else            Log.Error("The product name"& productname &" is invalid.")            Exit Sub        End If         Next

 

This article is from the "qytag (upspringing)" blog, please be sure to keep this source http://qytag.blog.51cto.com/6125308/1570410

Traversal of container neutron objects in testcomplete

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.