1. 程式人生 > >Could not parse UiSelector argument: 'XXX' is not a string

Could not parse UiSelector argument: 'XXX' is not a string

driver.find_element_by_android_uiautomator('new UiSelector().text("手機號/郵箱")').send_keys("12111")
driver.find_element_by_android_uiautomator("new UiSelector().resourceId('cn.com.open.mooc:id/password_edit')").send_keys("21003")

報錯:

Message: Could not parse UiSelector argument: ‘cn.com.open.mooc:id/password_edit’ is not a string

解決方案: 外側用 ‘’ (單引號) ,裡面的字串用 " " (雙引號)