File Upload Attachment Robot frame Work

624 views
Skip to first unread message

cha...@mahathiinfotech.com

unread,
Sep 1, 2017, 9:45:08 AM9/1/17
to robotframe...@googlegroups.com
Hi Friends

     I am using robot frame work .I need to  upload  a attachment in robot frame work. But i m struggling to get file path from local machine. Please give a example And Explain it.

Bryan Oakley

unread,
Sep 1, 2017, 10:19:42 AM9/1/17
to cha...@mahathiinfotech.com, robotframework-users
What does "struggling to get file path" mean? Please show what you've tried.

On Fri, Sep 1, 2017 at 8:35 AM, <cha...@mahathiinfotech.com> wrote:
Hi Friends

     I am using robot frame work .I need to  upload  a attachment in robot frame work. But i m struggling to get file path from local machine. Please give a example And Explain it.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Tatu Aalto

unread,
Sep 20, 2017, 2:23:26 PM9/20/17
to ian.g...@taina.tech, robotframework-users
Ugh

It's wrong to say same thing, because we don't know what the problem actually is. But your problem lies improper escaping: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#escaping as can be seen from the error message



-Tatu
Send from my mobile

On Sep 20, 2017 21:11, "Ian Garcia" <ian.g...@taina.tech> wrote:
Hi,

I'm experiencing a similar issue. I always get an error when trying to attach a PDF in a form. Any ideas?








On Friday, September 1, 2017 at 3:19:42 PM UTC+1, Bryan Oakley wrote:
What does "struggling to get file path" mean? Please show what you've tried.
On Fri, Sep 1, 2017 at 8:35 AM, <cha...@mahathiinfotech.com> wrote:
Hi Friends

     I am using robot frame work .I need to  upload  a attachment in robot frame work. But i m struggling to get file path from local machine. Please give a example And Explain it.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Message has been deleted

Bryan Oakley

unread,
Sep 20, 2017, 10:48:54 PM9/20/17
to ian.g...@taina.tech, robotframework-users
Robot treats the backslash as an escape character. SO, \U becomes just U, \A becomes A, and so on. If you look closely at the error message you'll see it's complaining about a path that doesn't have any of the backslashes, because robot removed them. 

You need to either double up (to "escape" the "escape"), or use forward slashes. There's a third choice which is to use ${/} but I think that makes file paths hard to read. 

Choose File  //input[@id="pdf-form-file"]  C:\\Users\\Admin\\Desktop\\Automation\\Test-Auto-Data-1.pdf
Choose File  //input[@id="pdf-form-file"]  C:/Users/Admin/Desktop/Automation/Test-Auto-Data-1.pdf
Choose File  //input[@id="pdf-form-file"]  C:${/}Users${/}Admin${/}Desktop${/}Automation${/}Test-Auto-Data-1.pdf


On Wed, Sep 20, 2017 at 4:10 PM, Ian Garcia <ian.g...@taina.tech> wrote:
Hi,

Thanks for your reply. I'm not sure I understand what you mean. I'm relatively new to this so please pardon my ignorance. Basically I wanted to upload a pdf form using the choose file keyword. I always get an error saying that the file is not in the system which it is. I placed it in a folder on my desktop.

I'm using this code: Choose File //input[@id="pdf-form-file"] C:\Users\Admin\Desktop\Automation\Test-Auto-Data-1.pdf


& I get an error. Please help.

Thanks

ian
Reply all
Reply to author
Forward
Message has been deleted
0 new messages