应该是由于鼠标焦点没有定位到相应元素
driver.find_element_by_xpath('//input[@type="password"]').click()
driver.find_element_by_xpath('//input[@type="password"]').clear()
driver.find_element_by_xpath('//input[@type="password"]').send_keys(newpass)
可以先执行 click定位到相应元素
本文介绍了一种在自动化测试中解决鼠标焦点未正确定位到密码输入框的方法,通过使用Selenium WebDriver的find_element_by_xpath方法,先点击元素再进行清除和输入操作。
635

被折叠的 条评论
为什么被折叠?



