Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
281 views
by The go-to Tester (391 points)
retagged by
How may I run my Selenium WebDriver scripts with Jenkins or Semaphoreci?
by The go-to Tester (181 points)
I've answered your query assuming that you are using a Windows machine. I have not used Semahoreci.

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)
High level steps for Windows machine and Jenkins:
1.) Download and setup Jenkins.
2.) Install Git
3.) Setup JDK with Jenkins
4.) Install Maven
5.) Setup the Job
 
1.) Download and Setup Jenkins.
 
Minimum Recommended Configuration:
  • Java 7
  • 256MB free memory
  • 1GB+ free disk space
Steps: 
  • Download Jenkins from https://jenkins.io/index.html
  • User java -jar jenkins.war command to start Jenkins.
  • Wait for a while while Jenkins prepare itself to start.
 
Once Jenkins is started, you can go to http://localhost:8080 to see Jenkins dashboard.
 
Jenkins is initially configured to be secure on first launch. Jenkins can no longer be accessed without a username and password and open ports are limited. During the initial run of Jenkins a security token is generated and printed in the console log:
 
*************************************************************
 
Jenkins initial setup is required. A security token is required to proceed.
Please use the following security token to proceed to installation:
 
41d2b60b0e4cb5bf2025d33b21cb
 
*************************************************************
The install instructions for each of the platforms above includes the default location for when you can find this log output. This token must be entered in the "Setup Wizard" the first time you open the Jenkins UI. This token will also serve as the default password for the user admin if you skip the user-creation step in the Setup Wizard.
 
2.) Install Git
Download and install Git binary from: https://git-scm.com/downloads
Kindly make sure that you can execute git commands from your command prompt. You may have to adjust your PATH environment.
 
3.) Setup JDK with Jenkins
Assuming that you have installed JDK.
  • Click Manage Jenkins
  • Click Configure System
  • On above page click Add JDK and uncheck Install Automatically. Set locaction to your JDK.
 
4.) Setup Maven:
  • Click Add Maven and uncheck Install automatically 
  • Now download maven binary from https://maven.apache.org/ and extract it at the location of your choice.
  • Set location to Maven by adding Maven and setting up the location
 
5.) Setup the Job
 
In this answer I am going to use my OrangeHRM project hosted on Github. https://github.com/qamate/orangehrm-selenium-automation. This projects uses maven. 
 
Here are the steps:
 
  • Navigate to http://localhost:8080/jenkins
  • Click Click New Job
  • Select Build a free-style software project option, enter Job name value and click OK
  • In the Source Code Management section select Git option
  • Enter Repository URL – for this test let’s use https://github.com/qamate/orangehrm-selenium-automation.git
  • In the Build section select Invoke top-level Maven targets
  • Enter clean install in the Goals field
  • Click Apply and then Save
  • On the next screen click Build Now button
  • In the Build History section a new build has appeared
  • Move your mouse over it and select Console Output item – you can see how project is being cloned and build.

Hope that helps. Post your feedback in comments.

mayur


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...