I have installed casperjs and phantomjs on my windows machina via npm. However I get this issue.
C:\>casperjs sample.js
C:\>Unable to open file: sample.js
Unsafe JavaScript attempt to access frame with URL about:blank from frame
with URL file:///C:/Users/vini/AppData/Roaming/npm/node_modules/casperjs/bin/bootstrap.js.
Domains, protocols and ports must match.
This is a known issue with CasperJS and the 1.9.8 version of PhantomJS. It doesn't do anything and the errors are only printed during exit. They don't interfere with your script. There is a workaround and it was merged into master branch on GitHub, but it is not available as a release of CasperJS yet (latest is 1.1-beta3).
The easiest way to solve this is to downgrade to PhantomJS 1.9.7. Since you're using NPM it is easily done with
npm -g install phantomjs#1.9.7-15
The PhantomJS versions match with the NPM phantomjs package versions up until 1.9.7, then everything breaks. You can check the versions with npm show phantomjs.
If you downgrade to version 1.9.7, you will have to run with the --ssl-protocol=any commandline option for sites that request https resources. The reason is shown in my answer here.
The proper way to solve this is to install a new version from git. This will enable you to not only use PhantomJS 1.9.8 without the additional error lines, but also PhantomJS 2 which would not be possible with CasperJS 1.1-beta3.
References:
GitHub issue #1068
Workaround for CasperJS #1139
PhantomJS issue on SO
Use
"phantomjs": "^1.9.9"
And for caseperJs
casperjs --ssl-protocol=tlsv1 test run.js
Related
I have followed these steps while installing the gnome extension of chromium in Ubuntu 20.04.
Installed the GNOME Shell integration extension on chromium.
As per their documentation ran a command to install chrome-gnome-shell
sudo apt-get install chrome-gnome-shell
Still while loading the gnome-extensions page, it is showing error that "Although GNOME Shell integration extension is running, native host connector is not detected. Refer documentation for instructions about installing connector."
Can anyone tell me how to resolve this issue in steps?
FYI: starting from Ubuntu 21.10 Firefox comes as a default browser and as a snap, as well as Chromium. And has the same problem: GNOME Shell integration shows the same error.
Other ways to install the extensions are:
gnome-extensions install --force your_downloaded_extension.zip
unzip your_downloaded_extension.zip ~/.local/share/gnome-shell/extensions/
Probably this is because you are running Chromium as a Snap. There is an open bug in Launchpad about this, that appears to still be happening in Ubuntu 20.04 (still happening in Ubuntu 22.04):
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1741074
The easiest solution would probably be to use another web browser, not in a Snap.
I experienced this issue when upgrading from Ubuntu 21.04 to Ubuntu 22.04 (Jammy Jellyfish), where Firefox was installed via snap - supposedly the sandboxing made it unable to detect.
My resolution (which brought back gnome extensions connector being seen) was to install firefox manually by debian package via the directions in https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/ . You may also be able to install the direct tarball following directions in https://fostips.com/install-latest-firefox-non-esr-debian/
Another option is to use a native extension manager as suggested in https://haydenjames.io/ubuntu-22-04-install-gnome-extensions-manager-workaround/
I solved using Chrome and not more Firefox for extensions.gnome.
(I use Chrome just for manage this extension)
If you still got problems, you could simply do this:
sudo apt-get reinstall chrome-gnome-shell
For me it did work after all, but just by using another browser - Firefox
I'm using Ubuntu 20.10 and I also had this issue. I was using Chromium but I found that Chromium dropped support for this, therefore I installed Firefox from the software. This did not work either.
The fix was to uninstall Firefox from software and install Firefox from ubuntu software with the source: ubuntu-groovy-updates-main
I installed the browser extension on there and it worked perfectly.
Aevin J He gave the answer if you're on ubuntu 21.10. it really matters whom you install it from. don't use the default one, use the one with most reviews
Why does this sign Error: No tests to run. Either the test files contain no tests or the filter function is too restrictive. always come out, if I already do these tests in the TestCafe Studio and did not give an error?
Also, I follow the Pluralsight course, wrote the same code an make the same steps, but still doesn't work.
The TestCafe window pops out but closes automatically after finishing the loading.
Why should I do, or try?
All fixed, was a version misunderstanding... with TestCafe 0.3.0 work immediately. Run
npm install testcafe-blink-diff#0.3.0 to install that version.
Also, I wasn't paying attention, cause the code I need it was on JavaScript, and I was writing down in TypeScript.
For some reason, my google chrome version was a problem too, so I change
Browser: Chrome 75.0.3770 / Windows 10.0.0 to Chrome 76.0.3809 / Windows 10.0.0
Background
I am tasked with replacing our IE based printing logic with Chromium so that we can eventually support running our current server software on Windows Server Core or potentially other operating systems that support .Net Core. My current thought is to either use Chromium embedded framework or to make use of Puppeteer. I am leaning towards the later because I feel it would be easier to port between operating systems.
Issue
Originally it failed to start with an error about sandboxing so I added the no-sandbox flag. Now when I try to load Chromium it fails to start with the exception below stating that it cannot load chrome.dll
PS C:\Program Files (x86)\Google\Chrome\Application>> .\chrome --headless --enable-logging --disable-gpu --screenshot="C:\screen.png" "https://www.chromestatus.com/"
Which yields the following error in the debug.log file:
[0813/133208.016:ERROR:main_dll_loader_win.cc(134)] Failed to load Chrome DLL from c:\Program Files (x86)\Google\Chrome\Application\68.0.3440.106\chrome.dll: The specified module could not be found. (0x7E)
I have checked around the internet and found a few mentions of this error but the suggested fixes don't seem to fix the issue.
I was able to download Chromium 72.0.3592.0 via Chocolatey and the issue is resolved in that version. I tested using Server Core 2016 LTSB.
choco install chromium --pre -y
chrome --headless --disable-gpu --dump-dom --enable-logging https://www.chromestatus.com/ --no-first-run
Edit:
If you are attempting to run Selenium Tests using Docker windowsservercore and chromium: The command line tests of chromium chrome.exe appear to never work from the container command line.
However when you run dotnet test app.csproj or dotnet vstest app.dll inside the container the webdriver successfully starts and drives the browser
This has been reported to the Chromium team. It appears that Chromium 68+ might have issues with Windows Server 2016.
https://bugs.chromium.org/p/chromium/issues/detail?id=873097
I have a karma.config.js file in a repo that lists different browsers that karma needs to run test on. If I run the test on ubuntu which doesn't have safari install and karma will complain
No binary for Safari browser on your platform. Please set "SAFARI_BIN" env variable.
How do I configure Karma to automatically skip the browser without giving error if a browser is not installed. I don't want everyone who download the repo to edit the config file.
Let me answer my own question. After some searching and experimenting. I found a karma plugin that Karma detect browsers. In the karma config, I added
detectBrowsers: {
enable: true,
},
and removed the browsers array.
You still have to install the runners for each of the potential browser that you want to test on.
When I run karma now, it will try out different browsers and see if they are installed in the current system. If installed, run the test.
Here's my set up on Ubuntu
dalek and dalek-cli installed as instructed in the website, the version is displayed correctly
phantomjs was installed via npm install but the phantomjs command could not be run
installed phantomjs via apt-get ... now I have version 1.4
in the folder /var/www/first_tests/ I have the package.json file provided in the website along with a subfolder tests containing first.js with the google example provided
I am in my homedirectory since that's the only place I can call dalek (I'm guessing because that where I was when I installed it) so I'm doing
dalekjs /var/www/first_tests/tests/*.js
The console shows "Running tests" but nothing happens. Trying to run
phantomjs /var/www/first_tests/tests/first.js
gives me "undefined:0 ReferenceError: Can't find variable: module"
Dalek expects the PhantomJS binary in the:
node_modules/dalekjs/node_modules/dalek-browser-phantomjs/node_modules/phantomjs/bin
Folder. Also, it definitely needs version 1.9.0 or higher.
You could try to download the binary from the PhantomJS homepage & manually copy it to the folder mentioned above.
It would be awesome, if you could send me (dalekjs#asciidisco.com) the npm debug log,
so that I can check why this happened in the first place.