(Selenium web driver using c#)How to make the webdrivers.exe path to environment varibales in my local machine
-
Hi Gautham, Nice to see your article on Selenium webdriver using C# I have gone through one of your article-(Automated Testing Of Web Pages Using Selenium-Web Driver).In that i have few doubts 1.How to add the all(chrome,iedriver exe) files folder to enviornment variables in my local machine.Please take a look and help me on this issue. 2.I have written n ran code like below,getting error as source code not found.please see the screen shot also. public static IWebDriver InitializeDriver() { //if (WebDriver == null) // { //string DRIVER_PATH = @"C:\Web drivers\IEDriverServer.exe"; string browser = Convert.ToString(ConfigurationManager.AppSettings["BrowserType"]); switch (browser) { case "ie": WebDriver = new InternetExplorerDriver(@"C:\Web drivers\IEDriverServer.exe"); return WebDriver; //break; //case "FF": // WebDriver = new FirefoxDriver(DRIVER_PATH); // break; case "chrome": WebDriver = new ChromeDriver(@"C:\Drivers\BrowserDrivers\chromedriver"); return WebDriver; //break; default: WebDriver = new FirefoxDriver(); return WebDriver; //break; } // } }
-
Hi Gautham, Nice to see your article on Selenium webdriver using C# I have gone through one of your article-(Automated Testing Of Web Pages Using Selenium-Web Driver).In that i have few doubts 1.How to add the all(chrome,iedriver exe) files folder to enviornment variables in my local machine.Please take a look and help me on this issue. 2.I have written n ran code like below,getting error as source code not found.please see the screen shot also. public static IWebDriver InitializeDriver() { //if (WebDriver == null) // { //string DRIVER_PATH = @"C:\Web drivers\IEDriverServer.exe"; string browser = Convert.ToString(ConfigurationManager.AppSettings["BrowserType"]); switch (browser) { case "ie": WebDriver = new InternetExplorerDriver(@"C:\Web drivers\IEDriverServer.exe"); return WebDriver; //break; //case "FF": // WebDriver = new FirefoxDriver(DRIVER_PATH); // break; case "chrome": WebDriver = new ChromeDriver(@"C:\Drivers\BrowserDrivers\chromedriver"); return WebDriver; //break; default: WebDriver = new FirefoxDriver(); return WebDriver; //break; } // } }
I haven't written an article on Selenium so your message obviously isn't directed at me. I'm pretty sure none of the regulars here have either. When you have a question about an article, the correct place to ask your question is on the forum at the end of the article. Don't post in a random place hoping that the author will stumble across it.