0
0
Selenium Javatesting~10 mins

Jenkins pipeline integration in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a Jenkins pipeline stage named 'Build'.

Selenium Java
stage('[1]') {
    steps {
        echo 'Building the project'
    }
}
Drag options to blanks, or click blank then click option'
ATest
BDeploy
CBuild
DClean
Attempts:
3 left
💡 Hint
Common Mistakes
Using a stage name that does not match the build process.
Forgetting to put the stage name in quotes.
2fill in blank
medium

Complete the code to run a shell command in the Jenkins pipeline.

Selenium Java
steps {
    [1] 'mvn clean install'
}
Drag options to blanks, or click blank then click option'
Ash
Bbat
Cpowershell
Dscript
Attempts:
3 left
💡 Hint
Common Mistakes
Using bat on Linux agents causing errors.
Forgetting to use a step to run shell commands.
3fill in blank
hard

Fix the error in the Jenkins pipeline syntax to declare an agent.

Selenium Java
pipeline {
    agent {
        [1] 'linux'
    }
    stages {
        stage('Test') {
            steps {
                echo 'Running tests'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
Anode
Bnone
Cany
Dlabel
Attempts:
3 left
💡 Hint
Common Mistakes
Using any without braces causes syntax errors here.
Confusing node with agent syntax.
4fill in blank
hard

Fill both blanks to define a post-build action that always runs and sends a notification.

Selenium Java
post {
    [1] {
        [2] 'Build completed'
    }
}
Drag options to blanks, or click blank then click option'
Aalways
Bsuccess
Cecho
Dfailure
Attempts:
3 left
💡 Hint
Common Mistakes
Using success instead of always to run post actions.
Using sh instead of echo for simple messages.
5fill in blank
hard

Fill all three blanks to create a parallel stage with two branches named 'UI Tests' and 'API Tests'.

Selenium Java
stage('Test') {
    parallel {
        '[1]': {
            steps {
                [2] 'Running UI tests'
            }
        },
        '[3]': {
            steps {
                echo 'Running API tests'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
AUI Tests
Becho
CAPI Tests
Dsh
Attempts:
3 left
💡 Hint
Common Mistakes
Using sh instead of echo for simple messages.
Mixing up branch names or missing quotes.