1 # WebDriver client for Python
3 This package provides Python bindings
4 that conform to the [W3C WebDriver standard](https://w3c.github.io/webdriver/webdriver-spec.html),
5 which specifies a remote control protocol for web browsers.
7 These bindings are written with determining
8 implementation compliance to the specification in mind,
9 so that different remote end drivers
10 can determine whether they meet the recognised standard.
11 The client is used for the WebDriver specification tests
12 in the [Web Platform Tests](https://github.com/w3c/web-platform-tests).
16 To install the package individually
17 in your virtualenv or system-wide:
19 % python setup.py install
21 Since this package does not have any external dependencies,
22 you can also use the client directly from the checkout directory,
23 which is useful if you want to contribute patches back:
25 % cd /path/to/wdclient
27 Python 2.7.12+ (default, Aug 4 2016, 20:04:34)
28 [GCC 6.1.1 20160724] on linux2
29 Type "help", "copyright", "credits" or "license" for more information.
33 If you are writing WebDriver specification tests for
34 [WPT](https://github.com/w3c/web-platform-tests),
35 there is no need to install the client manually
36 as it is included in the `tools/webdriver` directory.
40 You can use the built-in
41 [context manager](https://docs.python.org/2/reference/compound_stmts.html#the-with-statement)
42 to manage the lifetime of the session.
43 The session is started implicitly
44 at the first call to a command if it has not already been started,
45 and will implicitly be ended when exiting the context:
50 with webdriver.Session("127.0.0.1", 4444) as session:
51 session.url = "https://mozilla.org"
52 print "The current URL is %s" % session.url
55 The following is functionally equivalent to the above,
56 but giving you manual control of the session:
61 session = webdriver.Session("127.0.0.1", 4444)
64 session.url = "https://mozilla.org"
65 print "The current URL is %s" % session.url
72 This client has the benefit of only using standard library dependencies.
73 No external PyPI dependencies are needed.