While most API testing focuses on the request and response, real-world scenarios often require configuring the underlying connection settings. ACCELQ provides a suite of commands to manage security, protocol versions, and timeouts, giving you fine-grained control over the API test environment.
This article covers advanced configurations for your REST connections.
1. SSL/TLS Security Configuration
When interacting with secure endpoints (https:), you may need to manage SSL/TLS certificate handling.
Enabling or Disabling SSL Verification
By default, ACCELQ verifies the server's SSL certificate. However, in test environments with self-signed or temporary certificates, you may need to disable this verification to proceed.
- Command:
Configure SSL Certification Verification in ReST Connection - Purpose: To turn strict SSL certificate validation on or off for a given connection.
- Parameters:
Connection Name: The Reference name of the REST call this setting applies to.SSL Certificate Verification:ON(default, secure) orOFF(insecure, for test environments only).
Example:
Configure SSL certificate verification in ReST connection 'test':
OFF
Using Client-Side Certificates (mTLS)
For services requiring Mutual TLS (mTLS), the client must present its own certificate to the server for authentication.
- Command:
Add Certificate to ReST Connection - Purpose: To attach a client-side certificate (e.g.,
.pem,.p12) to an API connection. - Parameters:
Connection Name: The Reference name of the REST call.File Path: The path to the certificate file, which must be accessible by the ACCELQ Agent.Password: The password for the certificate file, if it is protected.
Example:
Add certificate to REST API connection: 'test', Certificate file path: '/accelq/certs/client.pem', password: '********'
2. Managing HTTP Protocol Version
Some applications may require communication over a specific HTTP version. You can explicitly set which versions the HTTP client should attempt to use.
- Command:
Set ReST HTTP version - Purpose: To define the allowed HTTP version(s) for subsequent REST requests.
Example:
Set ReST HTTP versions '1.1, 2.0'
3. Handling Timeouts
If you are testing an API that may take longer than usual to respond, you can temporarily adjust the timeout to prevent your test from failing prematurely.
Setting a Custom Timeout
- Command:
Set API Test timeout - Purpose: To override the default API timeout for subsequent steps.
Example:
Set API Test timeout to: '200' sec
Resetting the Timeout
It is a crucial best practice to reset the timeout to its original value after the specific long-running API call is complete. This ensures the custom setting does not unintentionally affect other tests in the same run.
- Command:
Reset Timeout Values for Current Job - Purpose: Restores the specified timeout to its default value as defined in the Run Configuration.
Example:
Reset API Test timeout value to original run config value
By using these commands, you can build robust and flexible API tests that can handle the complex security and performance requirements of enterprise-level applications.
Comments
0 comments
Please sign in to leave a comment.