1

I get script returns unexpected result error in selenium, after update v76

browser.FindElements(By.LinkText("TEST"));

unknown error: script returns unexpected result (Session info: chrome=76.0.3809.87)

yhackup
  • 189
  • 2
  • 15
  • Does you Selenium Chrome driver supports version of Chrome you have installed on your PC? – Lemm Aug 02 '19 at 15:37
  • 1
    might be a bug in latest chromedriver, there was this post reporting this, too: https://stackoverflow.com/questions/57315463/chromedriver-76-0-3809-68-is-throwing-exception-with-selectbyvisibletext-method – pcalkins Aug 02 '19 at 23:39
  • Lemm ;Google Chrome güncel durumda 76.0.3809.87 (Resmi Derleme) (64 bit) Sürümü – yhackup Aug 03 '19 at 06:19
  • this code also doesn't work //var teminatlist = browser.FindElements(By.XPath("//*[contains(@id, 'form:panel')]")); – yhackup Aug 03 '19 at 06:41
  • SelectElement also does not work , my apps are ruined – yhackup Aug 03 '19 at 06:51
  • https://github.com/SeleniumHQ/selenium/commit/005a942a5ce0a63a5917c3eb7386c02a2de8700b. Set useSpecCompliantProtocol to false and may be related to w3c default mode in New chrome driver – Rahul L Aug 03 '19 at 07:42
  • i will try tomorrow, thank you for the answer Rahul L – yhackup Aug 04 '19 at 11:55

1 Answers1

1

This work for me, i changed my code from:

select.selectByValue(value)

to:

public void selectOptionByValue(Select select, String value) {
    if (select == null || value == null) {
        return;
    }
    var options = select.getOptions();

    if (options == null) {
        return;
    }

    for (var option : options) {
        if (value.equals(option.getAttribute("value"))) {
            option.click();
            break;
        }
    }
}
Samuel
  • 11
  • 1