gpt4 book ai didi

java - 通过 UI Automator 查看器中的资源 ID 识别 espresso 中的元素

转载 作者:行者123 更新时间:2023-12-02 09:12:14 25 4
gpt4 key购买 nike

我在 UI Automator 查看器中有以下资源 ID,但我不确定在运行 espresso 测试时如何在匹配器中使用它。示例

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

我应该如何将此 id 转换为 Espresso id 以确保我可以运行匹配器:

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

附注我在 R.id.myId

中没有该 ID

最佳答案

这应该有效 Espresso.onView(ViewMatchers.withId(R.id.design_navigation_view)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))

关于java - 通过 UI Automator 查看器中的资源 ID 识别 espresso 中的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59310187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com