Espresso click on specific words of text


In my espresso test I want to tap on a certain part of a text element with the idSwitchTextView . The full text reads ” Are you a member? Login with email” When you click on the login with email it switches the view of the page.

When I use onView(withId(; The test passes but because there is initial text before the text I want to be clicked on it doesnt change view. How can I pin point and only touch the “Login with email” text?


You can do like this

onView(withId("Login with email"))));

Answered By – ugurcmk

Leave a Comment