Nowadays, everything seems to be integrated, and that includes software testing. One perfect example would be the capacity to integrate Jenkins with Selenium. Jenkins Selenium Integration is a Continuous Integration (CI) Tool that is intended to support you in running the test in a simple and easy manner. It allows the user to run a full lateral testing during the build process. Nonetheless, if you are new to using this tool, there are few challenges that you may encounter. There are instances when it will take some time for the build to run and there are also several maintenance works involved in the process.
Step-by-Step Guide on How Jenkins Selenium Integration Works
[Tweet “Here’s a step-by-step guide on how to integrate Jenkins to Selenium Webdriver.”]
In order to help you run the Jenkins Selenium Integration, this step-by-step guide will help you to complete the entire testing procedure effortlessly.
Download Jenkins
Start by opening your web browser and head to the official site of Jenkins. This guide is intended for people who are using the 1.6 version of the tool. Choose the .war file and save it in your computer. After the download has been completed, you should have the Jenkins.war that we will use in the Selenium Integration.
Configuring Jenkins
Go to the folder where you saved Jenkins.war. Open the command prompt and navigate to the home directory and start the tool server. Once the command prompt shows a notification that the server is running, you many now configure the Jenkins Selenium Integration to conduct the test case. This will also allow Jenkins to successfully identify similar tools such as Maven and Java. Open your browser and head to http://localhost:8080. Click the Manage-Jenkins section and choose Configure System. Find the JDK option and click ADD JDK. Make sure the Install Automatically box is unchecked. Specify the name and the path of the JDK. Email Notification section is only optional, but you may also configure it based on your preference.
Executing Selenium Build Using Jenkins
The first step in this section of Jenkins Selenium Integration is to create a batch file. This should allow you to execute the test files of testing.xml. Open command prompt and type the command “Home directory > set classpath=C:\Users\Learn-automation\bin;C:\Users\Learn-automation\libs\*;”(without the quotes). Make sure to make changes depending on your system. Open your notepad and copy the command ‘java -cp bin;libs/* org.testng.TestNG testng.xml’. Save the notepad as .bat file.
Again open your browser and head to localhost:8080. This time, you will choose the new item section. Choose a name for the Job and choose the freestyle build before clicking on the Ok button. Find the Advanced Project Section and tick the custom workspace. On the directory box, input the home directory of your Selenium Integration project. Head to the Build section and choose the option ‘Execute Windows Batch Command’. This will allow you to specify the .bat file that you just created. Click Apply before finally choosing Save.
Run Jenkins Selenium Integration
Finally, you may now run the Jenkins Selenium Integration. Choose Build Now on the localhost:8080 and analyze the Console Output and Build History. You will notice that Jenkins also comes with functionality that allows you to schedule the tool for regular execution.