Ilya G
Ilya G

Reputation: 469

Identify element in espresso by resource-id from UI Automator viewer

I have following resource-id in UI Automator viewer, but I'm not sure how can use it in matcher when running espresso tests. Example

resource-id: com.app.cooking.debug:id/design_menu_item_text

How should I transform this id to Espresso id to make sure I can run matcher:

Espresso.onView(ViewMatchers.withId("com.app.cooking.debug:id/design_navigation_view")).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))

P.S. I don't have that id in R.id.myId

Upvotes: 0

Views: 806

Answers (1)

Nehemias G Miranda
Nehemias G Miranda

Reputation: 91

This should work Espresso.onView(ViewMatchers.withId(R.id.design_navigation_view)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))

Upvotes: 1

Related Questions