android / android/testing-samples
UiSelector.resourceId("myButtonId") not working
- 主要语言
- Java
- 星标
- 9.3k
- 派生
- 3.6k
- PR 合并指标
- 30 天内没有已合并 PR
描述
I'm trying to get the facebook Login button in UIautomator but its failing to find the button given the id of the button
```
```
And here is the code how I'm accessing the button in my test case
`UiObject facebookButton = mDevice.findObject(new UiSelector().resourceId("login_button_facebook"));`
Its failing to find the button saying :
```
android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[RESOURCE_ID=login_button_facebook]
at android.support.test.uiautomator.UiObject.click(UiObject.java:416)
```
Please let me know if I'm doing it wrong.
The documentation has not much detail about how to use it.
贡献指南
调研方向
从布局 XML 和调用 UiSelector.resourceId("login_button_facebook") 的测试用例开始,然后阅读与报告的 UiObjectNotFoundException 相关的 UiSelector.resourceId 和 UiObject API。根据已渲染的 Facebook 登录按钮确认选择器行为,并验证测试能够找到并点击它。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, java
- 领域
- mobile, testing-qa
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100