google-chrome - Selenium WebDriverException : unknown error: call function result missing 'value' while calling sendkeys method

标签 google-chrome selenium selenium-webdriver webdriver selenium-chromedriver

当尝试在 selenium webdriver 中调用 Sendkeys 方法时,它显示以下错误:

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'  
 (Session info: chrome=65.0.3325.146)  
 (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64) (WARNING: The server did not provide any stacktrace information)

Selenium Jar 版本:3.10.0

最佳答案

错误说明了一切:

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64) 

您的主要问题是您正在使用的二进制文件之间的版本兼容性,如下所示:

  • 您正在使用 chromedriver=2.27
  • chromedriver=2.27 的发行说明明确提到以下内容:

Supports Chrome v54-56

Supports Chrome v65-66

  • 您的 Selenium 客户端版本是 3.10.0
  • 我们未知您的JDK版本

因此,ChromeDriver 版本 (v2.27) 和 Chrome 浏览器 版本 (v65.0) 之间存在明显不匹配

解决方案

  • 将 ChromeDriver 升级至 ChromeDriver v2.36级别。
  • Chrome 版本保持在 Chrome v65.x 级别。 (as per ChromeDriver v2.36 release notes)
  • 清理您的项目工作空间并仅使用所需的依赖项重建您的项目。
  • 使用CCleaner工具可以清除执行测试套件之前和之后的所有操作系统杂务。
  • 如果您的基本 Chrome 版本太旧,请通过 Revo Uninstaller 卸载它并安装 Chrome 的最新 GA 和发布版本。
  • 执行您的@Test

关于google-chrome - Selenium WebDriverException : unknown error: call function result missing 'value' while calling sendkeys method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49668534/

相关文章:

javascript - 为什么 document.elementFromPoint 为可见文档之外的元素返回 null

javascript - Chrome 扩展程序徽章文本 - ✔ 呈现为 “”

javascript - 静音网::ERR_CONNECTION_REFUSED

java - 方法完成后故意使 JUnit 测试失败

python - ElementNotInteractableException : Message: Element is not reachable by keyboard error sending text to input field using Selenium and Python

android - Chrome 远程调试 - "Pending Authentication"

python - 当元素为 data-testid 时如何处理弹出窗口 "Accepting all cookies"- 在 Python 中使用 Selenium

java - 如何在不使用 selenium/webdriver 方法的情况下切换到新窗口

javascript - 我们可以将正则表达式放在 Protractor 的 exports.config 的 seleniumServerJar 中吗

testing - 使用不同输入文件的数据驱动自动化测试