Troubleshooting guide for API testing issues in Opkey

Issue: API Endpoint Not Accessible


Issue Description:
The API endpoint is unreachable during test execution in Opkey, leading to failed requests and no response from the server.



Solution:

  1. Verify the API endpoint URL. Ensure there are no typographical errors.
  2. Check if the API server is live and reachable by testing the endpoint via a browser or Postman.
  3. Confirm network connectivity between Opkey and the API server.
  4. Review firewall or proxy settings that might block Opkey from accessing the API.
  5. Ensure correct authentication (such as OAuth, API key, etc.) is being used, and the credentials are valid.


Issue: Incorrect Response Format


Issue Description:
The REST API response is not in expected format. For example, getting results in formats other than JSON, which results in failures when validating the response in Opkey.


Solution:

  1. Double-check that the REST API is expected to return a JSON response.
  2. Verify the API’s behavior by testing the endpoint in Opkey and checking the response format.
  3. Ensure proper error-handling mechanisms are implemented for cases when non-JSON responses are returned.


Issue: API Test Step Failing on Authentication


Issue Description:
The API test step is failing due to authentication errors, causing issues in accessing protected resources.


Solution:

  1. Ensure that the correct authentication type (None, HTTP_Basic_Preemptive, OAuth, etc.) is selected in the API test step.
  2. Recheck credentials like username and password if basic authentication is being used.
  3. If OAuth is involved, ensure the proper authorization flow is followed.


Issue: API Returns Incorrect Status Codes


Issue Description:
The API is returning incorrect status codes (e.g., 404 Not Found or 500 Internal Server Error) when testing in Opkey, even though the request should be valid.


Solution:

  1. Confirm that the correct HTTP method (GET, POST, PUT, DELETE) is used in the API test step.
  2. Ensure that all required parameters, headers, and body data are properly configured in the request.
  3. If the method, parameters, header, and body data are properly configured, then the issue could be API-specific.
  4. Check for server-side issues or API downtime if Opkey is properly configured but still receives errors.


Issue: API Test Execution Is Slow or Times Out


Issue Description:
The API test execution takes too long or times out, causing failures in Opkey.


Solution:

  1. Check the network latency between Opkey and the API server. High latency can cause timeouts.
  2. Increase the timeout limit in the API test step settings if needed.
  3. Ensure the API server is not under high load or facing performance issues.
  4. Optimize API requests by reducing the payload size or using more efficient request methods (e.g., GET instead of POST if appropriate).
  5. Test the API with other tools to confirm if the issue is related to the API itself or Opkey's environment.


Click on the following links to learn how to create SOAP and REST API test methods in Opkey.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article