john-doherty/selenium-cucumber-js

Execute test scripts in incognito mode

Sjain01 opened this issue · 0 comments

@john-doherty - First of all thank you for this amazing library.

Although I had already asked this question via #76 since the suggestion in there is not working and I cannot re-open it, I opened a new issue.

As per the suggestion, adding incognito under runtime folder in chromeDriver.js is not working.

` 'use strict';

var chromedriver = require('chromedriver');
var selenium = require('selenium-webdriver');

/**

  • Creates a Selenium WebDriver using Chrome as the browser

  • @returns {ThenableWebDriver} selenium web driver
    */
    module.exports = function() {

    var driver = new selenium.Builder().withCapabilities({
    browserName: 'chrome',
    javascriptEnabled: true,
    acceptSslCerts: true,
    chromeOptions: {
    args: ['start-maximized', 'disable-extensions','incognito']
    },
    path: chromedriver.path
    }).build();

    driver.manage().window().maximize();

    return driver;
    };`