[英]In python and appium,why can't use send_keys() to inputbox
descr:when I used send_keys("xxx") to inputbox,I was told descr:当我使用 send_keys("xxx") 输入框时,有人告诉我
" selenium.common.exceptions.InvalidElementStateException: Message: Cannot set the element to '15323423456'. Did you interact with the correct element? " “ selenium.common.exceptions.InvalidElementStateException:消息:无法将元素设置为“15323423456”。您是否与正确的元素进行了交互? “
what this coused by?这是什么原因? Is this plugin too high or too low?这个插件是太高还是太低? My XPath is not wrong so I can't solve it, would you like to help me solve this problem?thank you我的XPath没有错所以我解决不了,你愿意帮我解决这个问题吗?谢谢
CODES:代码:
'newCommandTimeout' :'3000',
'unicodeKeyboard': True,
'resetKeyboard': True,
"automationName": "UiAutomator2"
}
self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
def testchangeto_pageone(self):
time.sleep(3)
WebDriverWait(self.driver, 10, 0.5).until(
EC.presence_of_all_elements_located((By.XPATH, "//*[@text='login']")))
self.driver.find_element_by_xpath("//*[@text='login']").click()
self.driver.find_element_by_xpath("//android.widget.EditText[@index='0']").click()
self.driver.find_element_by_xpath("//android.widget.EditText[@index='0']").send_keys("15323423456")
RESULTS:结果:
Edition:版:
我知道是什么原因造成的,因为appium太高了。卸载并重新安装1.8.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.