I am trying to use an existing browser for debugging and I have used the below commands to open a browser session with a desired port.
chrome.exe --remote-debug-port=9014 --user-data-dir=****
A new browser window opens up but I guess chrome is not opened in that port as by opening http://localhost:9014 in any browser or tab , I only get the error message a below:
This site can’t be reached.localhost refused to connect.
I tried disabling the Firewall and also closing all the existing browsers and Flush DNS. Nothing works.
I also checked the ports using netstat -bano
and the port that I have used (9014) doesn't exist in the list. Which obviously means that the chrome window was not opened using my port.
Running Debug in VS also shows the below error and this also doesn't refer my port(9014) and shows a different port every time I run debug.
code:
ChromeOptions options = new ChromeOptions();
options.DebuggerAddress = "127.0.0.1:9014";
IWebDriver Driver = new ChromeDriver(options);
Driver.Navigate().GoToUrl("https://google.com");
OpenQA.Selenium.WebDriverException The HTTP request to the remote WebDriver server for URL http://localhost:53678/session timed out after 60 seconds.
Can someone help with this?