V
V
Vitaly Arkhipov2015-08-28 23:43:58
Google Chrome
Vitaly Arkhipov, 2015-08-28 23:43:58

How to run 2 Chrome drivers in one profile on Selenium NodeJS?

I am writing tests, for speed I want the user to be already authorized (+ data is loaded into the local store).

import * as webdriver from 'selenium-webdriver';
import * as Chrome from 'selenium-webdriver/chrome';
var options = new Chrome.Options();

options.addArguments('--user-data-dir=C:\\profilepath');

var driver = new webdriver.Builder().withCapabilities(options.toCapabilities()).build();

driver.get("http://site.ru/").then(() => {
    console.log('Opened');
}, (err) => {
    console.log('Err', err);
});
var driver2 = new webdriver.Builder().withCapabilities(options.toCapabilities()).build();
driver2.get("http://site.ru/").then(() => {
    console.log('Opened');
}, (err) => {
    console.log('Error', err);
});

The first driver works, opens the page, the second just hangs the initial screen without errors. Running them in different processes doesn't help either...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question