If you can reproduce the problem in a simple HTML page, you should definitely submit a bug report.
Looking at the source code, SelectByText
does this first:
FindElements(By.XPath(".//option[normalize-space(.) = " + EscapeQuotes(text) + "]"))
and if he finds nothing, he does the following:
string substringWithoutSpace = GetLongestSubstringWithoutSpace(text); FindElements(By.XPath(".//option[contains(., " + EscapeQuotes(substringWithoutSpace) + ")]"))
Therefore, theoretically, this should work. You can also play with XPath yourself and see if you can make it work in your case.
source share