I am currently trying to add Espresso UI testing to my Android application and I want to be able to target a TextInputEditText via it's Hint field and then click on it and enter in some text. (I know it's better practice to target ids but I need to target hint in this instance)

Here is how I have tried to do this:

```
Espresso.onView(Matchers.allOf(Matchers.instanceOf(TextInputEditText::class.java),
            ViewMatchers.withHint("My Hint"))).
            perform(ViewActions.click(), ViewActions.typeText("type this"))

```

However when trying to execute this I get the following error:

> 
> android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (an instance of android.support.design.widget.TextInputEditText and with hint: is "Old Password")
> 
> 
> 

Even though the output shows that the hierarchy actually does hold this view as follows:

> 
> **TextInputEditText**{id=2131820762, res-name=input\_data, visibility=VISIBLE, width=1328, height=168, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=true, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=true, editor-info=[inputType=0x80091 imeOptions=0x8000005 privateImeOptions=null actionLabel=null actionId=0 initialSelStart=0 initialSelEnd=0 initialCapsMode=0x0 hintText=**My Hint** label=null packageName=null fieldId=0 fieldName=null extras=null hintLocales=null contentMimeTypes=null ], x=0.0, y=0.0, text=, input-type=524433, ime-target=true, has-links=false}
> 
> 
> 

Is the ViewMatchers.withHint method broken in Espresso or is there a particular way to use it? Why would it fail to find the view but then in the output actually show it is in the hierarchy?