Я хочу проверить расширение Chrome с помощью Selenium. Расширение Chrome выполняет оставшийся вызов API в фоновом режиме. но Selenium Chrome блокирует удаленное соединение.
Error
chrome_1 | Only local connections are allowed.
chrome_1 | Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
chrome_1 | [1553232680.777][SEVERE]: bind() failed: Cannot assign requested address (99)
chrome_1 | 05:31:25.002 INFO [ProtocolHandshake.createSession] - Detected dialect: OSS
Код для загрузки расширения
var sw = require('selenium-webdriver');
const path = require('path');
const extensionPath = path.resolve( __dirname, './assets/SampleExtension' );
var chromeOptions = sw.Capabilities.chrome();
chromeOptions.set("chromeOptions", {"args": ['--load-extension='+extensionPath, "--whitelisted-ips", "disable-gpu", "disable-infobars", "no-sandbox", "allow-insecure-localhost"]});
let driver = new sw.Builder().forBrowser('chrome')
.setChromeOptions(chromeOptions)
.usingServer('http://chrome:4444/wd/hub')
.build();
driver.get('https://samplewebsite.com/').then(() => {
console.log('web page open ')
});