9

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?

2

5 Answers 5

14

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.

Sign up to request clarification or add additional context in comments.

Comments

8

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.

Comments

8

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...

2 Comments

When the above code is run, there is an error coming saying No keyword with name 'Create Session' found.
@Rao: That seems to mean your robot is not identifying Create Session keyword. Notice the example is under robotframework-requests library usage and that it is not a full test suite. That Create Session keyword is from this library. When using (not builtin) libraries under Robot you must declare it. I must guess that you probably skipped/forgot it. There are multiple ways of doing that, including in other robot files.
0

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

Comments

-1

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

1 Comment

This does not answers the question, neither you provided descriptive answer, you could have provided your suggestion in comments not in answers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.