通过UIautomator定位报错

来源:1-16 通过UIAutomator进行定位用户信息

慕神6633432

2018-06-24

def login_by_uiautomator():
  driver.find_element_by_android_uiautomator('new UiSelector().text("手机号/邮箱")').clear()
  driver.find_element_by_android_uiautomator('new UiSelector().text("手机号/邮箱")').send_keys('18513199587')
  driver.find_element_by_android_uiautomator('new UiSelector().resource-id("cn.com.open.mooc:id/password_edit")').send_keys('111111')

报错:

raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource.


写回答

2回答

Mushishi

2018-07-11

在python里“”,‘’都说标识字符串的意思,如果你都用单引号和双引号都可以,只是需要转义,你多层的时候转义一下就行。

0
0

Mushishi

2018-06-25

粗心大意。仔细看看写的字母。这个定位字母必须必须一样。

0
2
Gogogood
回复
慕神6633432
我也是这样,你知道原因了吗?
2018-07-08
共2条回复

Python主讲移动端自动化测试框架Appium

APP自动化基础知识、po模型、关键字模型、服务自动化、持续集成

1508 学习 · 1333 问题

查看课程