async openBrowser (id, pageUrl, browserName) {
        if (!browserName)
            throw new Error('Browser not specified!');

        const browserProfile = _findMatch(browserName, /([^@:]+)/);
        const browser = _findMatch(browserProfile, /([^#]+)/);
        const version = _findMatch(browserName, /@([^:]+)/);
        const platform = _findMatch(browserName, /:(.+)/);
        const proxy = process.env.SELENIUM_PROXY || '';
        const builder = new Builder().usingWebDriverProxy(proxy).forBrowser(_formalName(browser), version, platform).usingServer(this.seleniumServer);
        const browserOptions = createBrowserOptions[browser];

        if (browserOptions && existsSync(this.capabilities)) {
            const caps = JSON.parse(readFileSync(this.capabilities))[browserProfile];

            if (caps)
                browserOptions(builder, caps);
        }

        let maxTries = Number(process.env.SELENIUM_MAX_TRIES) || 1;

        const retryInterval = Number(process.env.SELENIUM_RETRY_INTERVAL) || 5e3;

        let webDriver;

        // eslint-disable-next-line no-constant-condition
        while (true) {
            maxTries--;
            try {
                webDriver = await builder.build();
                break;
            }
            catch (e) {
                if (maxTries > 0)
                    await sleep(retryInterval);
                else
                    throw e;
            }
        }

        await webDriver.get(pageUrl);
        this.openedBrowsers[id] = webDriver;

        if (this.heartbeatInterval > 0)
            this.startHeartbeat(id, webDriver);
    }
/**
     * Open the browser with the given parameters
     * @param {number} id id of the opened browser
     * @param {string} pageUrl url to navigate to after creating browser
     * @param {string} browserName browser string in format 'browserName[@version][:platform]'
     */
Open the browser with the given parameters
@param {number} id id of the opened browser
@param {string} pageUrl url to navigate to after creating browser
@param {string} browserName browser string in format 'browserName[@version][:platform]'
Open the browser with the given parameters @param { number } id id of the opened browser @param { string } pageUrl url to navigate to after creating browser @param { string } browserName browser string in format ' browserName [ @version ] [ : platform ] '
async openBrowser (id, pageUrl, browserName) {
        if (!browserName)
            throw new Error('Browser not specified!');
        const browserProfile = _findMatch(browserName, /([^@:]+)/);
        const browser = _findMatch(browserProfile, /([^#]+)/);
        const version = _findMatch(browserName, /@([^:]+)/);
        const platform = _findMatch(browserName, /:(.+)/);
        const proxy = process.env.SELENIUM_PROXY || '';
        const builder = new Builder().usingWebDriverProxy(proxy).forBrowser(_formalName(browser), version, platform).usingServer(this.seleniumServer);
        const browserOptions = createBrowserOptions[browser];
        if (browserOptions && existsSync(this.capabilities)) {
            const caps = JSON.parse(readFileSync(this.capabilities))[browserProfile];
            if (caps)
                browserOptions(builder, caps);
        }
        let maxTries = Number(process.env.SELENIUM_MAX_TRIES) || 1;
        const retryInterval = Number(process.env.SELENIUM_RETRY_INTERVAL) || 5e3;
        let webDriver;
        while (true) {
            maxTries--;
            try {
                webDriver = await builder.build();
                break;
            }
            catch (e) {
                if (maxTries > 0)
                    await sleep(retryInterval);
                else
                    throw e;
            }
        }
        await webDriver.get(pageUrl);
        this.openedBrowsers[id] = webDriver;
        if (this.heartbeatInterval > 0)
            this.startHeartbeat(id, webDriver);
    }
async openBrowser ( id , pageUrl , browserName ) { if ( ! browserName ) throw new Error ( 'Browser not specified!' ) ; const browserProfile = _findMatch ( browserName , / ([^@:]+) / ) ; const browser = _findMatch ( browserProfile , / ([^#]+) / ) ; const version = _findMatch ( browserName , / @([^:]+) / ) ; const platform = _findMatch ( browserName , / :(.+) / ) ; const proxy = process . env . SELENIUM_PROXY || '' ; const builder = new Builder ( ) . usingWebDriverProxy ( proxy ) . forBrowser ( _formalName ( browser ) , version , platform ) . usingServer ( this . seleniumServer ) ; const browserOptions = createBrowserOptions [ browser ] ; if ( browserOptions && existsSync ( this . capabilities ) ) { const caps = JSON . parse ( readFileSync ( this . capabilities ) ) [ browserProfile ] ; if ( caps ) browserOptions ( builder , caps ) ; } let maxTries = Number ( process . env . SELENIUM_MAX_TRIES ) || 1 ; const retryInterval = Number ( process . env . SELENIUM_RETRY_INTERVAL ) || 5e3 ; let webDriver ; while ( true ) { maxTries -- ; try { webDriver = await builder . build ( ) ; break ; } catch ( e ) { if ( maxTries > 0 ) await sleep ( retryInterval ) ; else throw e ; } } await webDriver . get ( pageUrl ) ; this . openedBrowsers [ id ] = webDriver ; if ( this . heartbeatInterval > 0 ) this . startHeartbeat ( id , webDriver ) ; }
Open the browser with the given parameters
 @param {number} id id of the opened browser
 @param {string} pageUrl url to navigate to after creating browser
 @param {string} browserName browser string in format 'browserName[@version][:platform]'
Open the browser with the given parameters @param { number } id id of the opened browser @param { string } pageUrl url to navigate to after creating browser @param { string } browserName browser string in format ' browserName [ @version ] [ : platform ] '
// eslint-disable-next-line no-constant-condition