Attach A File With Capybara
Last updated
Was this helpful?
Last updated
Was this helpful?
There are two ways to attach a file with . The more conventional way is with the method.
Assuming there is a form with a file input similar to the following:
The first argument to attach_file
is a locator which refers to the name
attribute on the input
tag.
If for some reason there is no name
attribute on the input
tag, the file can be attached with a standard find
and set
.