210 likes | 232 Views
Hi all, in this presentation I will explain the basic functionality Jerkin and Maven to execute it with Selenium with a predefined list of steps. These tools are very popular and well established for the Java ecosystem. So, I have set up a continuous integration process of Maven & Jenkins with selenium. Refrences: https://www.nexsoftsys.com/articles/maven-jenkins-selenium-integration.html
E N D
& Integration with Selenium
What is Jenkins? • Jenkins is one of the best open-source continuous integration tool produced by Hudson lab. • It is cross-platform and can be used on Windows, Linux, Mac OS and Solaris environments. • Jenkins is written in Java. • Jenkin's is mainly used to monitor any job which can be SVN checkout, cron or any application states. • It fires pre-configured actions when a particular step occurs in jobs.
What is Maven? • Maven is an automation and control tool produced by Apache Software Foundation. • Maven is a strong build automation tool specially used for Java projects. • Maven is based on the theory of a Project Object Model(POM) that combines project and configuration information like construction or source directory, province, test source list, plugins, etc.
Why Jenkins & Maven with Selenium? • Selenium WebDriver is a famous tool for browser automation. • But, when we use selenium for testing and building a test framework, it seems underpowered. • Maven integration with Seleniumgives the below advantages:
Maven with TestNg in Selenium Installation • Here we will use Eclipse (Juno) IDE for Java Developers integration • Also to do the build process and generate pom.xml file, we require to add an m2eclipse plugin to Eclipse Add m2eclipse plugins to Eclipse
Continue… 4 • Add WebdriverTest in Group Id: and Artifact Id: and then click on finish button
Continue… 5 • Eclipse will form WebdriverTest as shown below: • Eclipse will form WebdriverTest as shown below: 6
Continue… 7 • From Project Explorer, choose pom.xml
Continue… 8 • In the <project> node, add the Selenium, Maven, TestNG, Junit dependencies
Continue… 9 • Now create a New TestNG Class and add "example" in Package name and "NewTest" in the Name: textbox and then click on the Finish button • It will create a NewTest class
Continue… 10 • In NewTest class, add below code:
Continue… 11 • In NewTest class, add below code:
Continue… 12 • On the WebdriverTest, right click and choose TestNG >> Convert to TestNG. • Eclipse will generate testng.xml which states that you require to run only NewTest.
Continue… 13 • Now we require to run a test by this testng.xml. • So, go to the Run Configurations and create a new launch TestNG, choose the project and field Suite as testng.xml and click Run
Continue… 14 • Also, we require to add below files and plugins, • maven-compiler-plugin • maven-surefire-plugin • testng.xml • to pom.xml.
Continue… 15 • Now, to run the tests in the Maven lifecycle, on the WebdriverTest , right-click and choose Run As >> Maven test. Maven will execute test from the project.
Conclusion • So here we learn about what is the Maven and Jenkins? • Also learn the integration process of Maven and Jenkins with Selenium. • As a Fresher or experiences Software Tester, it will help you to perform this integration task step by step here. References: Integrating Maven & Jenkins with Selenium Maven & Jenkins Integration with Selenium: Complete Tutorial
Contact Us info@nexsoftsys.com +1-646-971-0799 www.nexsoftsys.com