title: UI testing - No matches found for Descendants matching type... recording generated code
body: <p>I am getting an error </p>
  
  <p><code>No matches found for Find: Descendants matching type NavigationBar from input {(
      Application, 0x60400019b790, pid: 20515, label: '&lt;appname&gt;'
  )}</code></p>
  
  <p>but the code was generated by the recording function of XCUITest so I don't understand why it can't find the navbar. I have added an <code>accessibilityIdentifier</code> that is a localized string called <code>dashboardNavBar</code> to try and use that to find it instead but I am having trouble querying it. The current code I am using is: </p>
  
  <pre><code>func testLoginLogout() {
      let app = XCUIApplication()
      //login credentials and other code that takes me to dashboard of app
      app.navigationBars["Dashboard"].children(matching: .button).element(boundBy: 2).tap()
      app.sheets["Do you want to Logout ?"].buttons["OK"].tap()
  }
  </code></pre>
  
  <p>and the <code>app.navigationBars...</code> line is the line that throws the error above. I was hoping someone could tell me why it is unable to locate this navBar or whatever the problem is, and how I can fix it or work around it using the <code>accessibilityIdentifier</code>. Thanks.</p>