I have updated the selenium chromedriver to 76.0.3809.68 and the existing tests started to fail with new Select(webElement).selectByVisibleText(value)
is failin
Not just selectByVisibleText
even selectByValue
was also throwing the same Exception
"org.openqa.selenium.WebDriverException: unknown error: script returns unexpected result".
I faced this issue with chrome v76. I upgraded the chrome version to 77 and tested with ChromeDriver 76 and 77 which works fine now.
I think the fix for this issue was released in chrome 76.0.3809.126, please check.
I was getting same issue but working as expected, after updating Chrome to Version 76.0.3809.87 and driver to latest
I also experienced this issue with ChromeDriver 76.0.3809.68 and Chrome 76.0.3809.100. It works with ChromeDriver 76.0.3809.126 and Chrome 76.0.3809.100.
Not really a fix but this is due to the fix made for issue 3084: Find Elements not working properly in ChromeDriver 76 when prototype.js 1.6.1 is used [Pri-2], select tags are not working. Just the presence of
prototype.js` is enough this to be failed. You can try the following to recreate
<html>
<head>
<title>test</title>
</head>
<body>
<select id="sample">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js" type="text/javascript"></script>
</body>
</html>
Error:
org.openqa.selenium.WebDriverException: unknown error: script returns unexpected result
(Session info: chrome=77.0.3865.75)
If you have the control of the application you can upgrade the version of prototype.js
.
I had the same issue, but working fine after downgrading Driver version: Chrome is 76 (76.0.3809.100) and Driver is 75 (75.0.3770.140)