Automation framework with Build using Jenkins

It is a tool which is used for continuous integration testing.

Jenkins setup:

  • Click on this link : 
  • Click on ‘Long term support release’ tab .
  • Click on 'older but stable' then one pop-up will come to save the file & there in pop-up click ‘OK’ which will save Jenkins the war file .
  • In the Downloads folder, copy paste the downloaded file inside the project.
  • Open the command prompt (cmd) and go to project directory.
  • Then type command ‘java –jar jenkins.war’ & hit enter.
  • Once Jenkins server is loaded successfully it will display success message in command prompt as "Jenkins is fully up and running".
  • Now open the browser & enter the following URL in the address bar “local host:8080” which will display homepage of the Jenkins server.
  • Click on New Job & specify the job name,For ex: AutomationTestFramework 
  • Select the first radio button ‘Build a free-style software project’ then click on OK.
  • Click on ‘Advanced’ & select last checkbox 'use custom workspace' under ‘Advanced Project options’ section. 
  • Type the java project path in the directory (For ex- the java project path –C:\selenium\test\demoTest)
  • Go to Build section, there click on ‘Add Build Step’ & select ‘Execute Windows Batch Command’ & type ‘RunMe.bat’ in the command field.
  • Go down and click on Save button.
  • Now you are all set to use Jenkins. Click on Build Now. It will start the execution of your framework.

Some more steps after build creation:
1.  Developer clicks on ‘Build Now’ which will start the Build creation process once the build is created it will start Framework execution automatically.
2. Every time when we run the build, Jenkins will display a link under Build History.
3. when we click that link it will take us to Build details page where if we click on ‘Console output’ link it will display output of the Automation Framework which is printed on the command prompt.

Create RunMe.bat file - 

             i) open notepad
             ii) paste this command- java -cp bin;jars/* org.testng.TestNG testng.xml
             iii) save the file as RunMe.bat

No comments:

Post a Comment