Integration of Selenium Webdriver with Maven and Jenkins

Share
Embed
  • Published on Sep 20, 2015
  • In this video we will do complete setup of Selenium Webdriver with Maven and Jenkins for continuous integration.
    -~-~~-~~~-~~-~-
    Please watch: "How To Create Maven build For Selenium Framework"
    ru-clip.net/video/WIiFTb9RMNw/video.html
    -~-~~-~~~-~~-~-
  • Science & TechnologyScience & Technology

Comments • 147

  • ASHWIN NAYAK
    ASHWIN NAYAK 18 days ago +1

    Hey Mukesh,
    How can we execute such SVN projects. having this same structure?
    What should be 'Root POM' & 'Goals and Options' value ?

    • ASHWIN NAYAK
      ASHWIN NAYAK 4 days ago

      @Mukesh otwani Got it, Thanks a lot Mukesh!

    • Mukesh otwani
      Mukesh otwani  4 days ago +1

      Hi Ashwin, in that case you can pass pom.xml file path in build option and goal which you can use clean install and test.

  • Muvvala G
    Muvvala G 4 months ago

    Hi Mukesh,
    I have installed Jenkins on AWS CE2 Windows Instance, and i have configured Maven, JDK every thng on the EC2 instance, i can access that from Local system with public IP, the problem here is when ever i try to run my pom.xml file from Local (I have given pom.xml file location )in the place of RootPom field. it is giving me the error as
    ERROR: No such file C:\Testing2Jenkins\pom.xml
    , Perhaps you need to specify the correct POM file path in the project configuration?
    Can you help me out on this to resolve the error

    Thanks,
    Gouri

  • Avinash Dba
    Avinash Dba 6 months ago

    My jenkin is running on linux box.. While running my test cases in jenkins am getting web driver initialization failure error.. Please help me

  • Prabh Singh
    Prabh Singh 7 months ago +1

    Hi Mukesh while running both on cmd and eclipse error shos "Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1"
    "Please refer to C:\Users\Dark knight\eclipse-workspace\com.automation.selenium\target\surefire-reports for the individual test results."

    Then I used the Failsafe plugin (verify assert), Build is succeded boh from cmd and Jenkins but chrome browser is not opening giving some error
    System property can be defined by webdriver.driver

    • Prabh Singh
      Prabh Singh 7 months ago

      @Mukesh otwani thanks

    • Mukesh otwani
      Mukesh otwani  7 months ago +1

      Hi Prabh this is new tutorial ru-clip.net/video/WIiFTb9RMNw/video.html

  • Preetesh Pal
    Preetesh Pal 10 months ago

    Hi Mukesh,
    Thanks for your videos, you are doing a great job its great help for the beginners as well as experienced persons, I had followed the steps what you had mentioned in this video but facing some issues, My maven project is showing success while running from eclipse through testng.xml file but not able to run through Jenkins showing following Issue:
    Started by user admin
    Building in workspace C:\Program Files (x86)\Jenkins\workspace\Maven_FirstProject
    Parsing POMs
    Discovered a new module MavenProject:MavenProject Maven Project
    Modules changed, recalculating dependency graph
    Established TCP socket on 49725
    [MavenProject] $ "C:\Program Files\Java\jdk1.8.0_191/bin/java" -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.12.jar;C:\Softwares\apache-maven-3.6.0\boot\plexus-classworlds-2.5.2.jar;C:\Softwares\apache-maven-3.6.0/conf/logging" jenkins.maven3.agent.Maven35Main C:\Softwares\apache-maven-3.6.0 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.27.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.12.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.12.jar" 49725
    channel started
    Executing Maven: -B -f E:\Automation\WorkingProjects\MavenProject\pom.xml clean run
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ---------------------< MavenProject:MavenProject >----------------------
    [INFO] Building Maven Project 0.0.1-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [JENKINS] Archiving E:\Automation\WorkingProjects\MavenProject\pom.xml to MavenProject/MavenProject/0.0.1-SNAPSHOT/MavenProject-0.0.1-SNAPSHOT.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.398 s
    [INFO] Finished at: 2019-01-06T14:11:34+05:30
    [INFO] ------------------------------------------------------------------------
    [ERROR] Unknown lifecycle phase "run". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
    channel stopped
    Finished: FAILURE
    Note:In my pom.xml file I had included only the dependencies for Selenium(2.53.1) & testng(6.14.3)
    If you can help me for the solution it will be great help for me
    Thanks in Advanced

  • Priyanka Sharma
    Priyanka Sharma Year ago

    Hi Mukesh
    Please tell me if this is necessary to create a maven project to integrate with jenkins or we can use a java project?

  • Abhijeet Sawai
    Abhijeet Sawai Year ago

    build success but browser not launching ?

  • chandrashekhar panda

    Hi Mukesh
    I am using maven project with jenkins. i am trying to attach screenshot to jenkins for email notification but is not attaching the screenshot to mail and only attaching the log file. But while i am using simple java project with jenkins it is attaching the screenshot and logfile as well.
    My jenkins version is---1.600
    Apache Maven Version-3.3.3
    what i will do please tell me and help me out.

  • Sameer Dod
    Sameer Dod Year ago +1

    Hi Mukesh, I tried to run pom.xml in jenkins but it give this error. I unable to run from jenkins.
    ERROR: Failed to parse POMs ..
    Building in workspace C:\Users\Sameer\.jenkins\workspace\Good
    Parsing POMs
    Discovered a new module Maven:maven MavenDemo
    Modules changed, recalculating dependency graph
    [maven] $ "C:\Program Files\Java\jdk1.8.0_60/bin/java" -cp "C:\Users\Sameer\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.5.jar;G:\Enter10menT\Softwares\Jenkins & Maven\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar;G:\Enter10menT\Softwares\Jenkins & Maven\apache-maven-3.5.4/conf/logging" jenkins.maven3.agent.Maven31Main "G:\Enter10menT\Softwares\Jenkins & Maven\apache-maven-3.5.4" C:\Users\Sameer\.jenkins\war\WEB-INF\lib\remoting-2.52.jar C:\Users\Sameer\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.5.jar C:\Users\Sameer\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar 65350
    channel started
    Executing Maven: -B -f G:\my data\Selenium\Eclips WorkPlace\maven\pom.xml test
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...............
    Caused by: java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.java:653)
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:171)
    at org.jvnet.hudson.maven3.launcher.Maven31Launcher.getMavenExecutionRequest(Maven31Launcher.java:153)
    at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:130)
    ... 21 more
    ERROR: Failed to parse POMs

    • Sameer Dod
      Sameer Dod Year ago

      Hi Mukesh This is my pom.xml code :

      4.0.0
      Maven
      maven
      0.0.1-SNAPSHOT
      MavenDemo
      DemoOnly


      testng.xml



      org.seleniumhq.selenium
      selenium-java
      3.12.0


      io.appium
      java-client
      3.2.0


      net.sourceforge.jexcelapi
      jxl
      2.6


      org.testng
      testng
      6.8.8
      test






      org.apache.maven.plugins
      maven-compiler-plugin
      3.0
      1.8
      1.6
      1.6


      org.apache.maven.plugins
      maven-surefire-plugin
      2.17

      ${suiteXmlFile}

    • Mukesh otwani
      Mukesh otwani  Year ago

      Hi Sameer seems some wrong configuration of pom.xml file. Can you share pom.xml and commands which you tried ?

  • Sameer Dod
    Sameer Dod Year ago +1

    Hi Mukesh, thanx for this video and also for ease to explain. I have quick doubts, When I execute the run.bat file in 1st time then it will be the success. But When I run it for another jenkins project on another day then it fails.

    • Sameer Dod
      Sameer Dod Year ago

      Thank You.

    • Mukesh otwani
      Mukesh otwani  Year ago

      Hi Sameer I would recommend you to run jenkins job vai pom.xml .. Batch file required when you have normal java projects.

  • Jahangir Ali Khan

    A simple and clear explanation, thanks brother:)

  • Sudhir Batham
    Sudhir Batham Year ago +1

    Hi

    while creating a maven proj, I am facing this issue
    "Could not resolve archetype
    org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from anyof the configured repositories."
    please suggest what to, what all setting should I change, what all things should i check

    • Mukesh otwani
      Mukesh otwani  Year ago

      Hi Sudhir,
      While creating maven project select Create Plain Project and you can follow below steps
      learn-automation.com/maven-integration-with-selenium/

  • Ashirbad Ratha
    Ashirbad Ratha Year ago +1

    Thank you Mukesh. It is really a nice video. However i am left out with one question,
    1> What is the objective of below lines, and why we do this,
    -----------POM structure---------
    com.PracticeSets
    com.Demo1
    0.0.1-SNAPSHOT
    jar

    • Mukesh otwani
      Mukesh otwani  Year ago

      Hi Ashirbad,

      This would help learn-automation.com/maven-integration-with-selenium/

  • Shobhit
    Shobhit Year ago +1

    short n sweet . amazing video

  • Shilpi Gupta
    Shilpi Gupta Year ago

    Hii Mukesh, my maven project is run correctly by Jenkins but chrome browser is lunch ...so what I do pls help me!!!

  • sairam Lingineni
    sairam Lingineni Year ago +1

    hi mukesh can you give training for 1 day?

    • Mukesh otwani
      Mukesh otwani  Year ago

      Hi Sairam please share your details to my email I will share details mukeshotwani@learn-automation.com

  • Ifeoma Emodi
    Ifeoma Emodi Year ago

    Hi Mukesh am new to automation and I am using Intellij instead of eclipse. What are the folder structure for a maven project. I have searched online and they are all different from each other. Can you please assist me with this and do you have an email address that I can use

  • Moe Munaz
    Moe Munaz Year ago

    Hi Mukesh, where does it store the screenshots?
    I mean when I push my code to GitHub repo and it triggers automatically and runs in the pipeline does it store the test results and screenshots somewhere?

  • manoj kumar
    manoj kumar Year ago

    hi mahesh,
    how to give maven installation path in jenkins,if maven is inbuilt with eclipse neon...

  • Vikrant Verma
    Vikrant Verma Year ago

    Excellent tutorial and very well explained. Thanks Mukesh

  • Florin Cruceru
    Florin Cruceru Year ago

    why is work space empty?????

  • Jino Philip
    Jino Philip Year ago

    @Mukesh can u add a video to generate test NG reports in Jenkins

  • Chandan Anand
    Chandan Anand Year ago

    Hi Mukesh you have done good job
    How to trigger maven project build according to the timing and get a email.

  • jaibalaji balaji
    jaibalaji balaji 2 years ago

    how to run selenium jobs in slave machine. could you please provide link ?

  • Aakash Shah
    Aakash Shah 2 years ago

    Hi, Getting below error thiugh jdk has been setup in jenkins
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    [INFO] 1 error
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 6.555 s
    [INFO] Finished at: 2017-11-13T20:33:43+05:30
    [INFO] Final Memory: 13M/108M
    [INFO] ------------------------------------------------------------------------
    Waiting for Jenkins to finish collecting data
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:testCompile (default-testCompile) on project com.test.selenium: Compilation failure
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    [ERROR] -> [Help 1]
    [ERROR]
    Can you help me out

    • Aakash Shah
      Aakash Shah 2 years ago

      Mukesh otwani thanks sir

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hey Akash please follow below link

      learn-automation.com/maven-no-compiler-is-provided-in-this-environment-selenium/

  • Yaswanth Seema
    Yaswanth Seema 2 years ago

    Its clear and easy to understand. Thank You Mukesh.

  • Huy Kent
    Huy Kent 2 years ago +1

    How to create bat file run for maven project?

    • Mukesh otwani
      Mukesh otwani  2 years ago

      +Huy Kanta no need to create bat file for maven project you can directly run pom.xml
      mvn clean install test

  • Niraj Gahukar
    Niraj Gahukar 2 years ago +1

    Hello Sir, I am not getting Maven project option after clicking on the new item. I have given the maven path.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Niraj Click on New > Other Project > Search for Maven > Then Select maven project

  • ramya nr
    ramya nr 2 years ago

    Clear and simple, Thanks

  • Praveen Tata
    Praveen Tata 2 years ago

    Hi Mukesh,
    This is a nice video.
    I wanted to know how to parameterize testng.xml file from Jenkins.
    Say, I have multiple testng xml files and I want to pass the name of testng xml file as a parameter from Jenkins. How can I do that?
    As of now, I have the following configuration:


    org.apache.maven.plugins
    maven-surefire-plugin
    2.20


    ${testng.xml}





    In Jenkins, Goals has the following: test "-DsuiteXmlFile=testng1.xml"
    I am getting an error that testng xml was not found to compile.
    Thanks.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Cheers Praveen

    • Praveen Tata
      Praveen Tata 2 years ago +1

      I got it. Fixed few errors in the pom.xml configuration.

      ${suiteXmlFile}

      Changed this to match the tag and removed ".xml" extension.
      In Jenkins, Goals is updated to this: test "-DsuiteXmlFile=testng1.xml,testng2.xml"

  • Vidya kabber
    Vidya kabber 2 years ago

    Thank you so much sir....awesome video...It helps me lot...Once again thank you so much...

    • Mukesh otwani
      Mukesh otwani  2 years ago

      I am glad that you are able to understand Jenkins concept.

  • vignesh m
    vignesh m 2 years ago +1

    Hi Mukesh,
    While building the maven project in jenkins I am getting the below error in Console Output. I don't know what I need to do. Please help me out.
    Started by user Vignesh Myilsamy
    Building in workspace C:\Users\vignesh.m\.jenkins\workspace\PeiWeiRegPack
    FATAL: org/jenkinsci/plugins/workflow/job/WorkflowRun
    java.lang.NoClassDefFoundError: org/jenkinsci/plugins/workflow/job/WorkflowRun
    at org.jenkinsci.plugins.workflow.job.WorkflowJob$SCMListenerImpl.onCheckout(WorkflowJob.java:750)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:612)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
    Sending e-mails to: vignesh.m@saggezza.com
    ERROR: Could not connect to SMTP host: localhost, port: 25
    javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
    nested exception is:
    java.net.ConnectException: Connection refused: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
    at javax.mail.Service.connect(Service.java:295)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at hudson.tasks.MailSender.execute(MailSender.java:121)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1055)
    at hudson.model.Run.execute(Run.java:1785)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:286)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
    ... 12 more
    Finished: FAILURE
    Thanks,
    Vignesh.M

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Vignesh, some plugin of Jenkins are missing.

  • Live Entertiner
    Live Entertiner 2 years ago

    What is Diffrence between Selenium Unitests And Selenium Functional Test,How to Sepate the unit test and functiona test.Please give me any example.

  • 151181harpal
    151181harpal 2 years ago

    Hi Mukesh , I would like to get some details about the Selenium Recorded Videos . I have already got the Framework videos and they are really helpful. Selenium recorded Videos what do they have ? Also that Selenium recorded link doesn't work. I have made enquiry from the website but haven't got any reply. Waiting for a reply.

  • Hsr G
    Hsr G 2 years ago +1

    Hi Mukesh,
    My web browser is not launching but tests are successful.. Please suggest.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Your Jenkins is running your test in Headless mode.Kindly run jenkins as war

  • maia tabatadze
    maia tabatadze 2 years ago +1

    Hi Mukesh, thank you for your helpful videos I learnt a lot from you, I have one problem when I am executing as a maven tests, test is build successfully but it doesn't give me a result in console: for example if I will ask to print title, in console it wont print, if I run it as a Maven test.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Maia,

      Strange it should print all statement to.

      Try with mvn clean install test.

  • Prafull Vispute
    Prafull Vispute 2 years ago +1

    I am getting below error while executing maven selenium script through Jenkins, could u please help me , what are causes the eror, same script is running successfuly on local machine and getting error while executing through Jenkin on remote machine.
    "listening on port 44*** org.openqa.selenium.remote.unreachablebrowserexception: could not start a new session. Possible causes are invalid address of the remote server or browser start-up failures.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Kindly share code too mukeshotwani@learn-automation.com

  • DIVYA PRAKASH Singh
    DIVYA PRAKASH Singh 2 years ago +1

    I am not able to get JDK plug in in configure system tab. please suggest

  • karthik n
    karthik n 2 years ago

    Hi Mukesh, When i tried running Maven tests from jenkins , i am getting java.lang.reflect.InvocationTargetException

  • Prateek Krishnatrey
    Prateek Krishnatrey 2 years ago

    Hi mukesh, plz see this error..everytime i get this error when am running maven project through jenkins:
    ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 6.453 s
    [INFO] Finished at: 2017-05-23T14:13:19+05:30
    [INFO] Final Memory: 14M/126M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project JenkinsProjects: Error while storing the mojo status: /home/user/workspace/JenkinsProjects/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (Permission denied) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    [JENKINS] Archiving /home/user/workspace/JenkinsProjects/pom.xml to com.jenkins/JenkinsProjects/0.0.1-SNAPSHOT/JenkinsProjects-0.0.1-SNAPSHOT.pom
    /home/user/workspace/JenkinsProjects/pom.xml is not inside /var/lib/jenkins/workspace/JenkinsProjects/home/user/workspace/JenkinsProjects/; will archive in a separate pass
    channel stopped
    Finished: FAILURE

  • SAYAN DE ROY
    SAYAN DE ROY 2 years ago +1

    Hi Mukesh, while doing the Jenkins setup the options Add JDK and Add Maven are not displayed in configure system screen. How to get those option in Jenkins.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Sayan in Jenkins 2 you will get this option in Global tool configuration.

  • Gogu Edukondalu
    Gogu Edukondalu 2 years ago +1

    Hi Mukesh, Thanks for the video. I have an issue.
    Am getting Could not find or load main class org.testng.TestNG
    I have tried so many times to set classpath.But astill getting an error. Please help me Mukesh.

  • Kuldeep Kumar
    Kuldeep Kumar 2 years ago +1

    Very well summarized Mukesh..!!

  • Sudhanshu Pradhan
    Sudhanshu Pradhan 2 years ago

    Hi Mukesh, after following the same step I am getting an error when I am clicking on built now

    Started by user admin
    Building in workspace C:\Program Files (x86)\Jenkins\workspace\IOL_Demo
    Parsing POMs
    Established TCP socket on 53694
    [IOL_Automation_BLR] $ "C:\Program Files\Java\jdk1.8.0_101/bin/java" -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar;D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0/conf/logging" jenkins.maven3.agent.Maven33Main D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.7.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar" 53694
    channel started
    Executing Maven: -B -f D:\IOL Automation Workspace\IOL_Automation_BLR\pom.xml clean install
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.java:658)
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:149)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.getMavenExecutionRequest(Maven33Launcher.java:150)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:127)
    ... 21 more
    ERROR: Failed to parse POMs
    java.io.IOException: java.lang.reflect.InvocationTargetException
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:179)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at ......remote call to Channel to Maven [C:\Program Files\Java\jdk1.8.0_101/bin/java, -cp, C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar;D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0/conf/logging, jenkins.maven3.agent.Maven33Main, D:\selenium\software\Maven\apache-maven-3.5.0-bin\apache-maven-3.5.0, C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.7.jar, C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar, C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar, 53694](Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
    at hudson.remoting.Channel.call(Channel.java:830)
    at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:873)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1728)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:405)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:179)
    ... 14 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    ... 14 more
    Caused by: java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.java:658)
    at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:149)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.getMavenExecutionRequest(Maven33Launcher.java:150)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:127)
    ... 21 more
    channel stopped
    Finished: FAILURE

  • Kumar Pranay Sarkar
    Kumar Pranay Sarkar 2 years ago

    Mr Mukesh kindly upload the GIT-HUB video ASAP..plz..

  • Vamsi Priya
    Vamsi Priya 2 years ago +1

    Hello Mukesh, Thanks for the work you are doing. i followed the same procedure but under new item of jenkins page i am not getting any option of maven

    • Vamsi Priya
      Vamsi Priya 2 years ago

      FAILED: main
      org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Failed to clear data for com.android.chrome on device 3a4da2a67d62: Error: java.lang.SecurityException: PID 2659 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package com.android.chrome
      (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 10.0 x86_64))) (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 11.33 seconds
      Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
      System info: host: 'DESKTOP-E6N659L', ip: '192.168.246.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
      Driver info: io.appium.java_client.android.AndroidDriver
      Please help me in solving this issue, i am using port num: 4723

    • Vamsi Priya
      Vamsi Priya 2 years ago

      Sure, but i don't use fb. so can i post here!!

    • Mukesh otwani
      Mukesh otwani  2 years ago

      +Vamsi Priya can u please send me logs as well and please paste in fb group so that all can check and reply

    • Vamsi Priya
      Vamsi Priya 2 years ago +1

      Thanks for the reply, it is working now, can you please help me in solving session not created exception in appium. i followed same steps from your videos only.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      +Vamsi Priya Hi Priya you have to install maven integration plugin in Jenkins to get maven project

  • Tariq Humayun
    Tariq Humayun 2 years ago

    Thanks for the video Mukesh. But I have some issues on my side. Actually I'm using 2.32.1 and haven't get any maven project on New Item.

  • Prafull Vispute
    Prafull Vispute 2 years ago

    what is diffeernce between maven project and test ng..is there any difference..which one is good one..my company has developed maven project..do i need to replace it with testng?

  • Kumaalagutna Subhash
    Kumaalagutna Subhash 2 years ago +1

    Hi Mukesh
    I'm Using Maven Project, I have Configured Jenkins with Maven and My Build is successful but Channel is not getting Stopped, hence i'm not able to execute next build...
    Thanks

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Subhash make sure in goal always give mvn clean install test

  • Nishant Raj
    Nishant Raj 2 years ago

    While running Maven I m getting error on console
    Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project com.learnautomation.selenium: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process

  • Nidhi Mobile and Cosmetic Zone

    Hi Mukesh, I have a quick doubt. For the sample selenium project (verify title) you have used here, did you add external jar files for TestNg and Selenium? If yes, then why we are adding the same in the pom file as dependencies? Or am I missing something in my understanding?

    • Karthik Shellamuthu
      Karthik Shellamuthu 2 years ago

      when you say automatically we should mention the dependencies in the pom.xml file right ?

      In QA Automation testing what is exact use of Jenkins and Maven interns of scripting and executing the cases ? Sorry, If it was a silly questions.

    • Mukesh otwani
      Mukesh otwani  2 years ago

      Hi Nidhi, I have used maven project here which add all jars automatically.

  • Amit Kumar Gautam
    Amit Kumar Gautam 2 years ago

    Hi Mukesh, I got a good understanding from ur videos. I implemented the same . But i just want to put parameters from jenkins like browser specification etc.. plz reply for the same. You can give alternate way as well. Thanks.

  • Juan Ripoll
    Juan Ripoll 3 years ago +2

    Please move "Precondition 1" label because it can not be removed (close button is under information button)

  • Honza Hornych
    Honza Hornych 3 years ago

    Hi, at first thank you for nice tutorial :-)
    I'm little bit confused, because when i'm running test via maven job, browser window doesn't open, but test works - in console I see the name of element I'm finding by xpath and printing to log. Do you know, what happening? :-) It's really weird.
    Thank you.

    • Mukesh otwani
      Mukesh otwani  3 years ago

      Hi Honza does your test runs in headless mode? For me Its runs normally like UI comes and close.

    • Mukesh otwani
      Mukesh otwani  3 years ago

      Hi Honza does your test runs in headless mode? For me Its runs normally like UI comes and close.

  • aashish mathur
    aashish mathur 3 years ago

    Hi Mukesh, I am getting this error.
    ERROR: A Maven installation needs to be available for this project to be built.Either your server has no Maven installations defined, or the requested Maven version does not exist.
    And under Manage Jenkins>configure systems, JDK installation section is not present. Also under Maven Project Configuration, it is asking for Global MAVEN_OPTS, so i am confused where to specify MAVEN_HOME environment.
    I am using the latest jenkins war 8.7.1 LTS release. Could this be the reason?

    • aashish mathur
      aashish mathur 3 years ago

      I tried running the previous version Jenkins 1.6 and all options are there. But i want to learn the newer version as well.

    • aashish mathur
      aashish mathur 3 years ago

      *Version is 2.7.1

  • vikram reddy
    vikram reddy 3 years ago +2

    Hi Mukesh...I really like the way you explain about automation in the videos. Your channel has become one stop solution for me. Thanks for posting the videos,it helped me a lot in the interviews. Keep up the good work :)
    Also I have the below doubt.
    I have been going through Selenium Integration With Jenkins. There we create a lib folder in our project directory and add all the jars that are required for execution. And then we set class path for bin and lib folders.
    However if use Maven do we still need to create a lib folder in project directory to integrate it with Jenkins. My vague guess is YES as we give the folder names on run.bat file.
    Could you clarify this one pls.
    Best Regards,
    Vikram.

    • Mukesh otwani
      Mukesh otwani  3 years ago +2

      Hi Vikram for maven do not use run.bat you can directly pass pom.xml and it will start the execution.

  • Jumana Almasri
    Jumana Almasri 3 years ago

    Hi Mukesh, thank you for your efforts on this :)
    can you send me which video explains the xml file setup?

  • MR KODE
    MR KODE 3 years ago

    Using Maven can we execute multiple "testng.xml" ,in pom.xml @mukesh otwani

    • Mukesh otwani
      Mukesh otwani  3 years ago

      +VENKATESH KODE yes Venkatesh you can pass multiple xml as well. Cheers

  • ansar hossain
    ansar hossain 3 years ago

    Hi Mukesh, First of all, I would like to thank you for uploading these outstanding tutorials on the web. I have visited many tutorial sites, but I could not find a single one that is so easy to follow as yours. I am new to Selenium Webdriver, and most of what I have learned, just following your blogs. I would like to know if you have any video implementing (POM) in data driven framework? Also, I came across one problem in Maven build. When run the build, everything passes, and it shows, "build success", however, it does not open the browser. I was reading the comments, and someone else have mention the same thing. Please help me out, this is my humble request to you.

    • Mukesh otwani
      Mukesh otwani  3 years ago

      +ansar hossain Hi Ansar thanks for nice feedback. It runs it headless mode try to capture screenshot so that you can treck

  • Devon Jones
    Devon Jones 3 years ago

    I'm getting a build but no tests are being executed :(. And even though I put my pom.xml in my Jenkins workspace I'm getting /Users/Shared/Jenkins/Home/jobs/Selenium_Application/workspace/pom.xml is not inside. When I specified the path to the pom in my project, I got pom not found