我正在尝试自动化我的混合应用程序,我需要在输入字段中输入详细信息,但在我的情况下使用send_keys("Text value")
不起作用。我得到了例外
selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value'
def test_login(self):
self.driver.implicitly_wait(15)
loginemail = self.driver.find_element_by_id("userId")
loginpass = self.driver.find_element_by_id("userPassword")
email = loginemail.find_element_by_xpath("//*[@id='userId']/input")
email.click()
email.send_keys("xxxxlabs.com")
以下是完整的错误消息:
File "/home/martial/PycharmProjects/pytestAndroid/test_login_android.py", line 45, in test_login
email.send_keys("xxxxlabs.com")
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 347, in send_keys
self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': keys_to_typing(value)})
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 491, in _execute
return self._parent.execute(command, params)
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 238, in execute
self.error_handler.check_response(response)
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 29, in check_response
raise wde
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File "/home/martial/PycharmProjects/pytestAndroid/venv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value'
答案 0 :(得分:3)
使用chromedriver v2.33 时出现此错误 - 当我更新为 v2.36 时,错误消失了(这是使用chromedriver_mac64在Mac上)。 zip文件从https://sites.google.com/a/chromium.org/chromedriver/downloads)
下载答案 1 :(得分:0)
问题:org.openqa.selenium.webdriverexception:未知错误:调用函数结果缺少'value'。请查看以下步骤以解决此类错误。
回答:更新浏览器版本。请按照以下步骤获取最新版本的浏览器。
谢谢:) !!