README.txt
1This file contains high-level info about how ChromeDriver works and how to
2contribute.
3
4ChromeDriver is an implementation of the WebDriver standard,
5which allows users to automate testing of their website across browsers.
6
7See the user site at http://code.google.com/p/chromedriver.
8
9=====Getting started=====
10Build ChromeDriver by building the 'chromedriver2_server' target. This will
11create an executable binary in the build folder named
12'chromedriver2_server[.exe]'.
13
14Once built, ChromeDriver can be used interactively with python.
15
16$ export PYTHONPATH=<THIS_DIR>/server:<THIS_DIR>/client
17$ python
18>>> import server
19>>> import chromedriver
20>>> cd_server = server.Server('/path/to/chromedriver2_server/executable')
21>>> driver = chromedriver.ChromeDriver(cd_server.GetUrl())
22>>> driver.Load('http://www.google.com')
23>>> driver.Quit()
24>>> cd_server.Kill()
25
26ChromeDriver will use the system installed Chrome by default.
27
28To use ChromeDriver2 with Chrome on Android pass the Android package name in the
29chromeOptions.androidPackage capability when creating the driver. The path to
30adb_commands.py and the adb tool from the Android SDK must be set in PATH. For
31more detailed instructions see the wiki:
32 https://code.google.com/p/chromedriver/wiki/ChromeDriver2forAndroid
33
34=====Architecture=====
35ChromeDriver is shipped separately from Chrome. It controls Chrome out of
36process through DevTools. ChromeDriver is a standalone server which
37communicates with the WebDriver client via the WebDriver wire protocol, which
38is essentially synchronous JSON commands over HTTP. WebDriver clients are
39available in many languages, and many are available from the open source
40selenium/webdriver project: http://code.google.com/p/selenium. ChromeDriver
41uses the webserver from net/server.
42
43ChromeDriver has a main thread, called the command thread, an IO thread,
44and a thread per session. The webserver receives a request on the IO thread,
45which is sent to a handler on the command thread. The handler executes the
46appropriate command function, which completes asynchronously. The create
47session command may create a new thread for subsequent session-related commands,
48which will execute on the dedicated session thread synchronously. When a
49command is finished, it will invoke a callback, which will eventually make its
50way back to the IO thread as a HTTP response for the server to send.
51
52=====Code structure (relative to this file)=====
531) .
54Implements chromedriver commands.
55
562) chrome/
57A basic interface for controlling Chrome. Should not depend on or reference
58WebDriver-related code or concepts.
59
603) js/
61Javascript helper scripts.
62
634) net/
64Code to deal with network communication, such as connection to DevTools.
65
665) client/
67Code for a python client.
68
696) server/
70Code for the chromedriver server.
71A python wrapper to the chromedriver server.
72
737) extension/
74An extension used for automating the desktop browser.
75
768) test/
77Integration tests.
78
799) third_party/
80Third party libraries used by chromedriver.
81
82=====Testing=====
83See the ChromeDriver waterfall at:
84 http://build.chromium.org/p/chromium.chromedriver/waterfall
85There are 4 test suites for verifying ChromeDriver's correctness:
86
871) chromedriver2_unittests (chrome/chrome_tests.gypi)
88This is the unittest target, which runs on the main waterfall on win/mac/linux
89and can close the tree. It is also run on the commit queue and try bots by
90default. Tests should take a few milliseconds and be very stable.
91
922) chromedriver2_tests (chrome/chrome_tests.gypi)
93This is a collection of C++ medium sized tests which can be run optionally
94on the trybots.
95
963) python integration tests
97Run test/run_py_tests.py --help for more info. These are only run on the
98ChromeDriver waterfall.
99
1004) WebDriver Java acceptance tests
101These are integration tests from the WebDriver open source project which can
102be run via test/run_java_tests.py. They are only run on the ChromeDriver
103bots. Run with --help for more info.
104
105=====Contributing=====
106Find an open issue and submit a patch for review by an individual listed in
107the OWNERS file in this directory. Issues are tracked in chromedriver's issue
108tracker:
109 https://code.google.com/p/chromedriver/issues/list
110