Select a date in UIDatePicker by UIAutomation?

I found that I can not do this with UIAPickerWheel.selectValue() , any idea?

+4
source share
2 answers

you can pass your value in the picker as follows:

 Picker.wheels()[1].selectValue(Your_Value); 

in wheels()[1] , [1] is the number of your wheel.

+5
source

I am having difficulty using the UIAPickerWheel selectValue selector function on the collector with the date of the month and day, as shown on the first (leftmost, zero) wheel from the image below. The only solution that worked for me, and not optimally, was to click a certain number of times above (below) the current selected value. The following code will touch above the selected value to reduce the daysAgo date times.

 var datePicker = this.popupWindow().pickers()[0]; for (var i = 0; i < daysAgo; ++i) { datePicker.wheels()[0].tapWithOptions({tapOffset:{x:0.81, y:0.30}}); this.target().delay(.4); } 

enter image description here

+1
source

Source: https://habr.com/ru/post/1433965/


All Articles