Chromedriver.exe has stopped working when run from cmd - selenium-chromedriver

We were trying to add some selenium scripts on Jenkins but whenever we gave the command I was receiving an error "Chromedriver.exe has stopped working".
I moved chromedriver to another location, such as C:, to test it and I found that if I manually doubleclick it from the folder is working fine. But whenever I try to start it from the command prompt is giving me the error "Chromedriver.exe has stopped working".
Any ideas?
Environment: Windows 10 64bit

I have experienced the same issue. In my case it was explicit .quit() missing. This was only case with 32-bit Python, 64-bit Python was working fine even without it.
browser = webdriver.Chrome()
browser.get(url)
#do some work with the downloaded contents
browser.quit()

Related

Chrome nativeMessaging example fails on Windows

I downloaded the official Chrome nativeMessaging example to test it out.
To do this, I installed the app from chrome://extensions, by choosing Load Unpacked. No problems so far.
I then installed the host. I'm using Windows 7, so I ran install_host.bat, which claimed that "The operation completed successfully." However, when I go to chrome://apps/ and click the Connect button, I get this error:
Failed to connect: Native host has exited.
Is there some reason this would happen? Restarting Chrome did not fix the issue, nor did uninstalling and then reinstalling the host program.
(I noticed that native-messaging-example-host.bat requires Python 2, so I modified it to run Python 2 explicitly. If I run native-messaging-example-host.bat from the command line, it pops up a little example program of its own with a GUI and seems to work correctly.)
Turns out I was using a non-standard character in the path leading to the host executable. This wouldn't be a problem for any other program, but Chrome's native messaging API doesn't like it, I guess.
By the way, the documentation on setting up this example is near-nonexistent, but this stack overflow link has some useful info: Chrome Extension NativeMessaging 'connectNative' undefined

Chrome headless not completing, ever (Windows)

I'm struggling to get Chrome headless to do absolutely anything.
I've tried the simple 'getting started' here: https://developers.google.com/web/updates/2017/04/headless-chrome
This example: chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/
does nothing for me. No screenshot generated in the folder. (Was running CMD as Admin).
I've created a webapp (running in IIS on my PC) and set a breakpoint on its Index page. When I call the app using Chrome headless the breakpoint is triggered, but my 2nd (Console) app which created the Chrome headless instance never proceeds beyond the 'Navigate()' line.
The code from the console app:
IWebDriver webClient;
ChromeOptions option = new ChromeOptions();
option.AddArguments("--headless", "--disable-gpu", "--window-size=1920,1200", "--ignore-certificate-errors", "--no-sandbox");
webClient = new ChromeDriver(option);
webClient.Navigate().GoToUrl("http://localhost:49709/");
((ITakesScreenshot)webClient).GetScreenshot().SaveAsFile("ChromeScreenshot.png", ScreenshotImageFormat.Png);
Running:
Windows 7 64-bit
Chrome 64-bit 66.0.3359.139
ChromeDriver 2.38
What am I missing?
I've figured out what is causing the issue, but not why or a proper fix for it. Writing this here in case it helps someone in future.
I found by chance that a timeout error would eventually be thrown after 60 seconds:
The HTTP request to the remote WebDriver server for URL http://localhost:51660/session timed out after 60 seconds.
This error was being thrown on the creation of the ChromeDriver object. Note this is an error thrown by Selenium trying to communicate with the Chrome WebDriver, NOT the Navigate() command failing.
I discovered by complete chance that by removing the "--headless" parameter from the options makes everything works fine. I also found that another parameter "--remote-debugging-port=9222" causes it to fail completely, too.
I'm currently assuming these issues are specific to my environment rather than a bug in the ChromeDriver. But, still looking.

While using Selenium and chromedriver in JMeter, I get an error on chrome

I have inherited a JMeter performance testing script. There is a chromedriver section and an HTTPSampler section. The httpsampler section works fine. The chromedriver section runs into a problem. When I run it chrome pops up like this:
It does not move forward with any of the steps in the plan after that. Up until recently I've also been seeing the error
Error communicating with the remote browser. It may have died.
I am not seeing this now, so I don't know if it's just a difference in how the test is running or what.
The person I inherited this from was running it on a mac and did not get any of these problems. I saw it run with no errors at the same time I was getting them.
One solution I found was to add the --test-type flag to chromedriver. Unfortunately I cannot find a way to add that argument when running it through JMeter. I've tried adding both --test-type and -test-type to the end of the path to chromedriver.exe, but that did not work.
Does anyone have a solution for this?
The error might be due to conflict in chrome driver version. Please install the latest version of ChromeDriver from this link.
Latest version of Chrome Driver supports the browser version v56-58.

