ACCELQ provides comprehensive support for executing and verifying REST API. There isn't much difference in how you set up your action logic for API testing compared to UI testing. And you can also develop an Action that includes both UI and API testing together, making possible a fluid end-to-end verification.
Here is the basic flow involved in testing RESTful services. Subsequent sections describe these steps in greater detail.
Defining REST Connection
Define REST Connection
Registers ReST connection with the given name and base URL. Further API calls on this connection should be referenced through the given connection name. If the connection name already exists then the results will be overwritten with the new REST calls.
Connection Name |
Connection Name to reference when invoking REST calls |
Note: While inputting header name/value pairs with comma separation, if there is a legitimate comma character in the value of a particular header name, escape it with "\"
Invoking REST Calls
Invoke ReST Request (GET)
Invokes a ReSTful GET service. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of the Response.
Connection Name |
Connection name on which this REST call is executed. |
Invoke ReST Request (POST)
Invokes a ReSTful POST service. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of Response.
Connection name |
Connection name on which this REST call is executed. |
Invoke ReST Request (POST) With Form Data Type Payload
Invokes a ReSTful POST service with a Form input data payload. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of the Response.
URL |
ReST service end-point URL. Note that if the Connection has a base URL specified, it will be prefixed. |
Invoke ReST Request (PUT)
Invokes a ReSTful PUT service. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of the Response.
URL |
ReST service end-point URL. Note that if the Connection has a base URL specified, it will be prefixed. |
Invoke ReST Request (PUT) With Form Data Type Payload
Invokes a ReSTful PUT service with Form input data payload. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of Response.
URL |
ReST service end-point URL. Note that if the Connection has a base URL specified, it will be prefixed. |
Invoke ReST Request (PATCH)
Invokes a ReSTful PATCH service.
URL |
ReST service end-point URL. Note that if the Connection has a base URL specified, it will be prefixed. |
Invoke ReST Request (DELETE)
Invokes a ReSTful DELETE service. Note that the connection name must have already been defined (and authenticated, if required) before executing this command. The Reference Name provided with this Request should be used for subsequent validation of Response.
URL |
ReST service end-point URL. Note that if the Connection has a base URL specified, it will be prefixed. |
Note: If the information in a header is confidential, you may pass encrypted values instead of plain text.
- Click on Resources in the left-nav and Tools > Encrypt Text. Copy the encrypted text for the header value.
- Pass this encrypted value in the header in the format "$encr(<value>)"
Response Verification
Verify Header From ReST Response
Verifies header value from ReST Response.
reference name |
reference name for this ReST call. |
Verify ReST Response Status Code
Verifies whether the Response status code for a given ReST Request is the specified value. Note that this is verification command and it fails the test execution if the verification fails.
Reference name |
Reference name for the ReST call whose status to be verified |
Verify Node In ReST Response Matches
Verify the node value in ReST response matches an expected text.
Ref name |
Reference name for this ReST call. |
Ref name |
Reference name for this ReST call. |
Comments
0 comments
Please sign in to leave a comment.