Chromedriver 91. SelectByIndex fails with Cannot locate option with index

130 views
Skip to first unread message

Lars Johannesson

unread,
Jun 4, 2021, 6:49:05 AM6/4/21
to ChromeDriver Users

After updating to Chrome and Chromedriver version 91 all my tests using
OpenQA.Selenium.Support.UI.SelectElement.SelectByIndex started failing with  :

OpenQA.Selenium.NoSuchElementException : Cannot locate option with index: 0
   at OpenQA.Selenium.Support.UI.SelectElement.SelectByIndex(Int32 index)

Changing the test code to :
MySelectElement.Options[0].Click();
solved the problem.

The used driver was this version (for Windows)
91.0.4472.19

Lars Johannesson

unread,
Jun 4, 2021, 8:00:28 AM6/4/21
to ChromeDriver Users
The problem disappeared when upgrading the C# Selenium.Webdriver to latest version 3.141.0
Reply all
Reply to author
Forward
Message has been deleted
0 new messages