Starting on 10/20/17, did something change regarding the iOS simulators that are used for the Xcode Test step? All of my test jobs suddenly started failing with this error:
“Neither element nor any descendant has keyboard focus”
This error occurs when XCTest / simulator cannot access the keyboard when attempting to type some value into a text field element. Until now (for around 6 months or so). In order to prevent this from happening, you must go to (iOS Simulator menu) Hardware > Keyboard > then disable “Connect Hardware Keyboard”.
As this is a CI service , I was accomplishing this remotely by running a script before running the Xcode Test step:
This was working beautifully, but for some reason this is no longer accomplishing the desired effect. I honestly have no idea how other people have been getting around this without running this pre-test script, when using Xcode UI Tests.
Any expedient help would be really appreciated. Thanks a lot.
Hi @viktorbenei, thanks for the reply, this is on the Xcode 9.0.x stack. It looks like Xcode was updated to 9.0.1 on this stack a couple of days ago? (From Apple release notes: Updated Simulator to use the iOS runtime used on iPhone X.) I will try updating locally to 9.0.1 to see if I can reproduce the issue I outlined above.
I’m trying the same workflow on the 9.1 stack to see if I get any different results.
Have you guys encountered anyone else running into issues with their iOS UI tests running properly?
Hey, sorry to zombie this thread, but we’re having the same issue with our builds. They work locally and in general we don’t get this problem on our dev machines, but when we do it’s because the software keyboard isn’t being shown.
With Xcode 12 beta / iOS 14 simulators it looks like the software keyboard is disabled by default, but I can’t work out any way to programatically enable it.
That’s great news! Well, environments are updated weekly (which can be checked here) but it would be hard to pinpoint what change could have solved this without understanding the cause
Well this release of iOS and Xcode hasn’t gone as smoothly as normal for Apple. Maybe it was something with the GM seed? Anyway, it’s working now so all good. Thanks again!