Trying to run tests on an existing Chrome browser using Selenium in C#. I'm doing this on my macbook.
Problem is that the c# code doesn't connect with the browser with the specified port. Instead the code keeps opening it's own browser. It shouldn't matter how many instances of chrome are running. It should only connect to the one with the port open, instead it timesout and appears to be looking for a different port than the one I specified.
Steps:
I manually open the chrome browser with a debugging port using the terminal:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9014
Then the C# code to attach to the browser and run a simple Selenium script:
var chromeDriverLocation = "/Users/jb/Projects/fjsdlfsdf/fjsdlfsdf/bin/Debug";
var options = new ChromeOptions();
options.DebuggerAddress = "localhost:9014"; // specifying the port of the existing browser
Driver = new ChromeDriver(chromeDriverLocation, options);
Driver.Navigate().GoToUrl("https://google.com");
But I get this error which refers to a completely different port:
OpenQA.Selenium.WebDriverException
The HTTP request to the remote WebDriver server for URL http://localhost:53678/session timed out after 60 seconds.