Using TestComplete to Drive a Manual API Tool

Customer Guest Blog

Michael Larsen
Quality Assurance Engineer

Sometimes the best way to get automation to happen is to start simple. That's advice we hear frequently, right? The question often comes down to "how simple?" When is the task so simple that it doesn't make sense to automate it vs. when it is something so obvious that you couldn't fathom not doing it this way?

I had that experience yesterday afternoon. I was testing a simple API tool that allows the user to set certain parameters, load information from an XML file, and then submit the method and view the results.

Normally, these would be simple little things to do, and as one offs, they're easy enough. What about when you need to create 200 records through the API, and the tool only has a single submit feature? Well, you could just go through the steps to submit them one at a time... or you could fire up an application that does the work for you.

In this case, I thought "hmmm, how long would it take for me to put together a quick and dirty sequence to help me do this?"

With TestComplete, the answer was "about 60 seconds." Here's how:

  • Using the keyword interface, I clicked "record test."
  • I entered the values I needed into a few text boxes and selected the options necessary to complete the commands, browse for the file necessary, and post it to the API.
  • I then stopped recording.


Having confirmed that I had the basics of the test and nothing else (no geometry parameters or any of the things that tend to make tests brittle), I created a for loop to duplicate the actions 100 times, associated the commands with the loop, and ran the test to simulate real time interaction (because the test is not just making the API calls, but testing the interface itself to do it). Net result, lots of entries made, without me having to go crazy from the manual tedium.

TestComplete gets a lot of press for its ability to do many complex things and cover a wide range of scenarios. For me, it's the simple, but time consuming, things that it can help automate that make me smile :).

Check out Mike's blog.

If you are interested in publishing a guest blog, contact SmartBear Community Manager, Alex Forbes.


Close

By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox