Reputation: 2333
I want to automate tests for a website using Robotframework and Selenium. My test works well with Firefox. However, I would like to use Chromium instead. According to the documentation for "Open Browser", it should work for Chrome. But on my Ubuntu machine I can't use that browser out of the box.
Here is a minimal example:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Open Browser And Check Title
Open Browser about:blank chromium
Title Should Be ${EMPTY}
It fails with the following error:
ValueError: chromium is not a supported browser.
Is there a way to set up chromium for use with Selenium in Robotframework?
EDIT: This was originally asked for Selenium2Library. When moving to version 3, they dropped the version number from the name. The question has been updated accordingly.
Upvotes: 2
Views: 9520
Reputation: 385910
The problem is that "chromium" isn't a name that the selenium library knows about. You can't use just any name. Use "chrome" rather than "chromium", and make sure that the ChromeDriver is installed in some folder in your path -- it doesn't get installed by default.
Upvotes: 5
Reputation: 2384
Try this:
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
${options.binary_location} Set Variable /var/blah/chromium
Create Webdriver Chrome my_alias chrome_options=${options}
Go To http://www.robotframework.org/
Upvotes: 3