public void start() {
        if (!isStarted()) {
            if (getEndpointConfiguration().getWebDriver() != null) {
                webDriver = getEndpointConfiguration().getWebDriver();
            } else if (StringUtils.hasText(getEndpointConfiguration().getRemoteServerUrl())) {
                webDriver = createRemoteWebDriver(getEndpointConfiguration().getBrowserType(), getEndpointConfiguration().getRemoteServerUrl());
            } else {
                webDriver = createLocalWebDriver(getEndpointConfiguration().getBrowserType());
            }

            if (!CollectionUtils.isEmpty(getEndpointConfiguration().getEventListeners())) {
                EventFiringWebDriver wrapper = new EventFiringWebDriver(webDriver);
                log.info("Add event listeners to web driver: " + getEndpointConfiguration().getEventListeners().size());
                for (WebDriverEventListener listener : getEndpointConfiguration().getEventListeners()) {
                    wrapper.register(listener);
                }
            }
        } else {
            log.warn("Browser already started");
        }
    }
public void start ( ) { if ( ! isStarted ( ) ) { if ( getEndpointConfiguration ( ) . getWebDriver ( ) != null ) { webDriver = getEndpointConfiguration ( ) . getWebDriver ( ) ; } else if ( StringUtils . hasText ( getEndpointConfiguration ( ) . getRemoteServerUrl ( ) ) ) { webDriver = createRemoteWebDriver ( getEndpointConfiguration ( ) . getBrowserType ( ) , getEndpointConfiguration ( ) . getRemoteServerUrl ( ) ) ; } else { webDriver = createLocalWebDriver ( getEndpointConfiguration ( ) . getBrowserType ( ) ) ; } if ( ! CollectionUtils . isEmpty ( getEndpointConfiguration ( ) . getEventListeners ( ) ) ) { EventFiringWebDriver wrapper = new EventFiringWebDriver ( webDriver ) ; log . info ( "Add event listeners to web driver: " + getEndpointConfiguration ( ) . getEventListeners ( ) . size ( ) ) ; for ( WebDriverEventListener listener : getEndpointConfiguration ( ) . getEventListeners ( ) ) { wrapper . register ( listener ) ; } } } else { log . warn ( "Browser already started" ) ; } }
Starts the browser and create local or remote web driver.