Forum Discussion
Currently I'm building up system to test our REST Api's just using requests library in python.
This is success and more flexible than SOAP UI (for me)
can add libraries like this
only down side is it's functional testing only
let me know if need more info
I just use an ServerXMLHTTP object. (https://msdn.microsoft.com/en-us/library/ms766431(v=vs.85).aspx)
This is just for sending to a RESTful API during tests. There are limits to what you can do and check with it. But if you just need to drive things via an API and interpret the responses, it does the job fine.
NisHera - I've been using the Requests library for Python in something outside of TestComplete and it is indeed a very nice HTTP handler. Makes things VERY simple to use. Only drawback I've found is that by making everything so simple, it sometimes goes a little too far. If a request fails, it seems to automatically try again - which I don't always want. And it can hit the usual problem in Python where a connection can get "stuck" open (although his happens a LOT more using urllib2). But I wrap the whole thing in an Eventlet to stop a connection getting stuck permanently. That, and the default logging level for the library is set way too high. But that's easy to turn down. (Just make sure you also set the same level for the urllib3 library - which it uses - as it's that that generates a lot of the unwanted "info" level log messages.)
Related Content
- 2 years ago
Recent Discussions
- 4 days ago
- 4 days ago