org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少“值”

2023-11-30

发送键不起作用。请帮我解决这个问题..

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

Console:

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 with chromedriver=2.29.461585。跑步npm install -g chromedriver将 chromedriver 升级到 2.35.528157,现在问题已解决。

TL;DR: run npm install -g chromedriver

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少“值” 的相关文章

随机推荐