Issue with ZAP API Testing in Jenkins Pipeline - Socket Timeout During Wait Phase

50 views
Skip to first unread message

Chandima Sanjeewa

unread,
Jul 6, 2025, 4:26:44 AM7/6/25
to ZAP User Group

I am using OWASP ZAP for API testing. I import APIs using a Swagger file and use two scripts in the process:

  1. 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.

  2. 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.

  Is there a recommended way to configure request timeouts or delays in ZAP automation for Jenkins pipelines?  

Simon Bennetts

unread,
Jul 8, 2025, 11:24:45 AM7/8/25
to ZAP User Group
Which scripting language are you using?

FYI ZAP has not been an OWASP project for nearly 2 years ;)

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages