Jonatan Sporn


50 Experience
0 Lessons Completed
0 Questions Solved


Posted in How I can upload some file on my automation Rails

Hi everyone, I need your help if is possible, on a tecnical doubt I have on my automation, I wrote the code below and the browser opened the window to choose the file I wants to upload:

find(:xpath, '//span[@id="page:idFormUpload:j_id138:0:reRenderUploadRow"]').click

But when I use the code below the automation get a error, the path of the file is "C:\Users\jsporn\Pictures\imagemTeste_robo.png", I donĀ“t know if the sintax of this command are right or not, can anyone help me?

attach_file Rails.root.join("file",'C:\Users\jsporn\Pictures\imagemTeste_robo.png')

Or this code below:

attach_file("attachments", 'C:/hughes/imagem_robo_CPF/imagemTeste_robo.png')


logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.