描述:当我使用send_keys(“ xxx”)到输入框时,被告知
“ selenium.common.exceptions.InvalidElementStateException:消息:无法将元素设置为'15323423456'。您是否与正确的元素进行了交互?”
这是由什么引起的?这个插件太高还是太低?我的XPath没错所以我解决不了您想帮助我解决这个问题吗?谢谢
代码:
'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")
结果:
版本:
我知道是由于appium太高造成的。未安装并重新安装1.8.0