1、问题概述?
问题已经完美解决!
在通过appium+python3进行自动化测试的时候,需要向输入框输入一串数字如123456.
具体代码如下:
#输入验证码
yzm=driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR, 'new UiSelector().text("请输入验证码")')
yzm.click()
yzm.send_keys(123456)
这个时候上面的代码发生了错误信息:
翻译过来就是:无法将元素设置为“123456”。你与正确的元素互动了吗?
raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
selenium.common.exceptions.InvalidElementStateException: Message: Cannot set the element to '123456'. Did you interact with the correct element?
Stacktrace:
io.appium.uiautomator2.common.exceptions.InvalidElementStateException: Cannot set the element to '123456'. Did you interact with the correct element?
at io.appium.uiautomator2