We are using Selenium 1.0.1 to test our web application. We use css and xpath selectors. The css selectors are usually more reliable and they work in both FireFox and IE. The problem we’re having is the contains function stopped working for us on February 24th. The day before in our code we added jquery to the page that is having the problem.
We’re not sure if it is that change that caused the problem or if there was some kind of browser update that day. The problem is in both IE and FireFox so I doubt it was that.
Here is the CSS selector we are using:
css=table#dashLayout_gauge0 option:contains(‘New Range’)
Before this would return the correct element. Now Selenium cannot find the element using this selector. If I re-write it using XPath I can get it working in FireFox, just not in IE.
Turns out it didn’t have to do with jQuery per se. It was more what we were doing with jQuery. We were changing the text of the options in certain cases using jQuery and that was causing the css selectors not to work.