我正在尝试在Firebase测试实验室Robo测试上运行此测试
[
{
"eventType": "VIEW_TEXT_CHANGED",
"timestamp": 1539204374357,
"replacementText": "11111111111",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
"className": "android.support.design.widget.TextInputEditText",
...
},
{
"eventType": "VIEW_TEXT_CHANGED",
"timestamp": 1539204421008,
"replacementText": "Qwer123*",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
"className": "android.support.design.widget.TextInputEditText",
...
]
这两个字段类是相同的(因为它们是自定义字段),因此Firebase测试实验室无法将它们区别开。 elementDescriptor相同。你知道如何区别他们吗?
答案 0 :(得分:0)
您应该能够通过在元素描述符中定义“文本”或“ resourceId”字段来区分小部件。例如。当您想使用资源ID标识特定的小部件时:
....
"elementDescriptors": [
{
"resourceId": "com.example.myapp:id/my_edit_text"
}
]
....