Selenium WebDriver - the driver does not work for me

I am trying to run Selenium tests. I am using C #. I have problems with all the drivers I tried.

Chrome

var options = new OpenQA.Selenium.Chrome.ChromeOptions(); options.BinaryLocation = @"C:\Users\Vilem\AppData\Local\Google\Chrome\Application\"; using (IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver(options)) { ... 

It looks like the chromedriver.exe file is detected, but it can find the Chrome binary. I set the path to chrome.exe explicitly after an automatic search. I even tried it with "chrome.exe" at the end. I always get the same result:

Could not find Chrome fraction:

C: \ Users \ Willem \ AppData \ Local \ Google \ Chrome \ Application

Firefox

 new OpenQA.Selenium.Firefox.FirefoxDriver(); 

I also tried it with a set of profiles:

 FirefoxProfile profile = new FirefoxProfile(@"E:\...\FirefoxProfile"); new OpenQA.Selenium.Firefox.FirefoxDriver(); 

The error I am getting is:

Unable to communicate with blocking port 7054 for 45,000 ms

IE

 var ieOptions = new InternetExplorerOptions(); ieOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true; new InternetExplorerDriver(@"C:\Program Files (x86)\IEDriver\", ieOptions); 

The driver folder is also set to PATH.

The error I am getting is:

 No response from server for url http://localhost:6955/session 

Is there something I am missing? I would be glad if any of them worked.

thanks

+3
source share
3 answers

Chrome and IE work for me, putting .exe for ChromeDriver and IE_driver in the / bin / folder project

Ref.

 VisualStudio2010/Projects/ProjName/ProjName/bin/chromedriver.exe 

Then when setting up my tests, I did:

 using OpenQA.Selenium.Chrome; ... private IWebDriver chrome; ... [SetUp] public void SetupTest() { chrome= new ChromeDriver(); baseURL = "url-goes-here"; verificationErrors = new StringBuilder(); } ... 

You can download .exe from here if you have not already

+1
source

Chrome

Could not find the Chrome binary:
C: \ Users \ Willem \ AppData \ Local \ Google \ Chrome \ Application

I think you need to specify the whole path, including the executable. like C:\Users\Vilem\AppData\Local\Google\Chrome\Application\chrome.exe (just guessing there is currently no access to the Windows machine)

Firefox

Unable to communicate with blocking port 7054 for 45,000 ms

You should not receive it forever. The quickest solution is to tell you without asking a lot of questions back: Reboot (or log out). If you still get this after a reboot, look at it for questions and maybe post your own.

0
source

You must specify the path, including .exe. So your code will look like this:

 options.BinaryLocation = @"C:\Users\Vilem\AppData\Local\Google\Chrome\Application\chrome.exe"; new InternetExplorerDriver(@"C:\Program Files (x86)\IEDriver\iexplore.exe", ieOptions); 
0
source

Source: https://habr.com/ru/post/920607/


All Articles