Skip to content
DevTest Solutions - 8.0.1
Documentation powered by DocOps

Generate a REST Baseline

Last update January 28, 2015

Use the following procedure to generate a REST baseline from a set of transactions in the CAI database.

You can add parameterization to REST stateful baselines. When CAI detects common elements in the request and response, it adds a property and filter to the baseline. To configure this behavior, you specify one of the following levels:

  • Match on value only
  • Match on key and value

The request body must be in JSON format.

Assume that the request has the following URL and body:

GET http://myserver:8080/datamanagement/a/templates/4?user=admin

Request:{"name":"demo_02","applicationId":"3","new":true}

If you set the parameterization level to value only, CAI considers the following elements: a, templates, 4, admin, demo_02, and 3.

If you set the parameterization level to key and value, CAI considers the following elements: user/admin, name/demo_02, and applicationId/3.

In the URL, the first element after the server and port is ignored.

Boolean types are ignored.

Follow these steps:

  1. Add one or more REST transaction frames to the shelf.
  2. Open the shelf.
  3. Click Create Baseline.
  4. To change the default name, select the name and make your edits, then click save button to save.
  5. Click the plus sign that appears to the left of the name.

  6. If the creation mode fields are available, select an option:
    • Stateful

      Create a baseline that contains one or more test cases that apply to an entire conversation or session, instead of simply one of its transactions. This option is not available for merged transactions.

    • Consolidated

      Create a baseline that contains a single test case and a data set.

    • Expanded

      Create a baseline that contains a suite of tests (one for each transaction) and a suite document for running the tests.

  7. Specify the type of step that is included in the test case:
    • Use Application Test Steps

      The test case includes a step that corresponds to the transaction frame that you added to the shelf. For example, selecting a SOAP frame results in a test case that includes a Web Service Execution (XML) step.

    • Use Transaction Frame Step

      The test case includes an Execute Transaction Frame step.

  8. If the stateful baseline fields are available, configure them as needed:
    • Assertion
      The value indicates what happens when the assertion returns false: fail the test, generate an error, or generate a warning.
    • Parameter Level
      Specifies whether to enable parameterization and, if so, whether to match on value only or both key and value.
    • Http User
      Specifies the web application user name. CAI encrypts the value and adds the result to the Authorization header field in the baseline.
    • Http Password
      Specifies the web application user password. CAI encrypts the value and adds the result to the Authorization header field in the baseline. 
  9. (Optional) Configure the baseline to use magic dates.
    • Apply magic dates to test cases

      Converts the date strings in the baseline test case or suite to variable definition strings. For example, instead of a string that contains a specific date and time, the string can contain a function that specifies seven days from the current date and time. This behavior is equivalent to the doDateDeltaFromCurrent form of magic dates in CA Service Virtualization. If this option is unsupported, the option does not appear.

  10. (Optional) Specify a test case to be used as a template for the baseline.
  11. Click Create.
  12. Select the project where the baseline will be created.
  13. (Optional) Edit name prefix. The default prefix is the user name.
  14. Select an option to keep or delete the transactions in the shelf once the baseline is created.
  15. Click Create.
Was this helpful?

Please log in to post comments.