# XCTest / Xcode UI Test - Simulator Error Causing Test Failures

**URL:** <https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085>\
**Category:** Tooling Issues\
**Tags:** testing, xcode\
**Created:** [October 22, 2017, 7:23pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085 "2017-10-22T19:23:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliancmg](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@juliancmg](https://discuss.bitrise.io/u/juliancmg)\
**Post date:** [October 22, 2017, 7:23pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/1 "2017-10-22T19:23:24Z")

</div>

Hello,

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:

**defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false**

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.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [October 23, 2017, 12:50pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/2 "2017-10-23T12:50:08Z")

</div>

Hi @juliancmg,

Which stack?

In general, on Oct 20 nothing changed. We did roll out the usual weekly updates on 21st, you can find the details here: [Weekly Virtual Machine / Stack updates - 2017.10.21](http://discuss.bitrise.io/t/weekly-virtual-machine-stack-updates-2017-10-21/3068)

---

<div class="post-metadata">

**Author:** ![juliancmg](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@juliancmg](https://discuss.bitrise.io/u/juliancmg)\
**Post date:** [October 23, 2017, 5:04pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/3 "2017-10-23T17:04:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [October 24, 2017, 11:17am UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/4 "2017-10-24T11:17:46Z")

</div>

> [@juliancmg](#):
>
> Have you guys encountered anyone else running into issues with their iOS UI tests running properly?

Not that I’m aware of, no.

> [@juliancmg](#):
>
> I’m trying the same workflow on the 9.1 stack to see if I get any different results.

Let us know how it goes! 🙂

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 10, 2017, 7:36pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/5 "2017-11-10T19:36:37Z")

</div>

> [@juliancmg](#):
>
> I’m trying the same workflow on the 9.1 stack to see if I get any different results.

Did you try it on the Xcode 9.1 final stack @juliancmg? Did that help?

---

<div class="post-metadata">

**Author:** ![brindyddg](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/brindyddg/32/3161_2.png) [@brindyddg](https://discuss.bitrise.io/u/brindyddg)\
**Post date:** [September 11, 2020, 7:57pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/6 "2020-09-11T19:57:33Z")

</div>

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.

Any ideas?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [October 9, 2020, 1:40pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/7 "2020-10-09T13:40:56Z")

</div>

Hi @brindyddg! In case it’s still happening, can you send us some build examples with access enabled? Thanks!

---

<div class="post-metadata">

**Author:** ![brindyddg](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/brindyddg/32/3161_2.png) [@brindyddg](https://discuss.bitrise.io/u/brindyddg)\
**Post date:** [October 12, 2020, 8:51pm UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/8 "2020-10-12T20:51:49Z")

</div>

Hi @bitce - thanks for following up. It looks OK now. Thanks!

Did something change?

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [October 13, 2020, 8:19am UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/9 "2020-10-13T08:19:14Z")

</div>

That’s great news! Well, environments are updated weekly (which can be checked [here](https://github.com/bitrise-io/bitrise.io/tree/master/system_reports)) but it would be hard to pinpoint what change could have solved this without understanding the cause 🤔

---

<div class="post-metadata">

**Author:** ![brindyddg](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/brindyddg/32/3161_2.png) [@brindyddg](https://discuss.bitrise.io/u/brindyddg)\
**Post date:** [October 13, 2020, 9:39am UTC](https://discuss.bitrise.io/t/xctest-xcode-ui-test-simulator-error-causing-test-failures/3085/10 "2020-10-13T09:39:39Z")

</div>

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!
