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

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

Related

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.

Chrome Automation Extension has crashed when trying to run protractor test

I am gaining experience with Protractor and am using the example test to see how it works. The test is located in xampp/htdocs/my-dev/test-automation-playground/poc-basic-integration-flow/node_modules/protractor/
In there we have a conf.js and an example_spec.js. To run the test, we enter the protractor folder using git bash, and type protractor conf.js.
When I try to run the example test provided by Protractor, my browser opens and I get the following error: Chrome Automation Extension has crashed.... See below:
And this is what it looks like in the browser:
I've looking into Chrome extensions and there is no such extension there. What could be causing this issue?
I simply start Git Bash without admin rights and I am not getting this error anymore. Also changing browser to Firefox in config resolves this issue most of the time.

Chromedriver.exe has stopped working when run from cmd

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()

Chromedriver failing to launch or connect

Up until today, I have been using chromedriver to drive my watir-webdriver tests, and I have had no problems. My server still works and runs tests on the same version of the chromedriver and chrome.
I have tried updating to the latest chromedriver, which is the chromedriver 2 experimental build. This fails due to what I can only assume are still bugs being worked out of it.
I have also tried rolling back to the previous version of chromedriver with no success.
If anyone has any experience with this, I would really appreciate your expertise. I am sure it will turn out to be something simple I have overlooked.
gem versions:
watir-webdriver (0.6.2)
selenium-webdriver (2.29.0)
cucumber (1.2.1)
trace from the chromedriver below
Started ChromeDriver port=9517 version=26.0.1383.0
log=C:\Projects\oms_acceptance_tests\src\chromedriver.log
[6136:5300:0212/122320:ERROR:master_preferences.cc(110)] Failed to read master_preferences file at C:\Program Files (x86)\Google\Chrome\Application\master_preferences. Falling back to default preferences.
[6136:5300:0212/122320:ERROR:gpu_info_collector_win.cc(82)] Can't retrieve a valid WinSAT assessment.
test\automation\proxy_launcher.cc(107): error: Value of: app_launched
Actual: 5
Expected: AUTOMATION_SUCCESS
Which is: 0
Error while awaiting automation ping from browser process
[0212/122321:ERROR:proxy_launcher.cc(556)] Failed to ConnectToRunningBrowser
[0212/122321:ERROR:automation_proxy.cc(319)] Channel error in AutomationProxy.
Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (Selenium::WebDriver::Error::UnknownError)
I would trying downloading newer version of chromedriver. Worked for me when I experienced similar issues.
To get rid of the gpu winsat error, try to update your display adapter.

Running Chrome WebDriver on a linux server with no display

I'd like to run automated tests using selenium2's chrome webdriver on a linux server.
I've already set up firefox to run on the server by using Xvfb (See http://www.semicomplete.com/blog/geekery/xvfb-firefox.html) and would like to do something similar with chrome. Is this possible?
I was facing the same challenge of setting a linux box with selenium + chromedriver,
and here's my notes:
Pre-reqs:
Install JRE to run the selenium jar
Install the selenium server
grab the jar file from https://code.google.com/p/selenium/downloads/list)
Install xvfb (you've seem to have already achieved this part)
Install google-chrome for your linux distribution
Download the chrome driver
You can grab it from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
Install other selenium dependencies that you might need (but the above is the minimum to get chromedriver to work)
To run:
Run xvfb
Xvfb :1 -screen 5 1024x768x8 &
export DISPLAY=:1.5
Run the selenium server jar with ChromeDriver options.
It'll look something like this:
java -jar selenium-server-standalone-2.30.0.jar -Dwebdriver.chrome.bin=/path/to/google-chrome -Dwebdriver.chrome.driver=/path/to/chromedriver
The selenium server log should output something similar to this:
Mar 19, 2013 10:07:27 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
Setting system property webdriver.chrome.bin to {location of google-chrome}
Setting system property webdriver.chrome.driver to {location of chromedriver}
10:07:34.258 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
10:07:34.259 INFO - Version Jetty/5.1.x
10:07:34.259 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
...
Reference:
http://www.yann.com/en/use-xvfb-selenium-and-chrome-to-drive-a-web-browser-in-php-23/08/2012.html
Cheers!
According to SetEnvironmentProperty to ChromeDriver programatically you can do the following:
service = new ChromeDriverService.Builder()
.usingChromeDriverExecutable(new File("/path/to/chromedriver"))
.usingAnyFreePort()
.withEnvironment(ImmutableMap.of("DISPLAY",":20"))
.build();
Here is the documentation for withEnvironment
I haven't been able to find a way to do this programmatically for the ChromeDriver like you can with the FirefoxBinary.
I've submitted a improvement request which has a patch attached to allow this. You can see it here: http://code.google.com/p/selenium/issues/detail?id=2673
Edit:
You can see below response from Stephen on how to use this now the change has been merged.: https://stackoverflow.com/a/16619608/998442
I get what you are trying to do, but you probably just run selenium grid. It was made for automated browser testing. Works great on a server.
https://www.selenium.dev/documentation/en/grid/