In iOS applications, segmented controls allow you to select one of several options. Each option is represented by a segment - a button, which is part of the segmented control. The user can touch a segment to select it.
The image below demonstrates a sample segmented control containing three segments:
To work with segmented controls in tests, use the
iOS SegmentedControl test object. To work with individual segments, use the
iOS Segment test object.
|Note:||The described support is available only if the tested iOS application and the computer where TestComplete is running have been prepared for testing in a special way. See Preparing Applications, Devices and Test Computers for iOS Testing.|
TestComplete analyzes a control's class names in your tested application and automatically creates wrapper objects for the supported controls. The classes of the supported segments and segmented controls are listed in the project’s Object Mapping options. You can extend this list. For example, you can add the class name of a custom segmented control used in your tested application, and thus enable support for this control. For more information, see Object Mapping.
iOS SegmentedControls and
iOS Segment test objects provide access to native properties and methods of the underlying controls. They also provide specific properties and methods that can be used for simulating user actions on controls and for retrieving control data.
The topics in this section provide detailed information on working with segmented controls in TestComplete and contain sample scripts.
In This Section
Determining the Currently Selected Segment
Getting the Number of Segments in a Segmented Control
Related Topics of Interest
Testing iOS Applications (Legacy)
iOS Segment Support
iOS SegmentedControl Support