Created
November 4, 2013 20:30
-
-
Save abotalov/7308732 to your computer and use it in GitHub Desktop.
Attempt to reproduce issue from http://stackoverflow.com/q/19733271/841064
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
sleep 1 # Just to verify that file isn't chosen | |
sess.attach_file('file_upload', '/tmp/temp.txt') | |
sleep 1 # Just to verify that file is chosen | |
__END__ | |
<!doctype html> | |
<html> | |
<body> | |
<input type="file" name="file_upload"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment