Closed Sjain01 closed 6 years ago
Yes, you can add the Chrome incognito
command line switch to line 17 of chromeDriver.js, so it looks like this:
'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;
};
@john-doherty - Thank you for your response, I used it but the browser still opens up in normal mode and not incognito. could you please advise.
I want to run my test in incognito mode, is it possible using this library.