How can I create Pipeline with TestNG? I am creating scripts using Selenium(Java) and TestNG.

22 views
Skip to first unread message

Sandeep S

unread,
Nov 27, 2017, 10:03:30 AM11/27/17
to Jenkins Users
Hi All,

 I am creating scripts using Selenium(Java) and TestNG. I see some examples here https://jenkins.io/doc/pipeline/tour/hello-world/ but I don't see example for TestNG or Selenium. 

Can any one please help me with pipeline code? What can I give in setps and agent?

I am not using Maven in my project.


pipeline {
    agent { ?????}
    stages {
        stage('build') {
            steps {
                ?????
            }
        }
    }
}


Thank you.
Sandeep Kumar

Victor Martinez

unread,
Nov 27, 2017, 11:58:48 AM11/27/17
to Jenkins Users
You can include those scripts executions as part of the sh and bats steps.


pipeline {
    agent
{ ?????}
    stages
{
        stage
(
'build'
) {
            steps
{
                sh
'# whatever.... commands you run to run yours scripts. bear in mind you might need to checkout your source code'
           
}
       
}
   
}
}



Regarding the agent, you might need to setup a jenkins agent (either ephemeral or permanent) with the right configuration (java version, environment variables, any other tools/binaries) in order to run your project

Cheers

itchymuzzle

unread,
Nov 28, 2017, 10:20:27 AM11/28/17
to Jenkins Users
What do you already have setup and working?  Jenkins server, and a node?  Jenkinsfile in place?  ...
Reply all
Reply to author
Forward
0 new messages