Selenium fill_in raises Selenium exception when driving Internet Explorer
Reported by T.J. VanSlyke | March 31st, 2009 @ 06:42 PM
We have a large suite of Cucumber tests driven by Webrat. Until
now, we've been running them within a Firefox Selenium environment.
When we attempted to run the suite through Internet Explorer, we
found that several (but not all) calls to
raised the following Selenium error:
OR: Selenium failure. Please report to the Selenium Users forum at http://forums.openqa.org, with error details from the log window. The error message is: Object doesn't support this property or method (Selenium::CommandError) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:56:in `timeout' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:76:in `timeout' (eval):2:in `fill_in' ./features/step_definitions/webrat_steps.rb:15:in `/^I fill in "(.*)" with "(.*)"$/'
Our interim solution was to replace the steps calling
fill_in with explicit
calls. Looking at the implementation of
SeleniumSession#fill_in, I notice it is pushing the
"webrat=field_identifier" to the Selenium
server. I'm unaware of what Selenium knows about Webrat, so any
information toward that end might help in resolving this.
Comments and changes to this ticket
I've never ran Selenium in IE before, so it's hard to say if this is a Webrat bug, or a Selenium+IE bug.
We have an untested fix for this.
There is a good amount of logic within the Webrat Selenium matchers. We probably should unit test them using Screw Unit (or equivalent) and have Selenium integration tests in an example project.
I was just wondering whether it might be a good idea to use JQuery as a locator strategy instead of how they are currently defined in webrat.js. This probably solves browser compatibility issues and might be even faster. I tried to accomplish this without changing the selenium.jar by placing the jquery code in selenium_extensions.js, but for some reason I got a parse error (I guess I didn't copy-paste the jquery code properly).
This blogpost inspired me to try it.
- Assigned user set to gaffo
Is there any progress with this?
The fill_in method uses the webrat locator (0.5.3), only looking for elements with id,name,label matching the locator value, it needs to work with the label.js and the webrat.js locators with some sort of conditional here similar to that of the field_element method of Webrat::Element::Label
- Milestone order changed from 0 to 0