fill_in escapes name locators in selenium mode
Reported by tf | January 19th, 2009 @ 07:08 PM | in 0.5
At the moment SeleniumSession#fill_in escapes the field_identifier:
def fill_in(field_identifier, options)
locator = "webrat=#{Regexp.escape(field_identifier)}"
selenium.wait_for_element locator, 5
selenium.type(locator, "#{options[:with]}")
end
The webrat location strategy tries the id, name and label location strategy. But the name location strategy does not expect a regular expression. Thus common input names like 'post[title]' are turned into 'post\[title\]' and are not recognized.
The attached patch is incomplete because it removes Regexp.escape only at this one position, even though there are other places in the file where the same problem will come up. It is meant as a hint for people running into issues with this behaviour.
Comments and changes to this ticket
-
Bryan Helmkamp February 9th, 2009 @ 12:20 AM
- Milestone set to 0.5
Hey tf,
Thanks for the report. Our test coverage for Selenium support is very bad at the moment, so we're going to take some time to get that in place, and then we'll be tackling this issue, hopefully by 0.5
Cheers,
-Bryan
-
gaffo May 7th, 2009 @ 03:16 PM
- State changed from new to awaiting-patch
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.