gran_profaci gran_profaci - 2 months ago 11
iOS Question

How can I get EarlGrey to select the keyboard's window or other private UIKit elements?

I am trying to write a test to automate the showing and hiding of the UI keyboard. However, I need to make sure that the keyboard is visible on the screen whenever I try to make such a call. I found that I can check for an element of the

class to do so, but how do I get
to match it since there's no direct unique matcher for it. Is there any way with EarlGrey by which you can match on these internal elements?


From the FAQ:

How do I create a matcher that matches internal UIKit classes?

Use NSClassFromString to match on internal classes that can't be referenced directly.