我正在执行一些 UI 自动化并使用 Appium Inspector 检查 Microsoft 登录凭据屏幕的用户名文本字段。 通过 Id 引用元素时出现错误:“使用给定的搜索参数无法在页面上找到元素。”
我正在为 Appium 2.0 使用 Appium Inspector,根据推荐的选择器,我可以使用任一 id xpath 但是,id 在使用 xpath 时给我错误
失败的代码行:
driver.FindElementById("i0116").SendKeys("test");
为什么会这样?
我的环境是:
"desiredCapabilities": {
"platformName": "Android",
"appium:automationName": "UIAutomator2",
"appium:deviceName": "PixelSix",
"appium:app": "C:\\Users\\slai6\\Downloads\\MyApp.1.apk",
"appium:platformVersion": "11",
"appium:ensureWebviewsHavePages": true,
"appium:nativeWebScreenshot": true,
"appium:newCommandTimeout": 3600,
"appium:connectHardwareKeyboard": true
}