iOS TextField `clear` not working on iOS 12.x with Xcode 11
See original GitHub issueThe problem
I have updated my environment with Xcode 11 and Appium 1.15.0.
The clear
function on iOS TextField still works fine on iOS 13.0, but not anymore on 12.x
Environment
- Appium version (or git revision) that exhibits the issue: 1.15.0
- Last Appium version that did not exhibit the issue (if applicable): 1.14.2
- Desktop OS/version used to run Appium: macOS 10.14.6 with Xcode 11
- Node.js version (unless using Appium.app|exe): 11.9.0
- Npm or Yarn package manager: 6.9.0
- Mobile platform/version under test: iOS 12.2, 13.0
- Real device or emulator/simulator: Simulator and actual devices
- Appium CLI or Appium.app|exe: CLI
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:29 (9 by maintainers)
Top Results From Across the Web
insertText on UITextField not enab… | Apple Developer Forums
I have a use case where I call insertText(_ text: String) on UITextField and expect the iOS Keyboard's return key (Go button in...
Read more >Adding the "Clear" Button to an iPhone UITextField
This button is a built-in overlay that is provided by the UITextField class, but as of the iOS 2.2 SDK, there isn't any...
Read more >How to make a clear button appear in a textfield - YouTube
Subscribe : https://www.youtube.com/channel/UC_0srkcd_tioJrb11wBCdEQ?sub_confirmation=1Source ...
Read more >SwiftUI: How to add a clear button to a textfield - Martin Albrecht
In this article I want to show how to accomplish a simple clear button inside a SwiftUI TextField element. Note: XCode 11.x, Swift...
Read more >How to dismiss the keyboard for a TextField - Hacking with Swift
If you're supporting only iOS 15 and later, you can activate and dismiss the keyboard for a text field by focusing and unfocusing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
😃 I think it’s related with XCode 11’s update. As an example,
getText()
only works properly for iOS 13, but not lower versions. (E.g. I have a TextField which returns the placeholder all the time, although thevalue
attribute is properly set in the PageSource 😉 😃)XCode 11 seems to be breaking a lot of stuff 😕
I’ve installed their latest XCode 11.1 GM Seed, still doesn’t fix it …
One of the things I’ve noticed is that my PageSource now contains a lot of
XCUIElementTypeOther
… Something like this:Is generating:
So, I was forced to do something like this to select the proper element:
On iOS >= 13.0
On iOS < 13.0
field.clearValue()
does not workfield.setValue()
worksfield.getText()
/field.getValue()
return theplaceholder
’s value…placeholder
attribute it returns thelabel
’s value…placeholder
value to{this.state.responseCode}
then all tests pass, because it retrieves the right value (… doesn’t look like something I’d like to ship though 😄 )