X-Received: by 10.224.54.73 with SMTP id p9mr14728506qag.1.1374141964687; Thu, 18 Jul 2013 03:06:04 -0700 (PDT) X-Received: by 10.49.13.71 with SMTP id f7mr493822qec.31.1374141964671; Thu, 18 Jul 2013 03:06:04 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t19no1918741qam.0!news-out.google.com!dk8ni470qab.0!nntp.google.com!t19no2068611qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.software.testing Date: Thu, 18 Jul 2013 03:06:04 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=192.100.130.7; posting-account=nKzRkgoAAAB-0OEy7qsIi3oZ43_IrmXm NNTP-Posting-Host: 192.100.130.7 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <91e96dfd-6151-4aa9-8823-e5ccc18d8b14@googlegroups.com> Subject: Re: need REST API test automation harness/tool From: leonardaye@gmail.com Injection-Date: Thu, 18 Jul 2013 10:06:04 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.software.testing:308 On Monday, May 27, 2013 10:49:24 AM UTC+2, frank.s...@gmail.com wrote: > On Thursday, August 16, 2012 2:33:39 PM UTC+2, Asher Vilensky wrote: >=20 > > Does anybody know of a tool to automate REST API testing? Let me give = a brief example of what I'm looking for. Right now I'm using both Poster (= FireFox add-on) or curl to do something like this: >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > Post: http://host:8080/// >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > Content to send (json): >=20 > >=20 >=20 > > { >=20 > >=20 >=20 > > "Name":"Asher-1", >=20 > >=20 >=20 > > "Address1":"some St", >=20 > >=20 >=20 > > "City":"some city", >=20 > >=20 >=20 > > "Zipcode":"00000", >=20 > >=20 >=20 > > "ContactPhone":"11231231234" >=20 > >=20 >=20 > > } >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > I'm doing this manually. What I'd like to do is automate the above wit= h different parameters and different json's. Also, I have many different A= PI's to test. So the question is if anybody knows of an automated test too= l that can do this. I'm already familiar with things like Selenium and oth= er GUI-based tools. I'm NOT looking for that. >=20 > >=20 >=20 > > Thanks. >=20 >=20 >=20 > What we've done is to write the tests in Python using the requests module= , nosetest for the test runner and GNU parallel to run tests in parallel fr= om a Jenkins job. We have a handful of helper methods which deal with authe= ntication and also extended the nosetest asserts to handled additional case= s (e.g. StringInDictNotEmpty). Pythons' default values on methods are reall= y helping here. >=20 >=20 >=20 > The code is simple and easy to maintain. It gives you full control on the= error reporting and you can make writing the tests as simple as you can by= adding more helper methods. You can also write lots of very simple and ver= y complex tests in the same framework, e.g. tests that need to create entri= es, wait 5 seconds, check 3 other systems and so forth. PyCharm from JetBra= ins is an invaluable tool for debugging the tests for us. >=20 Hi Frank I'm looking for a way to tests REST APIs, using Python as well and I'm intr= igued by your solution. Can you shed some more light on the subject? Altern= ately, you can send me email directly to leonardaye @ gmail dot com. Thanks =20