1

I run an autotest. A browser opens without logging into my profile. The path to the profile was written in the arguments. What can be wrong? How can I run an autotest so that the browser opens with my profile?

test.js:

const { By, Key, until } = require("selenium-webdriver");
const webdriver = require("selenium-webdriver");
require("chromedriver");

var chromeCapabilities = webdriver.Capabilities.chrome();
var chromeOptions = {
    'args': ["/home/MyUser/.config/google-chrome/Default"] // chrome profile
};
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
driver.manage().window().maximize();

  try {
    await driver.get("http://www.google.com")       
  } catch (e) {
    console.log(e)        
  } finally {
    await driver.quit();
  }

0 Answers0