Code 0xc0000005 CasperJs Phantomjs - phantomjs

We got this error on the command prompt
"# waitForExec() tests
Fatal Windows exception, code 0xc0000005.
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report."
Can someone help we with that?
I installed phantomjs, slimerjs and casperjs with node (node install -g).
phantomjs version: 2.1.1
slimerjs version: does not even start properly, complaining about the FireFox version not being compatible
casper version: 1.1.4

Related

SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75

I'm trying to start a selenium webdriverinstance, but I get this error:
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75 with binary path *path here*
I already tried using chromium 98, it works, but a new vulnerability was found in version 100 and i would like to update
This error message...
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75 with binary path...
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chrome=100.0.4896.75
You are using chromedriver=97.0
Release Notes of chromedriver=97.0 clearly mentions the following :
Supports Chrome version 97
So there is a clear mismatch between chromedriver=97.0 and the chrome=100.0.4896.75
Solution
Ensure that:
ChromeDriver is updated to ChromeDriver v100.0.4896.60 level which matches to chrome=100.0.4896.75.
On a mac M1, I was getting the following error:
Selenium::WebDriver::Error::SessionNotCreatedError:
session not created: This version of ChromeDriver only supports Chrome version 103
Current browser version is 105.0.5195.125 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
(Driver info: chromedriver=103.0.5060.134 (8ec6fce403b3feb0869b0732eda8bd95011d333c-refs/branch-heads/5060#{#1262}),platform=Mac OS X 12.5.1 arm64)
I simply upgraded the chromedriver using brew and it fixed the issue for me.
brew upgrade chromeDriver
In case this helps others, yum install chromium installed Chromium version 102 while npm install -g chromedriver installs version 103, which requires chromium version 103.
I'm sure rolling back to older versions is not the best solution, but for me, installing the complementary version of chromedriver got things running on my system. To install the older version of chromedriver that would align with the chromium version installed by yum, I first went here https://chromedriver.chromium.org/downloads and copied the version number for 102 (in this case 102.0.5005.61)
Then, installing the "correct" version of chromedriver was accomplished by running
CHROMEDRIVER_VERSION=102.0.5005.61 npm install -g chromedriver
Just in case if both Chrome browser version and ChromeDriver versions are in sync, then maybe you should look for the directory from where you project is invoking it, means there could some other directory from where ChromeDriver is being executed and whose version is incompatible with the browser.
In my case, my VS Code was picking up ChromeDriver from project's directory node_modules/.bin/ChromeDriver, so i replaced this with the latest and it worked.
For me the problem was that i updated the chromedriver to the newest chrome version via:
npm run e2e:update-webdriver which executes: webdriver-manager update --gecko false
Therefore, the chromedriver version was higher than the chrome browser version. To fix this discrepancy I had to run:
sudo apt-get update and then sudo apt-get --only-upgrade install google-chrome-stable
Hope this helps someone!

Chromedriver can’t be opened because Apple cannot check it for malicious software

Environment:
OS : Big Sur 11.1
Homebrew 3.2.13
Python 3.9.7
Command:
chromedriver —version
Error GUI Alert:

Error via output of .py file attempt to run chromedriver:
raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: Service /opt/homebrew/bin/chromedriver unexpectedly exited. Status code was: -9
Fix Method (1)
As stated in the alert, try updating chromedriver:
Uninstall the current version:
brew uninstall chromedriver
Verify that chromedriver is uninstalled:
brew info chromedriver
Install the newest version of chromedriver:
brew install chromedriver
You can also try:
brew reinstall chromedriver
Fix Method (2) : Still Stuck
If you are still experiencing the issue, this fix helped me.
Determine which chromedriver is being used, run:
which chromedriver
Result :
/opt/homebrew/bin/chromedriver
Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver
Now run the following:
chromedriver —version
Result :
ChromeDriver 93.0.4577.63
Chromedriver should successfully execute.
Reference
coorasse's answer.
For downloading from the chrome drive website
this one worked for me for MAC m1 chip
Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine path/to/chromedrive
I had the same issue this morning, this is what fixed it for me.
Go to the system and preferences -> security and privacy.
Then under general tab you will see a notification that about the
exec you are trying to open.
Just click "open anyway" there.
Go back to the chromedriver exe and open it it will then give you the same error but along with that you will get an option to open it.
Click Open and it should resolve.
Worked for me.

ChromeDriver unzipping 85.0.4183.38 version instead of 84.0.4147.89 using WebdriverManager for Selenium Protractor

I am trying to execute webdirver-manager update command. But chrome driver unzipping 85.0.4183.38 instead of 84.0.4147.89 as my chrome browser version is 84.0.4147.89.
I tried the following:
Webdriver-manager update --version.chrome=84.0.4147.89
a. Downgrading the driver for browser compatible version.
Uninstalling & reinstalling Chrome
Uninstalling & reinstalling chromedriver / protractor / webdriver
Webdriver-manager update --version.chrome 2.28
a. Downgrading the driver for browser version 54+
Still I am getting the error:
E/launcher - session not created: This version of ChromeDriver only supports Chrome version 85
Please help on this.
This isn't the usual case when you use Protractor. However as per the discussions in:
Protractor 7.0.0 only supports chrome verison 85, while chrome version is 85 (error)
webdriver-manager update downloads an incompatible version of chromedriver
As of now there seems to be some discrepancy in downloading the latest stable ChromeDriver. The ChromeDriver - WebDriver for Chrome repository clearly suggests:
Current stable release: ChromeDriver 84.0.4147.30
Current beta release: ChromeDriver 85.0.4183.38
So as the current google-chrome browser version is Version 84.0.4147.89, ChromeDriver 84.0.4147.30 should have been downloaded and installed.
Solution
As per #Fuun347's comment the solution is to:
Add version arguments to the webdriver-manager update and start commands. Updating and starting your webdriver with these commands will force the version to always be 84:
webdriver-manager update --versions.chrome=84.0.4147.30
webdriver-manager start --versions.chrome=84.0.4147.30
Note: Running ng e2e --project=e2e-no-serve --specs=./src/service/ --webdriverUpdate=false will stop the angular-cli from trying to update the webdriver.
Further, #TylerNielsen in his comment added:
The following worked for us:
We have webdriver-manager installed as project dependency.
we call webdriver-manager update --versions.chrome 84.0.4147.30 prior
to running our tests. This will install the 84 chromedriver version in
./node_modules/webdriver-manager/selenium/. (We just made this as a
npm script in our package.json)
We then update the protractor.conf file to have this line in the root
of exports.config:
chromeDriver:"./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe"**
Protractor still installs chromedriverr 85, but it will use the 84
version.
In our case, we run our protractor tests in docker, but develop mostly on windows. So I updated the protractor.conf to have this line
so that it works in either: chromeDriver: process.platform === "win32"
?
"./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe"
:
"./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30"
Please re download chrome driver exe according to your browser version (https://chromedriver.chromium.org)Your browser versions are updating time to time so you need to use exact driver exe.

Running selenium-chromedriver using Protractor on linux

I am using protractor to run tests against an Angular application. They work on my OSX environment but not on Linux where TeamCity is trying to run it.
When I run this command on my local OSX environment, it works (tested on my co-workers machine, too):
./node_modules/protractor/bin/protractor protractor.conf.js
Using ChromeDriver directly...
..
Finished in 5.55 seconds
2 tests, 2 assertions, 0 failures
When I run this on a linux machine, or a TeamCity job tries to run it, it fails:
./node_modules/protractor/bin/protractor protractor.conf.js
Using ChromeDriver directly...
/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/http/util.js:87
Error('Timed out waiting for the WebDriver server at ' + url));
^
Error: Timed out waiting for the WebDriver server at http://127.0.0.1:52959/
at Error (<anonymous>)
at onResponse (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/http/util.js:87:11)
at /usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/http/util.js:42:21
at /usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/http/http.js:96:5
at ClientRequest.<anonymous> (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:136:7)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:49)
at Function.webdriver.WebDriver.createSession (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:111:30)
Attempts to resolve:
I have looked at this issue, but a standalone webdriver server is no solution.
I looked at this issue but my version of selenium-wedriver is 2.42.1, so, not the same bug.
Versions:
$ node --version
v0.10.26
$ ./node_modules/protractor/bin/protractor --version
Version 1.0.0
$ uname -mrs
Linux 3.11.0-15-generic x86_64
Progress Update:
Trying to get the version of chrome-webdriver exposed a problem:
$ ./node_modules/protractor/selenium/chromedriver --version
./node_modules/protractor/selenium/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
From this I concluded there was a dependency issue and found that Selenium requires Chrome. (more).
I installed Chrome on the Linux box using steps like this:
sudo apt-get install libxss1 libappindicator1 libindicator7
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
This didn't work exactly like that, but after a few back and forths with dependencies and sudo apt-get install I think I got Chrome installed:
$ google-chrome --version
Google Chrome 36.0.1985.143
This made the chromedriver version work:
$ ./node_modules/protractor/selenium/chromedriver --version
ChromeDriver 2.10.267518
However, running Protractor still does not work:
$ ./node_modules/protractor/bin/protractor protractor.conf.js
Using ChromeDriver directly...
/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:109
var template = new Error(this.message);
^
UnknownError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.0-15-generic x86_64)
at new bot.Error (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:109:18)
at Object.bot.response.checkResponse (/usr/share/TeamCity/buildAgent/work/57bd89f9c9abb5d5/webapp/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
You need to be able to run Chrome or Firefox headless and for that you'll need to configure Xvfb among other things, otherwise Chrome will fail to launch without a proper $DISPLAY.
You could also use PhantomJS but, IMHO, what good does that to e2e testing since is not a real browser.
This is what I'm successfully using for continuous testing: https://github.com/elgalu/docker-selenium
I had the same problem and it resolved just after installing unity-gtk3-module !!
yum install unity-gtk3-module
Installing:
PackageKit-gtk3-module
Updating:
Installing for dependencies:
PackageKit-glib
adwaita-cursor-theme
adwaita-icon-theme
at-spi2-atk
at-spi2-core
cairo-gobject
colord-libs
gtk3
json-glib
libXevie
libgusb
rest
Updating for dependencies:
glib2
i hope this helps

PHPunit test failed with Yii framework

My local system is WAMP (win 8.1) with Yii 1.1.14.
I had installed PHPUnit by pear.(CMD: pear install phpunit/PHPUnit)
But the test failed.
Could someone give me some hint? Many thanks.
Following is the error message.
C:\wamp\www\trackstar\protected\tests>phpunit --version
PHPUnit 4.0.14 by Sebastian Bergmann.
C:\wamp\www\trackstar\protected\tests>phpunit unit/DbTest.php
PHP Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to o
pen stream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTest
Case.php on line 12
You have to install some extension, in this case Selenium. I assume you run selenium tests and that is you you have to extend that.
In Linux you would have to install it with
pear install phpunit/PHPUnit_Selenium
Not sure quite what the command is in Windows.