Screenshot capture in Jenkins pipelines
Add visual testing to your Jenkins builds without managing browsers
Integrate Allscreenshots into your Jenkins CI/CD pipelines to capture screenshots during builds. Skip the complexity of managing Selenium or Playwright on Jenkins agents — one API call captures any page and stores the result as a build artifact.
Add credentials
Store your Allscreenshots API key in Jenkins credentials manager.
Add a pipeline stage
Add a screenshot stage to your Jenkinsfile.
Call the API
Use curl or the HTTP Request plugin to capture screenshots.
Archive artifacts
Store screenshots as Jenkins build artifacts.
1pipeline {
2 agent any
3
4 environment {
5 API_KEY = credentials('allscreenshots-api-key')
6 }
7
8 stages {
9 stage('Capture Screenshots') {
10 steps {
11 sh """
12 curl -X POST 'https://api.allscreenshots.com/v1/screenshot' \
13 -H 'Authorization: Bearer ${API_KEY}' \
14 -H 'Content-Type: application/json' \
15 -d '{
16 "url": "https://staging.yourapp.com",
17 "fullPage": true,
18 "viewport": { "width": 1920, "height": 1080 }
19 }' -o screenshot.png
20 """
21 }
22 }
23 }
24
25 post {
26 always {
27 archiveArtifacts artifacts: 'screenshot.png',
28 allowEmptyArchive: true
29 }
30 }
31}No agent dependencies
No need to install Chrome or Puppeteer on Jenkins agents. The API handles all browser rendering.
Works with any agent
The API call works from any Jenkins agent — Linux, Mac, Windows, or Docker.
Build artifacts
Screenshots are archived as standard Jenkins build artifacts for easy access and history.