Method: Capybara::Session#attach_file

Defined in:
lib/capybara/session.rb

#attach_file(locator, path) ⇒ Object



96
97
98
99
# File 'lib/capybara/session.rb', line 96

def attach_file(locator, path)
  msg = "cannot attach file, no file field with id, name, or label '#{locator}' found"
  locate(:xpath, XPath.file_field(locator), msg).set(path)
end