Automated Testing System

I am trying to create an automated testing system for some of our internal web services (java) at work. Each service has a set of APIs (3-5), although this can be relatively easy to achieve, the problem is with some APIs that do not behave as pure functions, for example: something like persistX, it can store something in the database data and returns an exception in case of failure. There is no easy way to verify since there is no conclusion.

So I was wondering if this could be a little generalized, say, when testing the API, the user can provide a simple plug-in or script for some kind of structure that could confirm the check. This is just one idea that would be great if someone could tell me some of the best or any resources about the same.

thanks

+8
java frameworks testing automated-tests
source share
2 answers

I recommend the structure of the robot . This is a keyword-driven structure written in python. Because of this, you can run it in the JVM using jython, which means you can extend it with java code (or python, of course). I successfully used it to call the APIs, and then checked the result by looking at the database or querying the file system.

It also runs on the .NET platform, has a selenium module for front-end testing, a jenkins plugin, and several other tools. It is very extensible and flexible.

+6
source share

What you are looking at is a black box and white box testing app and tools that support both.

For web services that return the correct answer, you can perform a black box test by checking the data in the returned response. SoapUI is the best tool for this.

For APIs that do not behave as pure functions, you perform white windows by checking its side effects like saving, event generation, logging, etc. For this, you like programmable tools and SoapUI may or may not be the right option.

We work both in our work and after evaluating several tools / frameworks (SoapUI, RSSPec, Robotframework), I chose Spock . Why spock?

  • This allows you to write BDD style detection tests
  • We are a Java store and we want to use the same familiar language for automation, but with simplified syntactic sugar. And spock is all groovy.
  • Excellent Webdriver / Selenium 2 support (including PageFactory) with Geb
  • It is built on top of JUNIT, so all JUNIT plugins can be used (code coverage, hudson / jenkins integration, etc.).
  • Many webservice and XML DSL APIs (no need to work with XPATH for simple scripts)
  • Simplified setup (unlike robotframework, it does not require python, jython setup)

etc....

+4
source share

All Articles