Hi everyone, how are you doing?
I’m using a method that asserts that the iOS Date pickerwheel has the expected values (month, day, year). This method has been working up until the last Xcode update but now the assertions fail. They’re basically checking the field value against the expected value in the test:
def assert_date_pickerwheel(month_value, day_value, year_value) assert find_element(:xpath, '//XCUIElementTypeCell[@name="Date"]/XCUIElementTypeOther[2]/XCUIElementTypePickerWheel[1]').value == month_value assert find_element(:xpath, '//XCUIElementTypeCell[@name="Date"]/XCUIElementTypeOther[2]/XCUIElementTypePickerWheel[2]').value == day_value assert find_element(:xpath, '//XCUIElementTypeCell[@name="Date"]/XCUIElementTypeOther[2]/XCUIElementTypePickerWheel[3]').value == year_value find_element(:xpath, '//XCUIElementTypeStaticText[@name="Date"]').click end
And the invocation goes like this:
FooPage.assert_date_pickerwheel( 'May', '25', '2018' )
When I explicitly ask the test to print the elements’ value it prints an empty line:
puts find_element(:xpath, '//XCUIElementTypeCell[@name="Date"]/XCUIElementTypeOther[2]/XCUIElementTypePickerWheel[1]').value #this gives literally '', I understand it's nil
This is really odd since the Appium Inspector effectively shows the correct value of these elements. I’ve checked the xpath locator (unfortunately in this scenario we didn’t find a better locator, might try class chain in a future refactor) and it’s the exact same path. The element exists and all but the test seems to be incapable to read other than an empty in the element’s value.
Any idea on what might be going and how can I find a fix to it? I’ve tested it on the beta and I’m having the same results.
Regards!
Octavio