error using selenium chromedriver on windows 7 64 bit

I'm having trouble running Selenium with chromeDriver on Windows 7. I'm getting the following error:
Jan 27, 2016 11:52:57 AM org.openqa.selenium.os.UnixProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException:
Execution failed (Exit value: -559038737. Caused by java.io.IOException:
Cannot run program "C:\testproject\target\resources\chromedriver.exe"
(in directory "."): CreateProcess error=193, %1 is not a valid Win32 application)
Double clicking the driver outside of eclipse gives a windows error (not a valid Win32 application)
Is there some trick to getting it to work on a 64bit Windows 7 environment?
Maybe the ChromeDriver download was corrupted by a network error or something, so the chromedriver.exe is incomplete! Try downloading ChromeDriver again from https://sites.google.com/chromium.org/driver/
Killing chromedriver.exe instances from command prompt worked for me.
Before deleting current chromedriver and installing new .exe, you can try executing
Taskkill /F /IM chromedriver.exe
After a bit of reading around, it seems the ChromeDriver executable needs to be on your PATH. It's not enough to just point webdriver.chrome.driver at it, as presumably other processes need to be able to find it.
See https://sites.google.com/a/chromium.org/chromedriver/getting-started (under "Help WebDriver find the downloaded ChromeDriver executable"), also https://splinter.readthedocs.org/en/0.1/setup-chrome.html.
I meet the same error today, before today the selenium run correctly. I find this error is caused by my computer antivirus software, after closing antivirus software all is well.
I got this error due to properties file not exists as i am using it to store ChromeDriver.exe path.

WebStorm debug mode not working and get message Process finished with exit code -1073741819 (0xC0000005)

I have recently downloaded WebStorm 11.0.3 to run my Protractor test cases. My test cases run fine when run normally (i.e. run from run configurations) but when I try to run my test cases in debug mode nothing really happens and I get the following in the console:
"C:\Program Files (x86)\JetBrains\WebStorm 11.0.3\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" --debug-brk=58467 --nolazy c:\Users\daobrien15\AppData\Roaming\npm\node_modules\protractor\lib\cli.js conf.js
Debugger listening on port 58467
Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Process finished with exit code -1073741819 (0xC0000005)
When I run debug against Firefox it just launches the first run Firefox screen and does nothing. When I run it against Chrome it just loads a blank page with data:, in the URL bar and also does nothing.
I am using the following:
OS: Win 7 (64 bit)
Protractor: 3.0.0
Selenium webdriver: 2.48.2
Firefox: 35 as the latest was not working with my tests when run normally
Chrome: 47.0.2526.111 m (Latest)
Also I am running my selenium webmanager through the console. I get pretty much the same result if I use the directConnect option in my conf.js file:
directConnect: true,
Any help would be greatly appreciated.
I have had same problem.
Check version of node.js in your webstorm terminal: node --version
My version was 5.2 and I had this bug.
Today I update node to 5.5.0(last stable) and this problem gone.
NOTE: If you use Webstorm 9 or 10 go to
C:\Program Files (x86)\JetBrains\WebStorm 9.0\bin
and open WebStorm64.exe.vmoptions and WebStorm.exe.vmoptions and in the end set
-Dnodejs.debugger.use.jb.support=false
this will help to stop on your breakpoint.
If you use Webstorm 11 you will not have this problem, but if you will - use fix for WebStorm 9/10.
Hope this will help you.
I have had some problem. I was tried #user3552 solution but not worked for me second time. I checked my node params and removed this param from my node params. This is working now.
--debug-brk=8081
Before removing one param my exec code was like this
/home/veysel/.nave/installed/5.0.0/bin/node --debug-brk=37621 -debug-brk=8081 --expose_debug_as=v8debug /opt/lampp/htdocs/kart/server.js 8080
After removing the last exec code like this.
/home/veysel/.nave/installed/5.0.0/bin/node --debug-brk=37621 --expose_debug_as=v8debug /opt/lampp/htdocs/kart/server.js 8080