简体   繁体   中英

Selenium IEDriver / Firefox Driver browser location Error

unexpectedly I am experiencing this issue. I am trying to run my testcase. For Firefox or IE browser but I don't know where is the issue. It cannot find the browser location.

Selenium.WebDriver -Version 2.52.0
Selenium.Support -Version 2.52.0
Selenium.RC -Version 2.52.0
Selenium.WebDriverBackedSelenium -Version 2.52.0

It was working perfectly but soon after I updated my nupackages. I am having this issue. Also I tried to use previous version but now I am having same problem in that one as well.

Error:

IEDriver

IEDriver错误

FirefoxDriver Error

FirefoxDriver错误

Enviorment Variable

Installed Location:

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
C:\Program Files\Mozilla Firefox\firefox.exe

Make sure you're mentioning path of IEDriverServer executable in PATH variable of your system.

echo $PATH

https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

It happened to me as well. I tried to download older version from the below link and it worked. Let me know, if that helped. About IE I am trying to figure it out what should be the case.

Firefox version download

You don't need to alter your code. Also Anderson is right you probably might have downloaded x64 version and I think Selenium might be trying to find x86 version (in Program File) which might have caused the problem.

For IE Driver download it (32bit) LINK

After that your browser init need to be something like that:

InternetExplorerDriverService driverService = InternetExplorerDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;
driverService.LibraryExtractionPath = @"c:\drivers\"; // here is your driver location

InternetExplorerOptions options = new InternetExplorerOptions();
options.EnableNativeEvents = true;
options.IgnoreZoomLevel = true;
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;

driver = new InternetExplorerDriver(driverService, options, TimeSpan.FromSeconds(180));

For Firefox just try to update the firefox to last version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM