how to run Curl command using Robot Framework process library

963 views
Skip to first unread message

Abhishek Ganotra

unread,
Dec 5, 2018, 1:19:10 AM12/5/18
to robotframework-users
could someone help me run this from robotframework. 

Seems like I am able to run the same curl command properly from command line. however when I am running this using run process keywords its not uploading the file at the mentioned URL

${Login}= Run Process curl -H "Content-Type: multipart/form-data" -u username:password -F "file=@output.xml"  http://Myserver/rest/raven/1.0/import/execution/robot?testExecKey=EDTEE-652 shell=True alias=Login


Pekka Klärck

unread,
Dec 5, 2018, 1:45:32 AM12/5/18
to abhishek...@gmail.com, robotframework-users
Hi,

It's impossible to help if you don't provide any more information.
Does the keyword succeed or fail? If it succeeds, what is written to
the process stdout/stderr?

Also, it probably would be a better idea to implement a keyword in
Python for uploading files. Shouldn't be too complicated.

Cheers,
.peke
ke 5. jouluk. 2018 klo 8.19 Abhishek Ganotra
(abhishek...@gmail.com) kirjoitti:
>
> could someone help me run this from robotframework.
>
> Seems like I am able to run the same curl command properly from command line. however when I am running this using run process keywords its not uploading the file at the mentioned URL
>
> ${Login}= Run Process curl -H "Content-Type: multipart/form-data" -u username:password -F "file=@output.xml" http://Myserver/rest/raven/1.0/import/execution/robot?testExecKey=EDTEE-652 shell=True alias=Login
>
>
> --
> 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-u...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Jerry Schneider

unread,
Dec 5, 2018, 9:40:45 AM12/5/18
to robotframe...@googlegroups.com
Instead of using the Run Process keyword, have you thought about trying the Operating System library Run keyword?

Here is code I used for another place:
    ${output} =    Run    curl -s "http://${SvcsHost}:${METAPort}/admin/apps/categories?user=${AdminUser}&email=${AdminEMail}" | python -mjson.tool
    Log    ${output}

Now I am preferring to use the RequestsLibrary for testing RESTful service endpoints.

jer
--
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-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

-- 
http://www.linkedin.com/in/jerryschneider
Linux registered user #475536
Ubuntu registered user #28583

I robot

unread,
Dec 6, 2018, 4:09:29 PM12/6/18
to robotframework-users
Hello, did you forget cwd=<your current working directory, where to find @ooutput.xml> at the end of your command ?
Reply all
Reply to author
Forward
0 new messages