0
votes

I am trying to use ChromeDrive 2.32 to test on a remote Linux computer (Ubuntu 16.04).

My local computer has Pycharm 2017.2's remote interpreter feature to run the code stored on the remote computer. I checked that Google Chrome is installed on the remote computer at:

/usr/bin/google-chrome

Initialising the Webdriver on my local machine never generates any error.

chrome_driver = webdriver.WebDriver(
            executable_path= ###path_to_chrome_driver_for_linux_on_remote_machine###))

However, when I am running on the remote machine using the remote interpreter of PyCharm, it gives the following error:

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__

self.service.start()

File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 86, in start os.path.basename(self.path), self.start_error_message)

selenium.common.exceptions.WebDriverException: Message: 'chromedriver_linux' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Can anyone point me in the direction: 1. Is Pycharm remote interpreter able to run chrome driver? (via SSH)

  1. If yes, what "permission" does the ChromeDriver need that the SSH connection couldn't give? Is it possible that the accessing SSH -Y might solve the problem?
1

1 Answers

0
votes

This error may occur when Selenium can't find the file. Are you specifying the full absolute path to the chromedriver executable? Not just to the directory, but to the actual executable.

You can check whether or not PyCharm's remote interpreter is a factor by opening an SSH shell session and running the script from the command line. Within PyCharm you can find action (Ctrl+Shift+A / Cmd+Shift+A) for 'Start SSH session'. Then navigate to the script, activate your virtualenv if you're using one, and then run the script.

If that also doesn't work, you could check the permissions on the chromedriver executable (use ls -al to see permission information). You may need to add execution permissions chmod a+x chromedriver.