• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Advance Selenium / Basic guide to Import and export jobs in jenkins and Selenium

Basic guide to Import and export jobs in jenkins and Selenium

May 2, 2016 by Mukesh Otwani 14 Comments

Import and export jobs in Jenkins

Hello everyone welcomes back once again to Selenium Webdriver tutorial series. Today we will discuss how to Import and export jobs in Jenkins using CLI (Command line interface).

If you are completely new to Jenkins then you must have to visit below post.

Selenium Integration with Jenkins.

Get more information about CLI

 

Tips for Import and export jobs in jenkins

1- When you have multiple instances of Jenkins and you want to import and export some jobs then you can try below methods.

2- You can backup all Jobs using CLI which is most important

 

Follow below steps Import and export jobs in jenkins

Export the job

Step 1- Open Jenkins and Go to the job which you want to export.

Copy the name and store somewhere

Click on Manage jenkins options

import and export jobs in Jenkins 1

 

Step 2- Click on Jenkins CLI which will open CLI window

import and export jobs in Jenkins 2

 

Step 3- Now download CLI Jar as shown below and save in drive

Notes- We will use some commands which will help us to do our job.

get-job- this will export the job in XML file.

create-job – this will import the job from XML and will create job in Jenkins.

import and export jobs in Jenkins 3

 

Step 4- Once you have jar ready use below command to export job in XML format.

[pullquote align=”normal”]java -jar jenkins-cli.jar -s http://url-of-server get-job myjob > myjob.xml [/pullquote]

 

import and export jobs in Jenkins 4

 

Step 5-  Once job exported you can check the job in below location in your local system

 

C > User > Your UserName > xml which we createdimport and export jobs in Jenkins 6

 

Import the job in Jenkins

 

Step 6-  Now we can use below commands to upload or create new job in jenkins.

[pullquote align=”normal”] java -jar jenkins-cli.jar -s http://url-server create-job newjobname < xml-want-upload.xml [/pullquote]

 

import and export jobs in Jenkins 7

 

Step 7- Once you are done check Jenkins and you will get new job ready.

 

I hope you have enjoyed this article. If you have any doubt then post in our Selenium forum.

Please comment below for any feedback.

 

Filed Under: Advance Selenium

Reader Interactions

Comments

  1. sarah says

    April 1, 2021 at 3:50 AM

    Do you have more article about Jenkins CLI? i am looking to export the build status to CSV

    Reply
    • Mukesh Otwani says

      April 1, 2021 at 6:03 AM

      Hi Sarah,

      There are more videos on Jenkins CLI in pipeline. I’ll post them soon, please stay tuned…:)

      Reply
  2. Pranoy says

    May 3, 2019 at 12:08 PM

    Nice article!

    Reply
    • Mukesh Otwani says

      May 3, 2019 at 1:19 PM

      Thanks bro…:)

      Reply
  3. samba says

    May 2, 2019 at 3:31 PM

    Hi Mukesh Otwani,

    I am getting the following error while exporting
    ERROR: anonymous is missing the Overall/Read permission

    Reply
    • Mukesh Otwani says

      May 2, 2019 at 8:49 PM

      Hi Samba,

      Are you doing jobs import between different verions of Jenkins?

      Reply
  4. Priyanshi Ahuja says

    August 29, 2016 at 5:01 PM

    Please suggest me, Which is good approach to design Framework. Data Driven or Hybrid … Currently I am learning Selenium Tutorials online ….. But I think i need some training ….

    Reply
    • Mukesh Otwani says

      September 8, 2016 at 1:27 AM

      Hi Priyanshi,

      Hope below course will help you http://learn-automation.usefedora.com/courses/selenium-frameworks-and-selenium-question-answers

      Reply
  5. Preetish Kumar Mahato says

    August 27, 2016 at 6:44 AM

    i am facing problm java -jar jenkins-cli.jar -s http://url-of-server get-job myjob > myjob.xml is not working somewere i am geting wrong.. can u plzs help me mukesh .

    Reply
    • Mukesh Otwani says

      August 27, 2016 at 3:11 PM

      Hey Preetish,

      Above is just a syntax have u made the changes like url and other things.

      Reply
  6. Hadeel says

    July 27, 2016 at 8:11 PM

    Hi Mukash ,

    I’m facing problems in running my test through Jenkins to a server using chrome driver as the following error keep showing : org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages
    Can you help me in this ?

    Reply
    • Mukesh Otwani says

      August 2, 2016 at 12:42 PM

      Hey Hadeel,

      Which version of Selenium you are using. Selenium 3 is released so you can update Selenium and try again.

      Reply
  7. sahil says

    July 21, 2016 at 9:45 AM

    Hi Mukesh,

    Could create a video tutorial for Jenkins CLI because i don’t know how to set up CLI and backup all Jobs.

    Thanks
    Sahil

    Reply
    • Mukesh Otwani says

      July 25, 2016 at 12:23 PM

      Hey Sahil,

      Here you go http://learn-automation.com/selenium-integration-with-jenkins/

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Best and easy way to Group test cases in selenium

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?