-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ChromeDriver
Developed in collaboration with the Chromium team, ChromeDriver is a standalone server which implements WebDriver's wire protocol.
The ChromeDriver consists of three separate pieces. There is the browser itself ("chrome"), the language bindings provided by the Selenium project ("the driver") and an executable downloaded from the Chromium project which acts as a bridge between "chrome" and the "driver". This executable is called "chromedriver", but we'll try and refer to it as the "server" in this page to reduce confusion.
The server expects you to have Chrome installed in the default location for each system:
OS | Expected Location of Chrome |
---|---|
Linux | /usr/bin/google-chrome1 |
Mac | /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome |
Windows XP | %HOMEPATH%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe |
Windows Vista and newer | C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe |
1 For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary. See also the section on overriding the Chrome binary location .
- Mac users with Homebrew installed:
brew install --cask chromedriver
- Debian based Linux distros:
sudo apt-get install chromium-driver
- Windows users with Chocolatey installed:
choco install chromedriver
Read ChromeDriver user documentation
Since the ChromeDriver implements the wire protocol, it is fully compatible with any RemoteWebDriver client. Simply start up the ChromeDriver executable (that works as a server), create a client, and away you go:
WebDriver driver = new RemoteWebDriver("http://localhost:9515", DesiredCapabilities.chrome());
driver.get("http://www.google.com");
If you are using the RemoteWebDriver and you get the The path to the chromedriver executable must be set by the webdriver.chrome.driver system property error message you likely need to check that one of these conditions is met:
- The chromedriver binary is in the system path, or
- The Selenium Server was started with -Dwebdriver.chrome.driver=c:\path\to\your\chromedriver.exe
ChromeDriver user documentation provides more information on the known issues and workarounds.
Check if the bug has been reported yet. If it hasn't, please open a new issue and be sure to include the following:
- What platform are you running on?
- What version of the chromedriver are you using?
- What version of Chrome are you using?
- The failure stacktrace, if available.
- The contents of chromedriver's log file (chromedriver.log).
Of course, if your bug has already been reported, you can update the issue with the information above. Having more information to work on makes it easier for us to track down the cause of the bug.
ChromeDriver is only compatible with Chrome version 12.0.712.0 or newer. If you need to test an older version of Chrome, use Selenium RC and a Selenium-backed WebDriver instance:
URL seleniumServerUrl = new URL("http://localhost:4444");
URL serverUnderTest = new URL("http://www.google.com");
CommandExecutor executor = new SeleneseCommandExecutor(seleniumServerUrl, serverUnderTest, DesiredCapabilities.chrome());
WebDriver driver = new RemoteWebDriver(executor);
This wiki is not where you want to be! Visit the Wiki Home for more useful links
Getting Involved
Build Instructions
Releasing Selenium
Updating Chromium DevTools
Ruby Development
Python Bindings
Ruby Bindings
WebDriverJs
This content is being evaluated for where it belongs
Architectural Overview
Automation Atoms
HtmlUnitDriver
Lift Style API
LoadableComponent
Logging
PageFactory
RemoteWebDriver
Xpath In WebDriver
Moved to Official Documentation
Bot Style Tests
Buck
Continuous Integration
Crazy Fun Build
Design Patterns
Desired Capabilities
Developer Tips
Domain Driven Design
Firefox Driver
Firefox Driver Internals
Focus Stealing On Linux
Frequently Asked Questions
Google Summer Of Code
Grid Platforms
History
Internet Explorer Driver
InternetExplorerDriver Internals
Next Steps
PageObjects
RemoteWebDriverServer
Roadmap
Scaling WebDriver
SeIDE Release Notes
Selenium Emulation
Selenium Grid 4
Selenium Help
Shipping Selenium 3
The Team
TLC Meetings
Untrusted SSL Certificates
WebDriver For Mobile Browsers
Writing New Drivers