I have jenkins which is running on Linux box and Whenever I tried to run the below script its failing and says the driver is not executable.
java.lang.IllegalStateException: The driver is not executable: /COMPLIANCE-48/workspace/AutoProfile_Exec/Driver/chromedriver
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
Code:
String getLocation=System.getProperty("chromePath");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
System.setProperty("webdriver.chrome.driver",getLocation);
WebDriver iDriver = new ChromeDriver(chromeOptions);
The below is mvn command:
-U clean compile exec:java -DchromePath="${WORKSPACE}/Driver/chromedriver"
Actually I have placed the chromedriver in that specific path and passing it as an argument. But not sure why it's saying driver is not executable.
In linux and mac machines, we don't have the exe files like we have in windows so you need to make the driver executable by using the chmod +x command. Please go to the path where chromedriver is present and then execute the chmod +x command.
In your case it should be:
cd /COMPLIANCE-48/workspace/AutoProfile_Exec/Driver
chmod +x chromedriver
After running the above commands, try to run the code, it would work then.
Adding to #Sameer Arora answer, if his solution doesn't solve the problem then try to change -DchromePath to -Dwebdriver.chrome.driver like below:
-U clean compile exec:java -Dwebdriver.chrome.driver="${WORKSPACE}/Driver/chromedriver"
And make sure that the chromedriver is a executable driver file and not a directory or something else.
Check Mac OSX - IllegalStateException: The driver is not executable: for more information.
Related
I am a complete newbie to Linux and trying to open an AppImage called Magick which is an Imagemagick application.
I tried right clicking on the AppImage and checked "run file as an executable" option but that didn't work. Another thing that I tried is running this command,
chmod a+x magick.AppImage
This gives me an error,
chmod: cannot access 'magick.AppImage': No such file or directory
I have also tried running the file by navigating into the folder that contains the file and opening up the terminal there but still no luck.
I am running Ubuntu on Oracle VM VirtualBox.
ImageMagick is a command-line tool, you don't run it by clicking on it.
To run it in a terminal you need to
Set the executable flag on the .AppImage (once for all): chmod +x TheApp.AppImage
Then to run it just invoke the AppImage: ./TheApp.AppImage <arg1> <arg2> ....
If the directory with your .AppImage is in your PATH, you can remove the ./ (or whatever directory the AppImage is in).
ImageMagick is also available as a regular application from your Ubuntu repository: sudo apt install imagemagick
Trying to use Selenium with Chrome in a python script.
I get the following error:
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
I know the location of the chromedriver executable.
How do I add it to the PATH?
thank you
You can specify the absolute path to your chrome driver in your script as such:
from selenium import webdriver
driver = webdriver.Chrome(executable_path='/path/to/driver/chromedriver')
Or you can add the path to your webdriver in the PATH system variable as so:
export PATH=$PATH:/path/to/driver/chrome-driver
You may add the above line to your /home/<user>/.profile file to make it permanent.
Tested on Ubuntu 17.10 running Python 2.7.14
Hope this helps!
The solution posted by #AnythingIsFine is indeed correct.
However in my case my pytest was still unable to find the chromedriver (despite it was correctly added to the PATH and from the terminal I could execute it).
So I've solved by adding an alias of the chromedriver in the /usr/bin directory:
sudo ln -s /path/to/chromedriver /usr/bin
Move Chromedriver to path with:
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
/usr/local/bin/chromedriver is path.
For selenium framework (python or java), Browser driver(chrome/firefox/ etc.) should be saved on the Path " /usr/local/bin/chromedriver & /usr/bin/chromedriver"
For Chrome Driver Link : https://chromedriver.chromium.org/downloads
go to the link and download the chrome driver for corresponding OS.
Linux:
Open the terminal on the Saved/downloaded directory then enter the command
"sudo mv /path/to/chromedriver /usr/bin"
"sudo mv /path/to/chromedriver /usr/local/bin"
I'm running Cygwin 64bit but can't seem to get OpenShift oc command line to work
I downloaded oc.tar.gz ( from here https://mirror.openshift.com/pub/openshift-v3/clients/3.6.173.0.5/linux/oc.tar.gz ), unzipped it and placed it in my path in /usr/bin
When I try to run: oc login I get the following.
-bash: /usr/bin/oc: cannot execute binary file: Exec format error
Do I need to somehow 'install' the executable ?
Any help would be much appreciated.
In addition to #Graham Dumpleton's answer:
open cygwin and check for directory /usr/local/bin
mkdir -p local/bin
$ cd /usr/local/bin
if it does not exists:
$ mkdir -p local/bin
finally extract the windows package:
$ cp /cygdrive/c/Users/me/Downloads/oc-3.5.5.31.24-windows.zip /usr/local/bin/
unzip oc-3.5.5.31.24-windows.zip
$ oc version
oc v3.5.5.31.24
kubernetes v1.5.2+43a9be4
features: Basic-Auth
Use the Windows binary from the following page:
https://github.com/openshift/origin/releases
From project homepage
https://www.cygwin.com/
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your
application from source if you want it to run on Windows.
a way to magically make native Windows apps aware of UNIX®
functionality like signals, ptys, etc. Again, you need to build your
apps from source if you want to take advantage of Cygwin
functionality.
I'm trying to install the Touchmouse server for Linux. The software is a perl script that I have tried to run via terminal, using the perl command. The software I'm trying to run is here: https://github.com/mycroes/touchmoused
This is the output from terminal:
:~/Desktop/touchmoused-master$ perl touchmoused
Can't open /dev/uinput: Permission denied at touchmoused line 242.
:~/Desktop/touchmoused-master$ Established under name '<name of computer>'
I am new to Linux but have some experience with Terminal.
Thanks!
From the creator of the script:
Just download it, chmod +x and run it (as root, it needs access to /dev/uinput and it wants to register with avahi).
Regards,
http://blog.mycroes.nl/2011/04/touchmoused-logitech-touch-mouse-server.html
Your user won't have permissions for /dev/uinput, also check that /dev/uinput is the correct location for your distribution, the script allows you to override this with the -device flag.
So either make it executable so you don't have to enter 'perl' and then run with sudo or have root run it on startup.
I've downloaded and unzipped ffmpeg at custom directory in my Ubuntu linux. Now I want to run this ffmpeg using terminal like I run on windows using command prompt. But everytime it says "ffmpeg: command not found". My question is how can I run ffmpeg using terminal through extracted libraries
thanks
First you need to make sure the file has execute permissions... or just add it with chmod +x filename
Secondly either the executables must be on the path or you need to specify the path to the executable. What I mean by this is, under Windows if you are in a directory with an executable you can type in the executable name and it will work... this is not the case for Linux. If you are in the executable's directory you execute the command like this ./command. The dot means you are executing a file in the current directory