You can use the iOS Wheel Picker Addon to automate iOS wheel picker elements.
The elements are of type XCUIElementTypePickerWheel and can be scrolled to select various options.
The Addon contains 4 actions:
Scroll Picker Wheel
Scroll Picker Wheel to Value
Scroll PickerWheel using Offset
Select Picker Wheel Option
Let's review all 4 actions.
The Scroll Picker Wheel action will scroll the picker wheel a set amount of times either forward or backwards as indicated by the two input fields.
The Order field can receive either ‘next’ or ‘previous’ indicating the direction and Scrolls field will receive the number of scrolls to perform.
In the following example, the left picker wheel was scrolled from the starting value of 8, to 10:
This action will scroll the wheel either forward or backwards until the input text is contained in the current option selected by the wheel.
The first parameter again being the direction of the scroll and the second being the Text in the wheel option we are searching for.
The following example will scroll the right picker wheel backwards until it contains 25:
This action will scroll the picker wheel either forward or backwards using the ratio of the picker wheel height you want the click to happen.
This action only has one parameter, being Option. This parameter is the option to select from the wheel.
The wheel will be scrolled in any direction to find the option if possible.
The following example will select 20 in the left picker wheel immediately, even if it is not currently visible: