selenium-webdriver

Selenium e2e setup

Introduction#

This topic covers the end to end setup of Selenium i.e. Selenium Webdriver + TestNG + Maven + Jenkins.

For report addition, please refer to topic https://stackoverflow.com/documentation/selenium-webdriver/10721/html-reports#t=201707081717056475251

TestNG Setup

TestNG is your updated test framework for junit. We are going to utilize testng.xml for invoking test suites. This is helpful when we are going to use CI ahead.

testng.xml

In the root folder of your project create an xml file with the name testng.xml. Note that name can be different as well, but for convenience its used as “testng” everywhere.

Below is the simple code for testng.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Smoke"> //name of the suite 
    <test name="Test1"> //name of the test
        <classes>
            <class name="test.SearchTest">
            <methods>
                <include name="searchTest"/>
            </methods>
            </class>
        </classes>
    </test>
</suite>

Maven Setup

TBD. How to setup pom.xml for calling testng.xml

Jenkins Setup

TBD. Will cover the Jenkins setup for pulling code from git/bitbucket etc.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow