码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2017-11-10 20:36:25      阅读:1303      评论:0      收藏:0      [点我收藏+]

标签:select   bsp   src   logs   port   报错   new   using   中间   

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

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




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

标签:select   bsp   src   logs   port   报错   new   using   中间   

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

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!