Automate Picker Wheel using Testsigma

June 7, 2024P M Nagabhushanam

Start automating your tests 5X Faster in Simple English with Testsigma

Try for free

Pickerwheel is the UI element, specific to mobile devices that allows a user to pick a single value from multiple values displayed as a scrollable list. This UI element is available on both Android and iOS. Here, in this article, we will be discussing how to automate PickerWheel specifically for iOS.

How to automate PickerWheel UI element using Appium:

Automation of an iOS-specific pickerWheel UI element via Appium using the XCUITest driver is quite simple. Let’s look at 2 approaches to do so below:

Approach 1: 

The simplest way to automate the PickerWheel is via the “driver.sendKeys()” method. PickerWheel contains values in the form of strings. The same string that needs to be selected can be passed as a value via sendKeys and the needed result can be achieved.

Here, the pickerWheel element is accessed via method “XCUIElementTypePickerWheel” as in the sample code below:

driver.findElement(By.xpath(“//XCUIElementTypePickerWheel[@value=’Today’]”)).sendKeys(“Wed 25 Dec”);


Element located by pickerWheel is “//XCUIElementTypePickerWheel[@value=’Today’]”.

Value picked by pickerWheel is “Wed 25 Dec”.

Refer image below to get more clarity about PickerWheel via Appium Inspector:

PickerWheel via Appium Inspector

Approach 2: 

In the second approach, javascript’s mobile method selectPickerWheelValue can be used:


HashMap<String, Object> params = new HashMap<>();

params.put(“order”, “next”);

params.put(“offset”, 0.15);

params.put(“element”, ((RemoteWebElement) pickerWheelElement).getId());

driver.executeScript(“mobile: selectPickerWheelValue”, params);


And it accesses the pickerWheel values in forward or backward direction, as needed, using the above parameters.   

  • Order: The value of order determines where to pick the next value – for forward direction “next” value should be passed and for backward “previous” should be passed.

  • Offset: The height of the wheel at which click should be done.

  • Element: PickerWheel element.

Let’s discuss how the pickerWheel interaction can be automated in an iOS native application using simple natural language in Testsigma:

  “ Pick option by text test data in the UI identifier picker view”

Automate Picker Wheel using Testsigma


test data: The pickerWheel value that should be selected regardless of direction.
ui identifier:  locator of the PickerWheel Element.

Automate your tests for Web, Mobile, Desktop and APIs on Cloud with Testsigma. No setup required.

Try for free

Suggested Reading


Start automating your tests 5X Faster in Simple English with Testsigma

Try for free