Performing Regression Tests Using Insomnia Core

Objectives

After completing this lesson, you will be able to:
  • Call SAP Convergent Charging Web Services with Insomnia Core.
  • Use Insomnia Core for regression testing of price models.

Calling SAP Convergent Charging Web Services with Insomnia Core

Business Example

As a product modeler, you want to test your new price model implemented in CHP_##_CLOUD_SERVICE_V01 with description "Charge Plan Usages" which includes three usage charges.

Insomnia Core

Insomnia Core is an open-source web service testing application, which could be used to automate the setup of master data in SAP Convergent Charging and simulate the charging process for a charge plan to perform price model testing using the Soap-based web services SAP Convergent Charging offers. The web services mentioned above will be imported into Insomnia Core and executed from there.

The main window of insomnia core is divided into three major areas of interest:

  1. The request list area on the left
  2. The request area in the middle
  3. The response area to the right
The figure shows the screen areas of Insomnia Core, as described above.

Each entry in the request list represents a predefined service request that can be sent to SAP Convergent Charging. When you choose an entry in the request list, the request area will update and reflect the message payload of that request. Once a request has been sent and a response has been received, it is displayed in the response area on the right of the screen.

All requests in the list are assigned to a workspace, which is called My Workspace. You can create more workspaces if you like.

The service requests make use of variables. The values of these variables are stored in what is called an "environment" in Insomnia Core. Variables are replaced with their associated values when the request is sent. They allow each participant to use her/his own group number where applicable when executing the services. You can access the environment by pressing CTRL + E when the Insomnia Core application is in focus.

Environments are organized in a hierarchy. All variables defined for this course are placed in the so called Base Environment, which is accessible across all workspaces of Insomnia Core. The variables are defined in the json format.

Using Insomnia Core for Regression Testing of Price Models

The figure shows an example, of how variables are used in an environment.

Insomnia Core allows you to switch between environments to use for your selected workspace, so that your services are executed with different values depending on the environment you selected. This way you can store test data for your dev systems in one environment and test data for your test system in another one, and switch between them with ease. It also allows you to save the hostname and ports for your services inside a variable, so that the correct system is called when you switch environments. This was also done for this course.

To execute a set of services you need to select the service request from the list of requests on the left, and then choose Send. Insomnia Core will then resolve any variables you have referred to into their respective values and send the request message to the target system. Once the response arrives it is displayed in the response area for you to examine.

Test the New Price Model

Business Scenario

As a product modeler, you want to test your new price model implemented in the charge plan CHP_##_CLOUD_SERVICE_V01 with the description "Charge Plan Usages" which includes three usage charges. You can use Insomnia Core the Convergent Charging web services to create test master data and your own price tables for price model testing.

Steps

  1. Start Insomnia Core.

    1. Before starting Insomnia Core for the first time, you need to install it. Choose Start in Windows, go to the folder Initialize Course and select Initialize BR235.vbs. This will start a script, which copies over some files to the N drive. When the script asks you whether you want to proceed, select Yes.

    2. When the script asks you whether you want to proceed, select Yes. When the "Finished!"message pops up select OK. The system will open the explorer for you. Go to the folder N:\BR235.

    3. Double-click on the file Insomnia.Core-2020.5.2.exe. Insomnia will install and start.

      Caution

      If Insomnia Core offers you to update, reject this message. Do not update the software!
    4. When you want to start Insomnia Core after the installation, choose Start:

      System screenshot
    5. Start typing Insomnia. Windows will display all elements it has found. The Insomnia Desktop App will be in the result list.

    6. Start the App.

      System screenshot
    7. Choose the result entry Insomnia to start Insomnia Core.

  2. Import the project and configure your group number.

    1. Ensure you have correctly started Insomnia Core. (See Step 1.)

    2. Once Insomnia has started choose My Workspace.

      A context menu displays.

    3. Choose Import/Export from the context menu.

      System screenshot
    4. Choose theData tab, then Import DataFrom File:

      System screenshot
    5. Select the file located at N:\BR235\Insomnia_Project.json and choose Import.

      The system will import the project to your workspace along with an environment containing a set of variables, that control your service requests.

    6. Hit Ctrl+ E on your keyboard to open the environment editor.

      The base environment displays. It already contains a set of variables formatted in json.

    7. Find the line, that says "participant_group" and replace the value ## with the group number given to you.

    8. Choose Done once you are finished.

  3. Execute the test.

    1. The project you have imported consists of a set of web service requests, which will do the following:

      • Create a subscriber account
      • Create an external account for that subscriber account
      • Maintain three mapping tables with price data
      • Refresh the rating instances
      • Create a contract using the chargeplan to test
      • Send Usage for that contract and receive the rating results
      • Load the data into Convergent Invoicing
      • Delete the contract
      • Delete the table with prices for CPU usage
      • Delete the subscriber account

      Each of the service requests must be executed manually and in sequence.

    2. To execute a service step, choose the respective entry on the left-hand menu. The request message associated with that step is displayed on the right. Select Send to execute the service. The response will be shown in the response window. For each service execution make sure the response doesn’t contain any errors before proceeding with the next service step.

      Once you have successfully executed all services in order, choose the step called Process CPU Consumption Data on the request list area. In the response area look for the element called "BIT_AMOUNT" and check the value assigned to it. It should read "60.00000".

  4. (optional): Instead of testing the template solution CHP_00_CLOUD_SERVICE_V01 test your own implementation CHP_##_CLOUD_SERVICE_V01 of the charge plan.

    1. With the Insomnia Core application started and in focus hit Ctrl+ E again to edit the environment.

    2. Search for an entry named solutionGroup. Change its assigned value from "00" to your group number. This will make all services use your chargeplan instead of the one which is part of the template solution. You can also change the value back to "00" again to let the services use the template solution again. Select Done once you are finished.

    3. Now execute all the service steps one by one again. After each step execution make sure it didn’t reply with an error. Once you have successfully executed all services in order, choose the step called Process CPU Consumption Data on the request list area. In the response area look for the element called "BIT_AMOUNT" and check the value assigned to it.

      Note

      This will only work if you spelled the chargeplan name exactly as you were asked to in previous exercises!

Log in to track your progress & complete quizzes