If you are reading this blog then most likely you are either exploring new ways of automating the SiteScope REST APIs or you are looking at enhancing the existing automation. If you are charged with building and supporting APIs in your group, you will be required to monitor these APIs at all times to ensure that there is continuous testing of these APIs during and after development. Additionally, the consumers of your APIs are most likely going to attempt to use it in different ways. Therefore, it is all the more important for you to include these as test cases and automate the API monitoring.
SiteScope REST APIs can be easily automated using the latest open source tool Karate developed by Intuit. It overcomes the short comings of the existing automation tools like Cucumber or Rest Assured and takes away the overhead of writing huge lines of code before you can start testing it.
This blog explains how to use Karate for automating any REST API call exposed by SiteScope.
Karate API Test Tool Setup
1. Set up Karate REST Test Project. Use the instructions documented in this blog: https://www.joecolantonio.com/2017/03/23/rest-test-tool-karate-api-testing/
2 . Use the basic-auth.js to configure the authentication for REST API. Following is an example of code snippet that I used.
3. Set up the configuration properties as required. karate-config.js file is the default configuration file that can be used for configuring the properties. Take a look at the code snippet that I used.
4. Write the feature file that includes all your test cases and scenarios. See the SiteScope API Reference Guide for parameters required by the SiteScope API calls.
SiteScope APIs test cases – Some examples
No prior knowledge required!
I started off with hardly any prior knowledge of Karate. And as you see, I was able to set up and start testing the SiteScope APIs. I was able to test a wide variety of complex validations using simple syntax as in the PUT and POST calls as shown in the preceding screen captures. SiteScope offers an exhaustive set of public APIs and having a tool that eases testing the APIs is a boon indeed for all the automation enthusiasts. Don’t you agree?
If you would like to learn more about Micro Focus SiteScope, start a free trial, or see a live demo please visit our online page at: https://software.microfocus.com/en-us/products/sitescope-application-monitoring/overview.
To read more about some cool features of SiteScope, visit our SiteScope Blogs and Videos Archive.
You can read up more details on Karate on https://github.com/intuit/karate#
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.