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()

纠正代码后,就可以正常执行代码了。




原文地址:https://www.cnblogs.com/kaerxifa/p/7816066.html