Quality Testing

Quality is delighting customers

can you brief about How can we integrate Jenkins with Selenium WebDriver?

Views: 284

Reply to This

Replies to This Discussion

Check out SoftwareTestingMaterial site

There are too many possible options, mostly depending on what is your environment and technologies stack, build tool, Selenium client language, etc. 

Also instructions will be different depending on whether you use free-style projects or CI pipelines

Perfect reply Dmitri. Very helpful.

Thanks

At first, you can convert your project to Ant or Maven. 

Once your code is converted to Maven, you can download and setup Jenkins.

Once your Jenkins setup is ready, you can go to http://localhost:8080 on your web browser to access the Jenkins dashboard.

Configure Jenkins:

1.Go to Manage Jenkins->Configure System

2.Configure JDK

-Give the JDK name

-JAVA_HOME : C:\Program Files\Java\jdk1.7.0_45

3.Maven configuration

-Give a maven name

-MAVEN_HOME : C:\apache-maven-3.2.5\apache-maven-3.2.5-bin\apache-maven-3.2.5

4.Global Maven_OPTS

–Xmx512m

–XX:MaxPermSize=128m

5.Save once done

In Jenkins you can create new Job -> Select Maven project, enter project name -> click Ok

On the Job configuration page, enter SCM details and click on "SAVE" button.

Hope that helps!

HI,

At first, you can convert your project to Ant or Maven.

Link: how to convert a existing code into maven?

Once your code is converted to Maven, you can download and setup Jenkins.

Once your Jenkins setup is ready, you can go to http://localhost:8080 on your web browser to access the Jenkins dashboard.

Configure Jenkins:

1.Go to Manage Jenkins->Configure System

2.Configure JDK

-Give the JDK name

-JAVA_HOME : C:\Program Files\Java\jdk1.7.0_45

3.Maven configuration

-Give a maven name

-MAVEN_HOME : C:\apache-maven-3.2.5\apache-maven-3.2.5-bin\apache-maven-3.2.5

4.Global Maven_OPTS

–Xmx512m

–XX:MaxPermSize=128m

5.Save once done

In Jenkins you can create new Job -> Select Maven project, enter project name -> click Ok

On the Job configuration page, enter SCM details and click on "SAVE" button.

Click Here more information.

Jenkins is a java based continuous integration tool & it is widely used by software testing company engineers to automate the manual execution of running test suites.

Step 1: You can download the Jenkins from the official website: https://www.jenkins.io
Make sure you check the compatibility of the Jenkins version with the selenium web driver version you are using.

Step 2: Now download Jenkins.war file from the above-listed website, & you can place this jar file anywhere in the system, but usually better to keep in the project directory.

Step 3: Now run the Jenkins.war from the command prompt. Now open command prompt & navigate to project home directory and where war file was placed now Start Jenkins server with command: java -jar Jenkins.war


Step 4: Now the Jenkins server is up and running at 8080 port so you can navigate to the below URL for Jenkins UI, Open any browser and type the URL http://localhost:8080


Step 5: Now you need to configure the Jenkins from Manage jenkins>>Configure System link. Now under the JDL list the name as JAVA_HOME and Specify the JDK path. There are many settings you can configure like Email notifications etc.

Now that Jenkins is configured & good to integrate with your selenium web driver.

Step 6: You can execute your test suite in multiple ways. Like windows batch file having
'java -cp bin;libs/* org.testng.TestNG testng.xml'.

Now you can create a job in Jenkins which will execute build. Click on New item & provide the name & select Build a free-style software project and Click on the OK button.

Under the Advanced Project Options > Custom workspace & provide you project home directory.

Now specify the Add Build step & select Execute Windows batch command & specify the batch file name created earlier.

Now you can click on Build now to execute your test or you can schedule your job to execute.

Please do let me know if there are any doubts.

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service