The PhantomJS executable could not be found on the current PATH. To be resolved - phantomjs

I am getting following error message
The PhantomJS executable could not be found on the current PATH. from the compiler when I am building my project.
Is there any solution existing for it?

On Linux, while calling the phantomJS driver instance, you need to pass a variable executable_path
browser = webdriver.PhantomJS(executable_path = '/home/someLocation/phantomJS')
This solved it for me

Related

testcafe electron mainWindowUrl | what to do with tmp location

When using testcafe-browser-provider-electron, I get stuck with the mainWindowUrl. I have the original source file in the renderer folder, the version that is in the build folder and apparently a temporary created in some random /tmp/ folder. Testcafe suggests the /tmp/ file.
"Use the mainWindowUrl option to specify one of the following pages as the main window page:
file:///tmp/.mount_PROGRAM-Lbt5yL/resources/app.asar/build/renderer/index.html"
With the 6 chars being random.
How can I instruct testcafe that all files are identical?
I expected no error-message
Error: The main window page at file://....index.html was not loaded.
I reproduced this behavior. Please track the issue in the following thread: https://github.com/DevExpress/testcafe-browser-provider-electron/issues/87. We will research it and update the thread once we have any news.
Found out an alternative path to using the AppImage.
Use electron-builder to build a deb-package. Install that as it will always have the same path /opt/... to the unpacked content. You can then use that path in the specification of the mainWindowUrl.

On Ubuntu, How can I uninstall or remove the lower version of selenium?

While using AppiumLibrary with RobotFramework, I am getting below error.
Error: importing test library 'AppiumLibrary' failed:
ImportError: No module named switch_to
Here,PYTHONPATH: /usr/local/lib/python2.7/dist-packages/selenium-2.44.0-py2.7.egg
To resolve above error I want to try solution mentioned at link "https://github.com/appium/appium/issues/2625" which asks to remove the lower version of selenium.
I have two selenium folders at below location.
Selenium folders:
1)/usr/local/lib/python2.7/dist-packages/selenium
2)/usr/local/lib/python2.7/dist-packages/selenium-2.44.0.egg-info
How can I remove the the selenium other than 2.44?
No process was required to uninstall Selenium.
I simply deleted the directory "/usr/local/lib/python2.7/dist-packages/selenium". This resolved my error with Robot Framework.

casperjs.bat on windows fails with cannot find module cli.js error

I'm trying out casperJS to run some automated tests. On windows. I followed this installation guide but am stuck.
when I try to run a simple test from the command line like this:
casperjs.bat smoketest.js
I get the following error:
Error: Cannot find module 'C:/code/base/main/Shared/casperjs\modules\cli.js'
I checked, and the file cli.js does exist under the specified path.
I thought the problem could be the mixture of forward and backward slashes in the path, but I edited the bootstrap.js casper code to hard code the path and it made no difference - it still the cannot find module.
I'm have tried this using phantomJS version 1.9.0, and 1.8.2.
Anyone know what I am doing wrong?
Has anyone had success running casper on Windows?
This is due to a bug in PhantomJS 1.9.0 that does not allow for absolute path loading in Windows. Afaik, this should only be apparent if you are using a master build of CasperJS (v1.1).
This bug has been fixed, but is not yet in the Windows binary. You can compile it yourself if you'd like, but that can take quite a bit of time.
I was using the master build of casper. With the latest released version, 1.0.2, it works fine.

Can't get PhantomJS to work with a simple example

I've downloaded the executable and created a simlink to /usr/local/bin.
I'm under Mac OSX 10.7
When I then try to run a script that requires some module i.e.
var page = require('webpage').create();
I got an error
undefined:0 ReferenceError: Can't find variable: require
as if 'require' is not seen as a reserved word but interpreted as a variable symbol.
(As an aside, whenever I lunch phantomjs a Sencha Touch icon appears in my Dock)
Your copy of PhantomJS is from an older version. Always get the latest one from http://phantomjs.org.
I had this issue too, and the problem was my version of mocha -- going back to 1.9.0 fixed it.
SenchaTouch 2.0 installs PhantomJS 1.1 somewhere depending on the OS. Under *NIX check where with 'which phantomjs'.
Just modify your bash or whatever configuration file accordingly to remove the Phantomjs included with SenshaTouch from your PATH.

dlopen() error image not found

I have software that first loads a .dylib lets call libFirst.dylib using the following command:
void* handle = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
Later on inside a function from the loaded libFirst.dylib I attempt to load another .dylib using the same command but for libSecond.dylib, the loading of this shared library gives me the following warnings in my Xcode console:
error warning: Ignored unknown object module at 0x129310 with type 0x8a8399
dlerror: dlopen(/path/libSecond.dylib, 9): Library not loaded: libFirst.dylib
Referenced from: /path/libSecond.dylib
Reason: image not found
What I don't get is that its says libFirst.dylib is not loaded but I am currently inside a function from libFirst.dylib, so how can this be?
All my paths in DYLD_LIBRARY_PATH appear correct too.
Thanks in advance, I have been stuck on this for days.
I ended up using -install_name to change the install name of all my libraries to #rpath/dylibName.dylib and then in Xcode I set the Runpath Search paths using #loader_path to find all my .dylibs that I was using.
use:
install_name_tool -id #executable_path/../Frameworks/mylib.dylib mylib.dylib
then check it with:
otool -D mylib.dylib
I think an easier way to get around this error would be to revert to an earlier version where you were not getting this error. Right click on the project folder and navigate to local history to revert to an earlier version. I verified this to be working on the android studio installed on Mac OS Big sur.