title: XCUITest: Failed to find Matching Element
body: <p>I have a close button on a ViewController that is being presented as a ChildViewController. I have this button's accessibility turned on and the accessibility identifier is <code>closeButton</code>. This button does not have any text, it just has an image.</p>
  
  <p>I am attempting to test the presentation and dismissal of this view, but am running into an issue, the XCUITest cannot find the element. My test code is:</p>
  
  <pre><code>app.buttons["PresentChild"].tap()
  XCTAssertTrue(app.otherElements["ChildViewController"].exists)
  XCTAssertTrue(app.buttons["closeButton"].exists)
  </code></pre>
  
  <p>The first assert passes, but the second assert fails. </p>
  
  <p>I tried to do the "Record UI Test" to select the button to have it be automatically generated, but then I just get an error saying <code>Failed to find Matching Element</code>. I tried erasing all the content on the simulator and deleting all derived data, and that didn't work either. </p>
  
  <p>Does anyone know a workaround to this obvious bug in Xcode? I can't access the element through the recording, I can't access the element through the accessibility feature, I have zero idea how else to access this button.</p>