Browse and Upload the file in Cucumber & Capybara.
My Code in UI View:
<input type="file" name="multipartFile">
Browse Option:>
Then(/^I upload the file $/) do
path = File.expand_path("a.txt")
puts File.expand_path("a.txt")
puts path
attach_file('multipartFile', "C:\\Desktop\\a.txt")
end
Hope this script will be more useful.... Whenever you try to upload the files....
Use the below lines and upload the file. Use your scripting idea and share it......
No comments:
Post a Comment