Assertion Failure: UI Testing Failure - Internal error: Unable to set the value for picker view

While running UI tests on device (iPhone 6/6+ iOS 9.2), tests will fail when trying to set the value for date picker. Date picker mode is set to date and time.

Test will work fine on iOS 9.2 simulator.

It will show following failure logs -

Assertion Failure: UI Testing Failure - Internal error: unable to find current value 'Dec 24' in possible values 4 Nov, 5 Nov, 6 Nov, 7 Nov, 8 Nov, 9 Nov, 10 Nov, 11 Nov, 12 Nov, 13 Nov, 14 Nov, 15 Nov, 16 Nov, 17 Nov, 18 Nov, 19 Nov, 20 Nov, 21 Nov, 22 Nov, 23 Nov, 24 Nov, 25 Nov, 26 Nov, 27 Nov, 28 Nov, 29 Nov, 30 Nov, 1 Dec, 2 Dec, 3 Dec, 4 Dec, 5 Dec, 6 Dec, 7 Dec, 8 Dec, 9 Dec, 10 Dec, 11 Dec, 12 Dec, 13 Dec, 14 Dec, 15 Dec, 16 Dec, 17 Dec, 18 Dec, 19 Dec, 20 Dec, 21 Dec, 22 Dec, 23 Dec, 24 Dec, 25 Dec, 26 Dec, 27 Dec, 28 Dec, 29 Dec, 30 Dec, 31 Dec, 1 Jan, 2 Jan, 3 Jan, 4 Jan, 5 Jan, 6 Jan, 7 Jan, 8 Jan, 9 Jan, 10 Jan, 11 Jan, 12 Jan, 13 Jan, 14 Jan, 15 Jan, 16 Jan, 17 Jan, 18 Jan, 19 Jan, 20 Jan, 21 Jan, 22 Jan, 23 Jan, 24 Jan, 25 Jan, 26 Jan, 27 Jan, 28 Jan, 29 Jan, 30 Jan, 31 Jan, 1 Feb, 2 Feb, 3 Feb, 4 Feb, 5 Feb, 6 Feb, 7 Feb, 8 Feb, 9 Feb, 10 Feb, 11 Feb for the picker wheel "Today" PickerWheel

Steps to Reproduce:

1. Download the sample project located at https://github.com/vinsp/SampleUITestCaseDatePicker

2. Run the "testDatePicker" test.

3. Test will fails when we try to set the value for date component

[startDatePickerElements[0] adjustToPickerWheelValue:@"Dec 25"];

Replies

Duplicate of https://forums.developer.apple.com/thread/16104