Working With iOS Date Picker Controls

Applies to TestComplete 15.70, last modified on December 17, 2024

TestComplete supports most standard iOS controls, including date picker controls. Date picker controls are typically used to provide a way to choose time, or to show a timer.

The DatePicker control has four predefined display modes:

  • Date and time– default mode, displays date, hour, minute and optional AM/PM wheels.

  • Time– displays hour, minute and optional AM/PM wheels.

  • Date– displays month, day and year wheels.

  • Countdown timer– displays wheels for hour and minute. Has a maximum value of 23:59.

To work with iOS date pickers in tests, TestComplete provides the iOS DatePicker 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.

The supported date picker classes 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 date picker used in your tested application, and thus enable the recording and scripting support for this control. For more information, see Object Mapping.

The iOS DatePicker object provides access to native properties and methods of the underlying date picker control. It also provides specific properties and methods that can be used for simulating user actions on date pickers and for retrieving their data.

It is also possible to change the positions of individual columns by working with a child PickerView control. However, generally it is better to work with the DatePicker control as it hides details of control implementation from tests.

The topics in this section provide detailed information about working with date picker controls in TestComplete and contain script samples that illustrate the explanation.

In This Section

Checking a DatePicker's Date Range

Contains information on how to determine the minimum and maximum dates of the date picker.

Determining DatePicker Date

Contains information on getting the date displayed in the date picker control.

Changing DatePicker Date

Explains how to set a date on the date picker.

Related Topics of Interest

Testing iOS Applications (Legacy)

Describes the most common approaches for testing iOS applications.

See Also

iOS DatePicker Support
Object-Specific Tasks
Supported Controls

Highlight search results