Master selenium java automation project with all necessary helpers, utilities and dependencies. Can be packaged as a JAR file and imported as dependency
1. Browser Factory:
Supported browsers: 1. Chrome 2. Edge 3. Firefox
Supported platforms: 1. Selenium grid 2. Selenoid 3. Browser Stack
There are 2 sub packages in browser factory: 1. Managers 2. Suppliers
Managers: This is responsible for the initiation and setup of the browser sessions: Local and Remote. Uses "WebDriver Manager" class for detecting the browser versions in the local or remote platforms, and downloading executable files necessary for initiation (No need to download .exe files)
Suppliers: This is responsible for verifying the browser name provided by the user in the properties file and trigger the respective manager class
Local execution: User needs to have property named browser/browser name and provide any of the following as values
browser/browserName= chrome/edge/firefox
Remote execution: User needs to have properties named 1. browser/browser name 2. platform 3. hub url and provide any of the follwing as vales
browser/browserName= chrome/edge/firefox
platform= selenium_grid/selenoid/browser_stack
hubUrl= http://<localhost/machine IP>:4444
NOTE: Every value in the property file needs to be in lowercase
2. Helpers:
This package consists of all the classes/methods necessary for:
-
Actions: within browser window and on elements
-
Actions: Keyboard and Mouse actions
-
Find element and elements
-
Java script executors
-
WebDriver waits
-
Snap shots: 1. In build methods 2. Using Shutter bug
-
Generate Random values
-
Read test data: 1. Yml files 2. Json files 3. Excel files
-
Extent Report
3. Utilities:
This class should contain methods that can be used for:
-
Encode
-
Decode
-
Current date and time
-
Local time
-
Current seconds and milliseconds
4. ENUMS:
Theses are mainly used to decide the behaviour of the framework
-
BrowserTypes: To decide against which browser execution has to be done
-
BrowserWindow: To decide the action to be executed within the browser window like (maximize, minimize, quit, close etc...)
-
Elements: To decide the action to be executed on an element like (click, clear, submit etc...)
-
LocateBy: To decide the locator by which element/elements to be located in the browser window
-
LocateRelativelyBy: To decide the locator by which element/elements to be relatively located in the browser window
-
PerformActions: Decide on the keyboard and mouse actions like (right click, double click, mouse over etc...)
-
RandomValues: To generate random vales of type (string, numbers, alpha numeric etc...)
-
RemotePlatforms: Decide on the remote platform for execution (selenium grid, selenoid, browser stack)
-
Scripts: Decide on the java script to be executed (scroll to bottom, scroll to top, page refresh)
-
WaitConditions: Decide on the webdriver wait condition (implicitly, pageload, clickable, visible, invisible etc...)
NOTE:
-
Place the test data files under src/test/resources
-
Extent config file: extent-config.xml under src/main/resources
-
Test report and snap shots by default will be created under src/test/resources