What\'s the correct XPath syntax to check if an option
element is currently selected, or just to get the selected option
The problem could be the "
(double quotes).
//select/option[@selected='selected']
- Will match the selected option, i am using this successfully.
//select/option[@selected='selected' and @value='specific value']
- Will only match the selected option if it has a 'specific value', i'm also using this.
If you are still having trouble, it could be an entirely different problem, perhaps there is no option node. I hope this helps.