Running SoapUI via Jenkins
Introduction
Integrating SoapUI with Jenkins allows automated API testing as part of a CI/CD pipeline. This ensures that API tests run automatically with every build or deployment.
Prerequisites
- Jenkins installed on the system.
- SoapUI installed (open-source or SoapUI Pro).
- SoapUI test project created and ready to execute.
- Jenkins plugin for command-line execution (if needed).
Steps to Run SoapUI Tests in Jenkins
1. Configure Jenkins Job
- Open Jenkins Dashboard.
- Click on New Item > Freestyle Project.
- Provide a name and click OK.
2. Add Build Step to Run SoapUI Tests
- Go to the Build section.
- Click Add build step > Execute shell (for Linux/macOS) or Execute Windows batch command.
- Add the following command to execute SoapUI tests:
Linux/macOS:
sh /path/to/SoapUI/bin/testrunner.sh -r -f /path/to/output -j /path/to/project.xml
Windows:
"C:\Program Files\SoapUI\bin\testrunner.bat" -r -f C:\output -j C:\path\to\project.xml
3. Save and Run the Job
- Click Save.
- Click Build Now to trigger the test run.
- Check the Console Output for test execution logs.
Advanced Configurations
Running SoapUI with JUnit Reports
For better reporting in Jenkins, generate JUnit-style reports:
sh /path/to/SoapUI/bin/testrunner.sh -r -f /path/to/output -j -a -I -J -F junit /path/to/project.xml
Integrating with Pipeline Jobs
For Jenkins Pipeline, use the sh or bat commands in a Jenkinsfile:
pipeline {
agent any
stages {
stage('Run SoapUI Tests') {
steps {
sh '/path/to/SoapUI/bin/testrunner.sh -r -f /path/to/output -j /path/to/project.xml'
}
}
}
}
Advantages
- Fully automated API testing in CI/CD pipelines.
- Generates detailed reports.
- Can be integrated with test results analysis tools.
Conclusion
Running SoapUI tests via Jenkins ensures continuous validation of API functionality, helping detect issues early in the development lifecycle.