Your approach of using xpath can work. The problem is the syntax errors in the xpath selector. It should be:
"//select[@id='t_id9' or @id='t_id7']"
Note:
- The start should be a
//
rather than a\
- Using
or
is case-sensitive; it has to be lower case - There was also a missing closing
'
for the first id attribute
Personally, I find css and xpath selectors harder to use. I would go with the id locator with a regex. The following gives the same results, but some will find it easier to read.
select_list(:selectionSpecial, :id => /^t_id(7|9)$/)