Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2020.2

...

  1. In the left pane, select the .tst or test suite where you want the new REST client added.
  2. Choose Add REST Client from the page-level action menu.
    Image RemovedImage Added 
  3. (Optional) Modify the name of the newly-created tool.
  4. Configure the tool as described below and click Save.

...

Configuring a REST Client

  1. (Optional) If you want to You can associate the client with requirements, tasks, or other development artifacts, click the + button in the requirements section and add details when prompted.
    Image Removed  
    The default type is @req, but you can click on the type field to choose a different artifact for associations.
    Image Removedwork items in the Work item field. See Associating Requirements with Tests for details. 
  2. If the containing test suite includes multiple data sources, you can review and change which data source is used to parameterize this REST Client. See Parameterizing with Data Source and Data Bank Values for details.
    Image RemovedImage Added 
  3. Choose the HTTP method to execute from the Method drop-down menu.
  4. Specify the URL, including queries, for accessing the resource. 

    Info
    titleTip: Using {var_name}

    If you’re familiar with SOAtest, you can use the standard ${var_name} notation to reference environment variables, test suite variables, and data source values that are defined for the test scenario. This applies to both URL and Payload.

    When you are working with JSON, a special notation is used for parameterizing a number or boolean field within a JSON message: ${number:<value>} or ${boolean:<value>}. For example, to parameterize a number field with the column Count, you would use ${number:Count}.

  5. (Optional) You can configure the client so that it succeeds with HTTP response codes outside the 2xx range. Specify single codes and/or code ranges as a comma-separated list in the Valid response field. For example, if you use "302, 500-599", a 302 code or any code in the 5xx range will be accepted.  If you're using a parameterized value, be sure that the value in the data source uses this same format (e.g., "302, 500-599").
  6. (Optional) Specify a length of time in ms before the client timeouts if it does not receive a response.
     
  7. (Optional) If the service requires authentication, enable the Enable HTTP authentication option and specify login credentials.
     

  8. (Optional) Add HTTP headers if you want to override the default headers.See HTTP Headers for additional information. Choose Literal or Table mode from the HTTP headers drop-down menu to enter values in a text area or build the header using a table format. 

    Panel
    titleLiteral mode

    Panel
    titleTable mode

  9. (Optional) If you want to reset cookies before sending a request, enable the Rest existing cookies before sending request option.
  10. If you have selected a method that sends data (e.g., PUT, POST), use the Payload controls to specify the payload for the message that will be sent.
    1. Ensure that the appropriate payload format and media type are selected (in the Format and Content type boxes).
    2. Specify the payload in the literal text editor, the JSON editor, or the XML editor (see Editing JSON Messages and Editing XML Messages for details and tips).

       

...