2

My company is working on API which is RESTful JSON Web API. So far, all my testing was done using Selenium WebDriver.

I was given a task to look for a tool that can help us automate the API tests(based on REST).

I am a selenium resource and have never worked on UFT and API testing.Since our client owns the license of HP,they would be happy to use UFT.After my findings,i liked restassured since it involves java and BDD framework.

Can you guys help me out here and point out some pros and cons of UFT and Restassured based on your experience. Every help will be much appreciated. Thanks!

-1

I'll like to point you to Karate which is also a BDD framework with some advantages over REST-assured. I would recommend you evaluate this tool as well.

Here is a detailed comparison document, that hopefully will be useful - as you may be able to use the same points to compare with UFT as well.

Disclaimer: I am the dev.

edit: I've been asked to summarize the contents of the link which is the comparison of Karate vs REST-assured, so here are the main points:

  • Karate is not Java and a plain-text syntax (Cucumber / Gherkin), it makes it easier for non-programmers to write tests, and you don't need to compile code
  • Data-Driven testing and Tags are built-in unlike REST-assured where you have to depend on something like TestNG
  • You can assert that all data context of a payload (JSON or XML) is as-expected in a single step. To me, this is the biggest reason why you should choose Karate. This is where you will spend most of your time if you are doing proper-testing of web-services
  • In Karate you can even extract chunks out of the response and update values by path and re-use them for future requests. Extracting values for use in future requests is actually quite complicated in REST-assured and there is no way to update a given payload.
  • Karate has built-in environment switching for e.g. dev | qe | pre-prod
  • Karate can execute tests in parallel. I leave it to readers to decide if REST-assured is comparable on this front, based on this discussion - and there are more links in the document I have linked to above.
  • Links tend be obsolete after some time. Can you please summarize its content here? – dzieciou Jul 5 '17 at 16:46
  • Parallel Execution of Tests: if works great with REST-assured. You just need to develop your tests in parallelism in mind, i.e., don't use global shared configuration. – dzieciou Jul 5 '17 at 16:52
  • @dzieciou I have edited the post. I disagree with your opinion on parallel testing with REST-assured, but I will let readers decide based on the facts. – Peter Thomas Jul 6 '17 at 2:46
  • I have been using REST-assured for at least 3 years in parallel tests. The discussion you mention lists precisely what case of parallelism in REST-assured doesn't work and also suggest a simple workaround: (quoting) "what would you propose in order to be able to run tests in parallel without specifying baseURL & port on each rest-assured invocation". I.e., the workaround is to include baseURL and port on each REST-assured invocation. Also, it would help readers choose between REST-assured and Karate if you provide not only pros, but also cons. – dzieciou Jul 6 '17 at 4:48
  • @dzieciou exactly, I'll let readers decide whether the "workaround" is reasonable or not. and yes the document linked contains the cons. – Peter Thomas Jul 7 '17 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.