Java+selenium运行报错,可以打开浏览器但无法输入值


org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
  (Session info: chrome=71.0.3578.98)
  (Driver info: chromedriver=2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b),platform=Mac OS X 10.14.1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 50 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'chenwenyandeMacBook-Pro.local', ip: 'fe80:0:0:0:806:b25d:38f4:665b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.1', java.version: '11.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b), userDataDir=/var/folders/pn/zw1h30kn7gx1ddt3ps6qnjl40000gn/T/.org.chromium.Chromium.YJxsDs}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=71.0.3578.98, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: 93b83ec7799e69f91f2090633aaaf7a2

信息中说chromedriver的版本是2.31.488774,在谷歌浏览器设置中查看谷歌浏览器的版本是发现谷歌浏览器的版本是71,ChromeDriver与谷歌浏览器版本不对应,出现的问题。重新下载chromeDriver版本并配置后,编译运行IJ即可。

你可能感兴趣的:(selenium-Java)