When VPN is off chromedriver starts normally, first console app then chrome which is getting driven. But as I turn VPN on something is blocking it (chrome is getting blocked) with error:
OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:29885/'
Console app of chromedriver turns on normally with message:
Starting ChromeDriver 120.0.6099.109 (3419140ab665596f21b385ce136419fde0924272-refs/branch-heads/6099@{#1483}) on port 58072
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
I have read all answers related to this and similar topics on stack overflow and reddit and not any solution is helping me, I have also tried to change Chrome driver to Firefox driver with no help.
OS is Windows Server 2022, Chrome is 120.0.6099.130 (Official Build) (64-bit), Chromedriver is 120.0.6099.109, language is C#, VPN is Cyberghost 8
Tried everything from resolutions I have found similar to this problem, but nothing is helping every time it is the same error Cannot start the driver service on http://localhost:29885/' (port is random not fixed to 29885, just copied it from last error).
This is driving me nuts for 3rd day and need help if anyone have any suggestions I would appreciate it.
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = @"C:\Program Files\Google\Chrome\Application\chrome.exe
var driverService = ChromeDriverService.CreateDefaultService(@"C:\chromedriver\chromedriver.exe");
ChromeDriver driver = new ChromeDriver(driverService, options);
Tried:
Changing Chrome and chromedriver to Firefox with geckodriver.
Fixing ports
setting no_proxy argument for localhost
setting DebuggerAddress
EnvironmentVariable no_proxy for localhost
Every single time the error is the same. Cannot start the driver service on http://localhost:58094/