Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable may have wrong permissions. #3785

Closed
entropy1208 opened this issue Apr 7, 2017 · 2 comments

Comments

@entropy1208
Copy link

entropy1208 commented Apr 7, 2017

Firefox Version

52.0.2

Platform

Linux Mint - Rebecca
Python - 2.7.6
Selenium - 3.3.3
Geckodriver - 0.15.0

Guys, I am getting the above error when trying to run the following script :-

import time


from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, \
    ElementNotVisibleException


binary = FirefoxBinary(r'/usr/local/bin/firefox')

caps = DesiredCapabilities.FIREFOX.copy()

caps['marionette'] = True


def init_driver():
    driver = webdriver.Firefox(firefox_binary=binary,
                               capabilities=caps,
                               executable_path=r'/usr/local/bin/geckodriver')
    driver.wait = WebDriverWait(driver, 5)
    return driver


def lookup(driver, query):
    driver.get("http://www.google.com")
    try:
        box = driver.wait.until(EC.presence_of_element_located(
            (By.NAME, "q")))
        button = driver.wait.until(EC.element_to_be_clickable(
            (By.NAME, "btnK")))
        box.send_keys(query)
        try:
            button.click()
        except ElementNotVisibleException:
            button = driver.wait.until(EC.visibility_of_element_located(
                (By.NAME, "btnG")))
            button.click()
    except TimeoutException:
        print("Box or Button not found in google.com")


if __name__ == "__main__":
    driver = init_driver()
    lookup(driver, "Selenium")
    time.sleep(5)
    driver.quit()

I have followed all the steps described in this post but still it ain't working!
Please help me with this!

@cgoldberg
Copy link
Contributor

make your /usr/local/bin/geckodriver executable:

$ sudo chmod +x /usr/local/bin/geckodriver'

@entropy1208
Copy link
Author

entropy1208 commented Apr 11, 2017

I already did that @cgoldberg! Upon doing ls -ld, it shows "drwxrwxrwx"

@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants