finspin
finspin

Reputation: 4061

How to use REST library in Robot Framework?

Does anybody know how to use the REST Library for Robot Framework? The library is available here http://code.google.com/p/robotframework-restlibrary/source/browse/trunk/RestLibrary.py. It seems like there is no documentation available.

I tried something like this in Robot Framework but there is no response coming back from the request:

REST Test Case
    Get    https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1331161200&sensor=true
    Response    test

Any ideas how to use this library?

Upvotes: 9

Views: 42759

Answers (5)

ravthiru
ravthiru

Reputation: 9633

Might be useful for others, another lib https://pypi.org/project/RESTinstance/, for testing RESTful JSON APIs

Upvotes: 0

José Andias
José Andias

Reputation: 1974

REST Library for Robot Framework is not developed since 2009 (see changes).

Robot Framework official page references several HTTP level testing libraries, as for example:

  • robotframework-requests - Development is active and uses Requests HTTP python library.

    Example Usage:

    Grab Avatar Url
             Create Session    github    https://api.github.com     
      ${resp}=
        ...  Get Request       github    /users/jandias
             Should Be Equal As Strings
               ...             ${resp.status_code}  200     
             Dictionary Should Contain Key
               ...             ${resp.json()}       avatar_url
    
  • robotframework-httplibrary - Uses WebTest (with livetest) python library...

Upvotes: 8

Rahul Tiwari
Rahul Tiwari

Reputation: 59

use 'requests' library. In Your RIDE tool, Open 'Library' & enter 'requests' and save. Execute your test case.Hopefully it will work for you

Upvotes: -1

finspin
finspin

Reputation: 4061

I found another library which can do http calls and even parse json. Plus it's well documented http://peritus.github.com/robotframework-httplibrary/HttpLibrary.html.

Upvotes: 8

janne
janne

Reputation: 1017

That library seems to be poorly documented. Perhaps you should take a look at https://github.com/bulkan/robotframework-requests, which seems to be documented and maintained.

Upvotes: 14

Related Questions