attach_file not defined in Selenium mode
Reported by Nicklas Ramhöj | April 24th, 2009 @ 05:01 AM
Then I attach the file at "/path/to/file.jpg" to "Picture:"
with the step:
When /^I attach the file at "([^\"]*)" to "([^\"]*)"$/ do |path,
field|
attach_file(field, path) end
Generates:
undefined method attach_file' for
#<Webrat::SeleniumSession:0x2f98b50> (NoMethodError)
(eval):2:in
attach_file'
./features/step_definitions/webrat_steps.rb:90:in /^I attach
the file at "([^\"]*)" to "([^\"]*)"$/'
features/create_content_boxes.feature:21:in
When try to add a
"picture" box'
Comments and changes to this ticket
-
gaffo May 10th, 2009 @ 09:36 PM
- Tag changed from attach_file, selenium to attach_file, selenium, verify
- State changed from new to open
-
ian (at ianduggan) May 26th, 2009 @ 09:33 PM
I created a patch for this. It only works with "*chrome" as the browser. There are other tricks for turning down the firefox permissions, but just using chrome is probably easiest.
https://webrat.lighthouseapp.com/projects/10503/tickets/251-patch-i...
-
gaffo May 27th, 2009 @ 12:25 PM
Ian added this commit. It works for chrome as he says.
http://github.com/ijcd/webrat/commit/d79a2920fb17b59e88673d5245c2fc...Would definitely like to see some specs and integration tests for this.
Also this only works with chrome so I have no easy way to verify it (linux only).
-
ian (at ianduggan) May 27th, 2009 @ 12:46 PM
Sorry, I should have been clearer about the browser it works with. It works with firefox when you start using:
config.selenium_browser_key = "*chrome"
I have not tested with Google Chrome.
I will see about adding spec/integration tests, though I'm not sure how to deal w/ warning people on non-supporting browsers. Ideas?
-
gaffo May 27th, 2009 @ 02:03 PM
- State changed from open to awaiting-patch
warnings should look like however the deprecation is outputting.
So to use firefox you do
config.selenium_browser_key = "*chrome"That seems a bit odd.
-
ian (at ianduggan) May 28th, 2009 @ 08:10 PM
Yeah, the "*chrome" stuff causes selenium to use a firefox with reduce permission restrictions. I think it's related to the chrome:// urls or so, I'm not sure. It predated Google Chrome.
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.
People watching this ticket
Tags
Referenced by
-
251 [PATCH] Implement attach_file for webrat/selenium Linky: https://webrat.lighthouseapp.com/projects/10503-we...