#!/usr/bin/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` | |
SELENIUM_STANDALONE_VERSION=3.9.1 | |
SELENIUM_SUBDIR=$(echo "$SELENIUM_STANDALONE_VERSION" | cut -d"." -f-2) | |
# Remove existing downloads and binaries so we can start from scratch. | |
sudo apt-get remove google-chrome-stable | |
rm ~/selenium-server-standalone-*.jar | |
rm ~/chromedriver_linux64.zip | |
sudo rm /usr/local/bin/chromedriver | |
sudo rm /usr/local/bin/selenium-server-standalone.jar | |
# Install dependencies. | |
sudo apt-get update | |
sudo apt-get install -y unzip openjdk-8-jre-headless xvfb libxi6 libgconf-2-4 | |
# Install Chrome. | |
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add | |
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list | |
sudo apt-get -y update | |
sudo apt-get -y install google-chrome-stable | |
# Install ChromeDriver. | |
wget -N https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/ | |
unzip ~/chromedriver_linux64.zip -d ~/ | |
rm ~/chromedriver_linux64.zip | |
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver | |
sudo chown root:root /usr/local/bin/chromedriver | |
sudo chmod 0755 /usr/local/bin/chromedriver | |
# Install Selenium. | |
wget -N https://selenium-release.storage.googleapis.com/$SELENIUM_SUBDIR/selenium-server-standalone-$SELENIUM_STANDALONE_VERSION.jar -P ~/ | |
sudo mv -f ~/selenium-server-standalone-$SELENIUM_STANDALONE_VERSION.jar /usr/local/bin/selenium-server-standalone.jar | |
sudo chown root:root /usr/local/bin/selenium-server-standalone.jar | |
sudo chmod 0755 /usr/local/bin/selenium-server-standalone.jar |
#!/usr/bin/env bash | |
# Run Chrome via Selenium Server | |
start-chrome() { | |
xvfb-run java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone.jar | |
} | |
start-chrome-debug() { | |
xvfb-run java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone.jar -debug | |
} | |
# Run Chrome Headless | |
start-chrome-headless() { | |
chromedriver --url-base=/wd/hub | |
} | |
# Start | |
# start-chrome | |
# start-chrome-debug | |
# start-chrome-headless |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thank you! Taking into consider the following permission: chown root:root /usr/local/share/chromedriver |
This comment has been minimized.
This comment has been minimized.
Thank you so much! I didn't have unzip installed. So i ran |
This comment has been minimized.
This comment has been minimized.
Thanks! I used different version of chromedriver and selenium and I noticed that the |
This comment has been minimized.
This comment has been minimized.
Sweet! |
This comment has been minimized.
This comment has been minimized.
Thank you guy, so much! |
This comment has been minimized.
This comment has been minimized.
thank you |
This comment has been minimized.
This comment has been minimized.
defiantly a Lifesaver! |
This comment has been minimized.
This comment has been minimized.
Thank youuu !!! |
This comment has been minimized.
This comment has been minimized.
Thank youuu |
This comment has been minimized.
This comment has been minimized.
thank you |
This comment has been minimized.
This comment has been minimized.
thank you |
This comment has been minimized.
This comment has been minimized.
Thank you, i keep coming back for this |
This comment has been minimized.
This comment has been minimized.
Hello, Thanks for sharing. I have added shared code in my project but I am facing below error;
|
This comment has been minimized.
This comment has been minimized.
Thank you so muuch |
This comment has been minimized.
This comment has been minimized.
Thanks!! |
This comment has been minimized.
This comment has been minimized.
I am beginer, please noted me how to do step by step. |
This comment has been minimized.
This comment has been minimized.
Anyone tested this on Ubuntu 14.04.5 LTS? Tried and no luck. Getting: |
This comment has been minimized.
This comment has been minimized.
any alternative to wget command when executing the shell on windows OS machine |
This comment has been minimized.
This comment has been minimized.
@sarikabagga7 |
This comment has been minimized.
This comment has been minimized.
I tried this using php-webdriver but I get following error:
It seems that for some reason Chrome is unreachable. What could be the issue? |
This comment has been minimized.
This comment has been minimized.
This works beautifully, thank you! |
This comment has been minimized.
This comment has been minimized.
It works fine for me with chrome 61.0.3163.100, chromedriver 2.33 and selenium server standalone 2.53.1. Thank you.. |
This comment has been minimized.
This comment has been minimized.
thank you, works beautifully. I been trying getting this things to work for the last couple days now. Pulling my hair out. You are a life saver. Thankyou, Thankyou and Thankyou. |
This comment has been minimized.
This comment has been minimized.
worked like a charm! |
This comment has been minimized.
This comment has been minimized.
thanx! |
This comment has been minimized.
This comment has been minimized.
Nice job, thank you! I would added for start-chrome.sh |
This comment has been minimized.
This comment has been minimized.
Thanks a lot! |
This comment has been minimized.
This comment has been minimized.
Testing with Chrome Driver and getting these errors Message: Test method SeleniumGridSmokeTest.UnitTest1.TestMethod1 threw exception: System.InvalidOperationException: Unable to create new service: ChromeDriverService Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z' System info: host: 'seleniumnode', ip: '10.0.0.9', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-97-generic', java.version: '1.8.0_151' Driver info: driver.version: unknown (InsecureCertificate) |
This comment has been minimized.
This comment has been minimized.
Why is that line, 'dpkg -i --force-depends' repeated twice? Can someone explain? Thanks. |
This comment has been minimized.
This comment has been minimized.
@nobodyme Also ask me that ;) |
This comment has been minimized.
This comment has been minimized.
Thanks, Man!! That was really helpful. (y) |
This comment has been minimized.
This comment has been minimized.
Thanks a lot ziadoz! Just some minor things: I noticed: And Google Chrome install works better for me if line 27 looks like this: |
This comment has been minimized.
This comment has been minimized.
Where exactly do past the code for the start_chrome.sh file? |
This comment has been minimized.
This comment has been minimized.
@matthewmuscat : you can call it by typing |
This comment has been minimized.
This comment has been minimized.
Dude you are the best! Still working on ubuntu 16.04 |
This comment has been minimized.
This comment has been minimized.
Hi i followed your code and getting the below error, how can we fix it. please help me in resolving the issue Starting ChromeDriver 2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5) on port 11458 |
This comment has been minimized.
This comment has been minimized.
@mangena-dave I tried chromedriver with 2.32, 2.33, 2.29, 2.34 and many more still getting the same error, as below Starting ChromeDriver 2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5) on port 11458 |
This comment has been minimized.
This comment has been minimized.
Thanks for sharing! saved me! |
This comment has been minimized.
This comment has been minimized.
Thanks,that is very helpful. |
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
If
|
This comment has been minimized.
This comment has been minimized.
this worked for me (need to update the download link): set -e;
wget -N https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
You're calling sudo in the wrong place on a couple of lines:
|
This comment has been minimized.
This comment has been minimized.
Thank you! Didn't work out as easy as for most others, but extremely helpful in succeeding with installation.
EDIT: And while having a brand new Ubuntu 16.04 installation, its necessary to install pip, before you can run the two lines above And yet, after days of trial and error, there is some prognosis, but its still not working. Running following commands in python3: Clearly, Chrome cannot be found. I installed it using the above script, so obviously I'm missing something that I sholud fix in my environment. EDIT --- SOLVED!!! Then, running the script worked like charm! Funnily, after that I tried and found out that I CAN have Chromium open, and still get the script working and Chrome opening, just like it should. So, I am not sure why it started working, but am really glad that it did. |
This comment has been minimized.
This comment has been minimized.
You can also use yarn/npm to install (and update) the driver - |
This comment has been minimized.
This comment has been minimized.
EDIT 2 - I have created a docker image to automate the creation of an environment for this, and I've already started to build some notifications around it. Find it here if you want a easier way to get an environment up and running for this great library -- https://github.com/nshores/my_usps_notifications EDIT I have resolved this. By default, getting a session with myusps.get_session will use PhantomJS. This behavior works in Windows, but not linux. You must manually specificfy Chrome as the webdriver to use in linux - IE myusps.get_session(username, password, driver='chrome') See issue here - happyleavesaoc/python-myusps#14 Major issues getting this running on Ubuntu LTS 16.04. Getting a timeout when trying to login.
Tried a bunch of combinations of ChromeDrive, Google Chrome, and Selenium. My environment is -- Chrome - 65.0.333325.181 I'm able to run this fine in windows. Just can't seem to narrow down the issue in Linux. Any ideas? This is very frustrating as I'm trying to work on getting a Docker image together for this project, as well as working on some notification modules to extend it out to Slack, etc. |
This comment has been minimized.
This comment has been minimized.
This is great! Thank you |
This comment has been minimized.
This comment has been minimized.
I already update my webdriver but when I run my script it always prompt this error. WebDriverException: Message: disconnected: unable to connect to renderer |
This comment has been minimized.
This comment has been minimized.
Wonderful job. Thanks! |
This comment has been minimized.
This comment has been minimized.
Lifesaver :) |
This comment has been minimized.
This comment has been minimized.
Thanks so much! Lifesaver |
This comment has been minimized.
This comment has been minimized.
Very helpful, thank you! |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
To those who got the following error:
try this:
|
This comment has been minimized.
This comment has been minimized.
Life Saver !! |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
That helped! Thanks! |
This comment has been minimized.
This comment has been minimized.
$ curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
gpg: can't open `': No such file or directory Should be $ curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
OK |
This comment has been minimized.
This comment has been minimized.
Oh, my God!! |
This comment has been minimized.
This comment has been minimized.
Line 26 could be improved to:
|
This comment has been minimized.
This comment has been minimized.
Line 27 might also not work: What happens with the command is that echo is run as root, but not >>. You could do it in two steps:
|
This comment has been minimized.
This comment has been minimized.
Hey I am getting permission denied error : -bash: /etc/apt/sources.list.d/google-chrome.list: Permission denied |
This comment has been minimized.
This comment has been minimized.
Just wanted to let you guys know, that this is now working again when using the latest version of selenium. |
This comment has been minimized.
This comment has been minimized.
nice work here... but I can not seem to gracefullyy tell selenium to release the terminal for me to run my tests... how do I do that... this is my command |
This comment has been minimized.
This comment has been minimized.
I'm new to use linux tell me how to install .sh files? |
This comment has been minimized.
This comment has been minimized.
To install any ".sh" or ".bash" files, you have to do 2 things:
1. Make that file (we normally call it script) executable. To do this, you
open your terminal and type this command: chmod +x install.sh
2. Then run the file as: ./install.sh
Hope this is helpful. Let me know how it goes.
Regards.
…On Wed, 30 Oct 2019, 08:51 mobinalhassan, ***@***.***> wrote:
I'm new to use linux tell me how to install .sh files?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/3e8ab7e944d02fe872c3454d17af31a5?email_source=notifications&email_token=ADPTFTOXOAZTVXRGXCU5LXDQREOFZA5CNFSM4IYVK3T2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF3LHE#gistcomment-3069554>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADPTFTNMVA2ICBXH3OXABQDQREOFZANCNFSM4IYVK3TQ>
.
|
This comment has been minimized.
This comment has been minimized.
Thank you my friend |
This comment has been minimized.
This comment has been minimized.
Thank you! |
This comment has been minimized.
This comment has been minimized.
when I'm executing this |
This comment has been minimized.
This comment has been minimized.
When in root you do not need to run it with sudo.
…On Wed, Feb 26, 2020 at 12:35 AM bolingbrook ***@***.***> wrote:
when I'm executing this sudo curl -sS -o -
https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
getting : This command can only be used by root.
I'm already in the root. Any suggestions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/3e8ab7e944d02fe872c3454d17af31a5?email_source=notifications&email_token=ADPTFTO5AEMNG2VIJSCKCPDREWFL3A5CNFSM4IYVK3T2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAGCU6O#gistcomment-3189223>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADPTFTPBJNQM665FANDAXQDREWFL3ANCNFSM4IYVK3TQ>
.
|
This comment has been minimized.
This comment has been minimized.
@davidmukiibi same result. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There are to place where from chromeDriver runs.. |
This comment has been minimized.
This comment has been minimized.
Thankyou :) |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
very nice, ty |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Hello catch this erorr all the time selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
this is a very good friend. |
This comment has been minimized.
This comment has been minimized.
Thank you @SerheyDolgushev |
This comment has been minimized.
Dude, you are a lifesaver! Thank you!