I want to attach selenium to an existing session of chrome using the debuggerAddress experimental option. How can I achieve this in Selenium JS?
Here's the command that I use to run the chrome session:
google-chrome --remote-debugging-port=9222 --user-data-dir="path/to/user/data"
Here's the JS code that I'm using to connect to that session:
let options = new chrome.Options();
options.addArguments("debuggerAddress=localhost:9222")
let driver = await new Builder()
.setChromeOptions(options)
.forBrowser("chrome")
.build();
await driver.get('https://www.google.com');
Which is not working but instead creates and connects to a new chrome window.