Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAPickerWheel.selectValue() not working for text values within UIDatePicker

I have created a simple project using storyboards containing just a UIDatePicker with mode=Date (so that dates appear like "November" "28" "2011").

Within Instruments UI Automation I am trying to set the values of the individual date picker wheels.

I can successfully use the selectValue() method to set the wheels which contains numeric values but cannot manage to set text value of the month e.g. "November".

This works..

target.frontMostApp().mainWindow().pickers()[0].wheels()[1].selectValue(12);

but this doesn't..

target.frontMostApp().mainWindow().pickers()[0].wheels()[0].selectValue("November");

I get the error: Script threw an uncaught JavaScript error: - selectValue is not supported on a picker with undefined values

I have done a UIATarget.localTarget().frontMostApp().logElementTree() and can see the value is correct:

UIAPickerWheel: value:November rect:{{1, 142}, {146, 216}}

Please can anyone advise on what I might be doing wrong, many thanks.

like image 615
MandyW Avatar asked Nov 28 '11 20:11

MandyW


1 Answers

This has been remedied in the latest version of xcode (4.5.2)

target.frontMostApp().mainWindow().pickers()[0].wheels()[0].selectValue("November");

It will now work.

like image 192
Neil Horton Avatar answered Oct 16 '22 13:10

Neil Horton