selenium - ChromeDriver 76.0.3809.68 使用 SelectByVisibleText 方法 : Script returns unexpected result 抛出异常

标签 selenium selenium-chromedriver

我已将 selenium chromedriver 更新为 76.0.3809.68 并且现有测试开始失败并显示新的 Select(webElement).selectByVisibleText(value) 失败并出现以下异常

org.openqa.selenium.WebDriverException: unknown error: script returns unexpected result
  (Session info: chrome=76.0.3809.87)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'VARGHESEV10', ip: '10.13.36.28', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: com.prahs.framework.PRAWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 76.0.3809.87, chrome: {chromedriverVersion: 76.0.3809.68 (420c9498db8ce..., userDataDir: C:\Users\swqatest\AppData\L...}, goog:chromeOptions: {debuggerAddress: localhost:15612}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: cfd7ddc498272f40f9b62c43f67...}
Session ID: cfd7ddc498272f40f9b62c43f6742060
*** Element info: {Using=xpath, value=.//option[normalize-space(.) = "Test_Auto_Pv_243399_RAJ"]}


protected void selectOption(String field, WebElement selectElement, String value) {
    log.info(ReportUtils.formatAction("Select ", field, value));
    Select select = new Select(selectElement);
    select.selectByVisibleText(value);
}

最佳答案

我有同样的问题,但在降级驱动程序版本后工作正常:Chrome 是 76 (76.0.3809.100),驱动程序是 75 (75.0.3770.140)

关于selenium - ChromeDriver 76.0.3809.68 使用 SelectByVisibleText 方法 : Script returns unexpected result 抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57315463/

相关文章:

selenium - 面临 Safari 5 和 Selenium-WebDriver 的问题

java - Selenium 使用 xpath 查找元素并根据父类限制搜索

Python Selenium 打印另存为 PDF 等待文件名输入

selenium - 适用于 Mac M1 的 Chromedriver 107

node.js - 在 Mac OS : "Connection refused! Is selenium server started?" 上使用 Nightwatchjs 在 Chrome 中启动测试

python - 使用 selenium python 验证 POST 请求是否成功

selenium - 如何将 Selenium TouchActions 与 RemoteWebDriver 结合使用

python - 不知道如何无限循环这个

selenium - docker run -v bindmount 失败

Python在Linux下下载文件-如何不替换同名文件?