1 This file contains high-level info about how ChromeDriver works and how to
4 ChromeDriver is an implementation of the WebDriver standard,
5 which allows users to automate testing of their website across browsers.
7 See the user site at https://sites.google.com/a/chromium.org/chromedriver/
9 =====Getting started=====
10 Build ChromeDriver by building the 'chromedriver' target. This will
11 create an executable binary in the build folder named
14 Once built, ChromeDriver can be used interactively with python.
16 $ export PYTHONPATH=<THIS_DIR>/server:<THIS_DIR>/client
19 >>> import chromedriver
20 >>> cd_server = server.Server('/path/to/chromedriver/executable')
21 >>> driver = chromedriver.ChromeDriver(cd_server.GetUrl())
22 >>> driver.Load('http://www.google.com')
26 ChromeDriver will use the system installed Chrome by default.
28 To use ChromeDriver2 with Chrome on Android pass the Android package name in the
29 chromeOptions.androidPackage capability when creating the driver. The path to
30 adb_commands.py and the adb tool from the Android SDK must be set in PATH. For
31 more detailed instructions see the user site.
33 =====Architecture=====
34 ChromeDriver is shipped separately from Chrome. It controls Chrome out of
35 process through DevTools. ChromeDriver is a standalone server which
36 communicates with the WebDriver client via the WebDriver wire protocol, which
37 is essentially synchronous JSON commands over HTTP. WebDriver clients are
38 available in many languages, and many are available from the open source
39 selenium/webdriver project: http://code.google.com/p/selenium. ChromeDriver
40 uses the webserver from net/server.
42 ChromeDriver has a main thread, called the command thread, an IO thread,
43 and a thread per session. The webserver receives a request on the IO thread,
44 which is sent to a handler on the command thread. The handler executes the
45 appropriate command function, which completes asynchronously. The create
46 session command may create a new thread for subsequent session-related commands,
47 which will execute on the dedicated session thread synchronously. When a
48 command is finished, it will invoke a callback, which will eventually make its
49 way back to the IO thread as a HTTP response for the server to send.
51 =====Code structure (relative to this file)=====
53 Implements chromedriver commands.
56 A basic interface for controlling Chrome. Should not depend on or reference
57 WebDriver-related code or concepts.
60 Javascript helper scripts.
63 Code to deal with network communication, such as connection to DevTools.
66 Code for a python client.
69 Code for the chromedriver server.
70 A python wrapper to the chromedriver server.
73 An extension used for automating the desktop browser.
79 Third party libraries used by chromedriver.
82 See the ChromeDriver waterfall at:
83 http://build.chromium.org/p/chromium.chromedriver/waterfall
84 There are 4 test suites for verifying ChromeDriver's correctness:
86 1) chromedriver_unittests (chrome/chrome_tests.gypi)
87 This is the unittest target, which runs on the main waterfall on win/mac/linux
88 and can close the tree. It is also run on the commit queue and try bots by
89 default. Tests should take a few milliseconds and be very stable.
91 2) chromedriver_tests (chrome/chrome_tests.gypi)
92 This is a collection of C++ medium sized tests which can be run optionally
95 3) python integration tests
96 Run test/run_py_tests.py --help for more info. These are only run on the
97 ChromeDriver waterfall.
99 4) WebDriver Java acceptance tests
100 These are integration tests from the WebDriver open source project which can
101 be run via test/run_java_tests.py. They are only run on the ChromeDriver
102 bots. Run with --help for more info.
104 =====Contributing=====
105 Find an open issue and submit a patch for review by an individual listed in
106 the OWNERS file in this directory. Issues are tracked in chromedriver's issue
108 https://code.google.com/p/chromedriver/issues/list