appium / WebDriverAgent

A WebDriver server for iOS and tvOS
Other
1.2k stars 377 forks source link

fix: unrecognized selector sent to instance 0x2829adb20 error in clear #809

Closed KazuCocoa closed 11 months ago

KazuCocoa commented 11 months ago

When I explored https://github.com/appium/appium/issues/19389, I found out the below command

e = driver.find_element :class_name, 'XCUIElementTypeSearchField'
e.clear

returned

> e.clear
Selenium::WebDriver::Error::UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIElement tapWithNumberOfTaps:numberOfTouches:]: unrecognized selector sent to instance 0x2829adb20
from UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIElement tapWithNumberOfTaps:numberOfTouches:]: unrecognized selector sent to instance 0x2829adb20

on a tvOS 17 device.

The clear search field worked, so we can simply skip the tapWithNumberOfTaps in case the platform does not have it

github-actions[bot] commented 11 months ago

:tada: This PR is included in version 5.13.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: