Added an exception for selecting options on invalid elements

This should fix the failing test about ``selectOption``