Web Service API Automation

Overview  

In this article I am demonstrating Web Services test cases written in  SOAP UI Pro of Ready API . All the REST Web Services Health Check are implemented by calling the actuator of that Service. All WebServices are tested individually by sending JSON request. Pre Groovy Script are used to set the Environment and Test Case Name. Data Source fetches Test Case details from Oracle database and Post Groovy Script provides output report and assertion check and Data Sink stores the results in the Database.

Implementation Steps in Figure

Below are the screen dumps of an API service (named as Account Service) automation steps. Figure 1-6: Test Suit: Regression-Account Service and Test: ACCS_SEARCH_COST_CENTER and Test Steps of the Test.

Please note, a  few section of these images are rubbed out intentionally to keep private project information confidential.

Fig.1 Test Case

          Fig. 2 Test Step-1

 

Fig. 3 Test Step-2

   Fig. 4 Test Step-3

 

Fig. 5 Test Step-4

 

Fig. 6 Test Step-5

 

Integration with Web-based Automation Framework

SoapUI Pro test have been integrated with my web-based automation application. The WebService test cases are triggered from the automation web app.

Fig. 7 below executeSoapUITest method (reads properties file, constructs testrunner command and executes command via FileWriter and ProcessBuilder objects)

Fig. 7 executeSoapUITest

Now I briefly describe the user-workflow of this Web Services Test Automation via my Web-based Automation app.

As shown in Fig.8 to Fig. 11, user navigates through Web Services Test Automation link from the Automation app

Fig. 8 

After clicking on Web Services Regression Testing ->QA, following page (Fig. 9) is displayed

Fig. 9

Select Account Service as shown in the drop down (Fig. 10)

Fig. 10

Following function in the Controller has been in action (Fig. 11)

Fig. 11

getWsOperlist from wstestingService  has been called (Fig. 12)

Fig. 12

The segment of the front-end page (Fig. 13)

Fig. 13

Front-end UI to execute test cases (Fig. 14)

Fig. 14

tcExecutews is being called after clicking on the small green arrow icon (Fig. 15)

Fig. 15

JS to communicate with controller to execute web service test case (Fig. 16 and Fig. 17)

Fig. 16

Fig. 17

teExecuteWs function from Web Service Test Service Implementation (WsTestingServiceImpl.java) package (Fig. 18)

Fig. 18

Finally this workflow triggers Ready API/SoapUI Pro from command line after reading predefined values from the properties file. Ready API/SoapUI Pro is triggered by running a process after creating a file object with the testrunner command and creating the process/process builder object with the file  (Fig. 7)

Note :This is just brief technical note, please email me your opinion or  if you seek further explanation for any section discussed here , thanks