July 2019
Intermediate to advanced
536 pages
12h 57m
English
The class should be named something obvious such as Driver.java, CreateDriver.java, SeleniumDriver.java, and so on. Since this will be a Java singleton class, it will contain a private constructor and a static getInstance method as follows:
/** * Selenium Singleton Class * * @author CarlCocchiaro * */@SuppressWarnings("varargs")public class CreateDriver { // constructor private CreateDriver() { } /** * getInstance method to retrieve active driver instance * * @return CreateDriver */ public static CreateDriver getInstance() { if ( instance == null ) { instance = new CreateDriver(); } return instance; }}
Read now
Unlock full access