I have tried the following three options . I am using C#
DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
capabilities.SetCapability("chrome.binary", "pathtogooglechrome\chromedriver.exe");
_remoteWebDriver = new ScreenShotRemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),
capabilities);
or
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = "pathtogooglechrome\chromedriver.exe";
capabilities.SetCapability(ChromeOptions.Capability, options);
_remoteWebDriver = new ScreenShotRemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),
capabilities);
or
System.Environment.SetEnvironmentVariable("webdriver.chrome.driver", "pathtogooglechrome\chromedriver.exe");
_remoteWebDriver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),
DesiredCapabilities.Chrome());
After the SetEnviromentVariable if i try the following code i get path of the ChromeDriver.exe
string temp = System.Environment.GetEnvironmentVariable("webdriver.chrome.driver");
I always get the same error System.InvalidOperationException : The path to the driver executable must be set by the webdriver.chrome.driver system property
I want know what i am doing wrong here, why path is not accepted?
Thank you in advance! If any alternative solution is available please let me know.