Send Request Operation

Applies to TestComplete 14.60, last modified on April 22, 2021

Description

The Send Request operation sends an HTTP request to a specified URL using a specified HTTP request method.

Operation Result

The operation returns the response from a web server. You can use the response later in your test. For example, you can save it to a file by using the Save to File operation.

To save the response to a file

If TestComplete sends the request successfully, and the server returns an OK response, the operation will post information about the request and the response body and header to the test log.

Otherwise, the operation will post an error message to the test log.

Tip: If a request fails due to the status code error, the information about it will also be posted to the test log.

Scripting Analogue

The operation is an analogue of the aqHttpRequest.Send method.

Operation Parameters

The operation parameters are organized into the following pages:

Specify Request and Response Check Parameters

On this page, you can specify request parameters.

Method

Required. The request method (an HTTP verb) to use.

The following operations are supported:

  • GET
  • HEAD
  • POST
  • PUT
  • DELETE
  • OPTIONS
  • TRACE
  • PATCH

URL

Required. String. An absolute URL path to the server or resource to which you want to send the request. Must include the protocol.

For example, https://smartbear.com or http://support.smartbear.com.

If the parameter does not include the protocol (for example, www.support.smartbear.com), the operation will fail.

Username

String. If the target web server uses the Basic authentication, specify the login of the user on whose behalf you want to send the request.

Password

String. If the target web server uses the Basic authentication, specify the password of the user on whose behalf you want to send the request.

Response status code check

Specifies how the operation will check the response status code:

  • Do not perform – The operation will not check the response status code.

  • Check for success – The operation will check whether the response status code means that the request has been sent successfully (that is, the status code is from 200 to 206).

  • Check for equality – The operation will check whether the response status code equals the specified value.

Specify Request Content

On this page, you can specify the headers and body content for your request.

  • Body – To specify the body content, either enter it in the edit box, or click Edit and define it in the resulting Edit Value dialog.

  • Headers – In that table, you can add headers to your request.

    Click Add to add a new header and enter its name and value in the Name and Value columns.

    Click Remove to delete the header. Click Clear to remove all the headers.

Operation Parameters

On the Operation Parameters page, you can review the parameters you have created and change them if needed.

To change the operation parameter’s value:

  • Specify a new value in the Value column.

– or –

  • Click the ellipsis button in the corresponding cell of the Value column and edit the value in the subsequent dialog. For detailed information about possible values, see Specifying Operation Parameters.

Once ready, click Finish to apply the changes you have made and create a new keyword test item.

See Also

Specifying Operation Parameters
Send Method
Save to File Operation
Data Access

Highlight search results