I have a dropdown which structure is this one:
Now, I want to use Selenium Webdriver to select the last option by text (I cannot rely on the option being the last one actually).
Trying this:
var text = " undersida";
var option = new SelectElement(browser.FindElement(By
.CssSelector("#Menu_ParentMenuID"))).SelectByText(text);
gives me a NoSuchElementException.
Why?
Here is the list of values I have tried for text
:
" undersida" " undersida" "undersida"
What about this?