Appium 使用android_uiautomator定位元素时报错: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
使用 android_uiautomator 定位元素时(现在用的还不太熟,对于这个方法还需要加深了解)报错:
报错信息:The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
因为用的不熟,所以也是上网查了好多方法,最后检查代码的时候发现,原来是拼写错误
我将new UiSelector()写成了newUiSelector(),中间少了一个空格
driver.find_element_by_android_uiautomator('newUiSelector().text("账号登录")').click()
改正后:
driver.find_element_by_android_uiautomator('new UiSelector().text("账号登录")').click()
纠正代码后,就可以正常执行代码了。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步