1
votes

I have used Rest Assured for Rest Automation using XML body and XML Response.

I have also used Robot framework for web UI automation using selenium2Library.

But now my requirement is to do Rest Automation using robot.

I came across HttpLibrary but it does not give me an option to use XML body in the request and specify content-type and read Response XML.

I used XML library for parsing xml but that is also not helpful.

Can someone help me in setting this up with some example and best way of achieving this.

An early response will be highly appreciated.

Thanks a lot in advance.

Note I went to How to use REST library in Robot Framework? but this is again not helpful to me as I am not using JSON for body.

1

1 Answers

2
votes

You can use the Requests library, which is a keyword library built on top of the python requests library. With it, you can make all of the normal REST calls (GET, PUT, etc). The library doesn't really care if the inputs and outputs are JSON, XML, or anything else (though it does include a convenience function for converting the results to a JSON object).

It doesn't have any features specifically for XML, robot comes with an XML library built in, which you can use to manipulate the data.