java – org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少’value’

Sendkeys无法正常工作.请帮我解决这个问题..

WebElement username = driver.findElement(By.xpath("//*[@id='username']"));      
username.sendKeys("123456");

安慰:

Exception in thread "main" org.openqa.selenium.WebDriverException: unkNown error: call function result missing 'value'

  (Session info: chrome=65.0.3325.31)
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86) 
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds

Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'NEW-PC', ip: '192.168.0.103', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_161'

司机信息:

org.openqa.selenium.chrome.ChromeDriver

Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.33.506120 (e3e53437346286..., userDataDir: C:\Users\NEW\AppData\Local\...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setwindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpecteDalertBehavIoUr: , unhandledPromptBehavior: , version: 65.0.3325.31, webStorageEnabled: true}

解决方法:

我看到了同样的问题.只有在使用Chrome 65(目前:开发频道)时才会出现此问题. Chrome 64(稳定频道和测试版频道)一切正常.

事实证明我安装了一个旧的chromedriver.具体来说,我使用chrome = 65.0.3325.51,chromedriver = 2.29.461585.运行npm install -g chromedriver撞到chromedriver到2.35.528157,现在问题解决了.希望这可以帮助!

TL; DR:运行npm install -g chromedriver

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...