如何将密钥发送到具有相同资源 ID 的文本框
How to sendKeys to Text Box which have the same Resource ID
我正在尝试自动登录我的应用程序,但它们具有相同的资源 ID。我正在使用 Uiautomatorviewer,并且在登录屏幕中没有任何 Xpath。如何将键发送到第二个文本框?我正在使用 YAML。
我找到了问题的解决方案。我希望这对在同一页面上有两个相同 ResourceID 的任何人有所帮助。
- description: Inserts Username
action: org.getopentest.appium.SendKeys
args:
locator: { id: "com.son.sonin.inhouse:id/validation_input_field"}
text: q20confirmed@mailinator.com
- description: Verify that the "Password" text is there
action: org.getopentest.appium.SendKeys
args:
locator: { xpath: "//android.widget.EditText[@text='PASSWORD']" }
text: Son2016
我正在尝试自动登录我的应用程序,但它们具有相同的资源 ID。我正在使用 Uiautomatorviewer,并且在登录屏幕中没有任何 Xpath。如何将键发送到第二个文本框?我正在使用 YAML。
我找到了问题的解决方案。我希望这对在同一页面上有两个相同 ResourceID 的任何人有所帮助。
- description: Inserts Username
action: org.getopentest.appium.SendKeys
args:
locator: { id: "com.son.sonin.inhouse:id/validation_input_field"}
text: q20confirmed@mailinator.com
- description: Verify that the "Password" text is there
action: org.getopentest.appium.SendKeys
args:
locator: { xpath: "//android.widget.EditText[@text='PASSWORD']" }
text: Son2016