there is skin-monobook class applied on body when monobook skin is used. Maybe instead of executing script you can do: WebElement body.getAttribute('class').contains('skin-monobook')?