I am writing an XCTest test for a webview that contains HTML. I want to be able to find elements in the HTML DOM by an attribute different than value. Looking for something like an accessibility label.
I have tried the approach below
<input label="Rob" value="Rob" alt="Rob" caption="Rob" aria-labelledby="Rob" for="Rob" type="Rob" accessibilityTitle="Rob" accessibilityLabel="Rob" id="Rob" name="Rob" arial-label="Rob" _ placeholder="Search..." type="text">
I am looking to search by the id "Rob" but the only way how the element can be accessed is
let searchTextField = XCUIApplication().webViews.textFields["Search..."]
Any idea how to find element from webview in XCTest by any label/accessibility identifier is much appreciated.