Use Selenium with Chromium Browser
Solution 1
Yes. For Chromium use:
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*custom path/to/chromium" , "www.google.com");
selenium.start();
The other options that you can use are *custom, *chrome(note: this is not Google chrome, its a firefox mode only), *googlechrome, *iexplore. Please check selenium documentation for complete list of the modes.
EDIT: Changed googlechrome to chromium
Solution 2
Uh, the accepted answer doesn't answer the question. Google Chrome is based on Chromium, but they're not the same browser.
This is what you want: (since Chromium isn't officially supported)
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*custom C:/path/to/chromium.exe" , "www.google.com");
selenium.start();
Edit 2018-08: Looks like the accepted answer changed to a copy of this one several years later, so my original comment is no longer correct. I'm leaving it there, but struck out, because the votes are misleading if I straight remove it.
Solution 3
On unix systems, you can do something like
sudo ln -s /usr/lib/chromium-browser/chromium-browser /usr/bin/google-chrome
and then you can use "*googlechrome" as the lauch parm when creating your DefaultSelenium instance.
Solution 4
(Python)
You can use chromium-chromedriver instead of the vanilla chromedriver. It can be installed via apt-get like "sudo apt-get install chromium-chromedriver"
In my scripts I then configure the chromebrowser and driver to use the chromium exe and chromedriver exe like:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.BinaryLocation = "/usr/bin/chromium-browser"
driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver",options=options)
driver.get("https://www.google.com")
Solution 5
It's probably too easy, and I'm going to figure out what I did that is horribly wrong, but...
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = "C:\Program Files (x86)\Chromium\Application\chrome.exe");
using (var chrome = new ChromeDriver(options))
appears to work...
Related videos on Youtube
RusAlex
Updated on July 09, 2022Comments
-
RusAlex almost 2 years
In the Selenium options (on Firefox) I can find
Custom browser
.Is it possible to use this option to run a Selenium test in Chromium Browser (not Chrome)?
-
ealfonso almost 11 yearsThis does not work for me. I get: raise WebDriverException("Can not connect to the ChromeDriver")
-
ealfonso almost 11 yearsI resolved my issue: I had to download the ChromeDriver binary
-
ealfonso almost 11 years
-
ealfonso almost 11 years
-
Izkata almost 6 years@SAndrew Already there. Looks like the other answer changed it a few years ago to a copy of mine, instead of what I was referring to.
-
S Andrew almost 6 yearsCan you now pls add some demo code on how to use it.
-
Izkata almost 6 years@SAndrew This is a configuration line in the documentation. If you're having trouble with it, you should ask a new question.
-
Necromancer about 2 yearsThe question is about chromium-browser (not chrome).