Skip to content

Commit 6347846

Browse files
committed
Merge pull request EFForg#2811 from TheNavigat/fix-2801
Fixing failing installation of ChromeDriver on Debian
2 parents 3eb8ee5 + 1cbab3d commit 6347846

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

install-dev-dependencies.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
set -o errexit -o xtrace
55
if type apt-get >/dev/null ; then
66
BROWSERS="firefox chromium-browser"
7+
CHROMEDRIVER="chromium-chromedriver"
78
if [[ "$(lsb_release -is)" == "Debian" ]]; then
89
# Iceweasel is the rebranded Firefox that Debian ships, and Chromium
910
# takes the name of 'chromium' instead of 'chromium-browser' in
1011
# Debian 7 (wheezy) and later.
1112
BROWSERS="iceweasel chromium"
13+
CHROMEDRIVER="chromedriver"
1214
fi
1315
sudo apt-get install libxml2-dev libxml2-utils libxslt1-dev python-dev \
1416
$BROWSERS zip sqlite3 python-pip libcurl4-openssl-dev \
15-
chromium-chromedriver
17+
$CHROMEDRIVER
1618
elif type brew >/dev/null ; then
1719
brew list python &>/dev/null || brew install python
1820
brew install libxml2 gnu-sed chromedriver

test/chromium/script.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# of linux is required for the script to run correctly as well.
1111
# Otherwise, use pyvirtualdisplay.
1212

13-
import sys, os
13+
import sys, os, platform
1414
from selenium import webdriver
1515
from selenium.common.exceptions import WebDriverException
1616

@@ -35,7 +35,12 @@ class bcolors:
3535
# Travis has setuid restrictions. I think this becomes unnecessary in M42+?
3636
chromeOps.add_argument('--disable-setuid-sandbox')
3737
elif sys.platform.startswith("linux"):
38-
chromedriver_path = "/usr/lib/chromium-browser/chromedriver"
38+
if 'Ubuntu' in platform.linux_distribution():
39+
chromedriver_path = "/usr/lib/chromium-browser/chromedriver"
40+
elif 'debian' in platform.linux_distribution():
41+
#Debian is lowercase when platform.linux_distribution() is used.
42+
#This is not a mistake.
43+
chromedriver_path = "/usr/lib/chromium/chromedriver"
3944
else:
4045
# Let's hope it's in the user's path.
4146
chromedriver_path = "chromedriver"

0 commit comments

Comments
 (0)