I am using OWASP ZAP for API testing. I import APIs using a Swagger file and use two scripts in the process:
Authentication Script:
This script handles authentication by sending 5 chained POST requests to get the final access token.
The token is then attached as a Bearer token header using the HTTP Sender script.
Automation Plan:
After setting up authentication, I run the automation plan via the ZAP CLI.
This works perfectly when executed manually in CMD or local environments
When I integrate this setup into a Jenkins Pipeline, I face a problem:
One of the API requests in the sequence requires a 3 to 5 second wait period before proceeding to the next step.
In the Jenkins console output, I consistently receive a Socket Timeout Error during this waiting phase.
It seems that the Jenkins pipeline or ZAP is not properly handling this wait, causing the timeout.