All threads / How I can upload some file on my automation Rails
Ask A Question


You’re not receiving notifications from this thread.

How I can upload some file on my automation Rails

Jonatan Sporn asked in Ruby

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')


Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    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.