forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
244 lines (233 loc) · 15.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction — Selenium 2.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '2.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Selenium 2.0 documentation" href="#" />
<link rel="next" title="Selenium Documentation" href="api.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="api.html" title="Selenium Documentation"
accesskey="N">next</a> |</li>
<li><a href="#">Selenium 2.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Author:</th><td class="field-body">David Burns</td>
</tr>
</tbody>
</table>
<p>Selenium Python Client Driver is a Python language binding for Selenium Remote
Control (version 1.0 and 2.0).</p>
<p>Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are
supported, as well as the Selenium 1.0 bindings. As work will progresses we’ll
add more “native” drivers.</p>
<p>See <a class="reference external" href="http://code.google.com/p/selenium/">here</a> for more information.</p>
<div class="section" id="installing">
<h2>Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h2>
<div class="section" id="python-client">
<h3>Python Client<a class="headerlink" href="#python-client" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><pre>pip install -U selenium</pre>
</div>
</div>
<div class="section" id="java-server">
<h3>Java Server<a class="headerlink" href="#java-server" title="Permalink to this headline">¶</a></h3>
<p>Download the server from <a class="reference external" href="http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar">http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar</a></p>
<div class="highlight-python"><pre>java -jar selenium-server-standalone-2.35.0.jar</pre>
</div>
</div>
</div>
<div class="section" id="example">
<h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">selenium</span> <span class="kn">import</span> <span class="n">webdriver</span>
<span class="kn">from</span> <span class="nn">selenium.common.exceptions</span> <span class="kn">import</span> <span class="n">NoSuchElementException</span>
<span class="kn">from</span> <span class="nn">selenium.webdriver.common.keys</span> <span class="kn">import</span> <span class="n">Keys</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="n">browser</span> <span class="o">=</span> <span class="n">webdriver</span><span class="o">.</span><span class="n">Firefox</span><span class="p">()</span> <span class="c"># Get local session of firefox</span>
<span class="n">browser</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"http://www.yahoo.com"</span><span class="p">)</span> <span class="c"># Load page</span>
<span class="k">assert</span> <span class="s">"Yahoo!"</span> <span class="ow">in</span> <span class="n">browser</span><span class="o">.</span><span class="n">title</span>
<span class="n">elem</span> <span class="o">=</span> <span class="n">browser</span><span class="o">.</span><span class="n">find_element_by_name</span><span class="p">(</span><span class="s">"p"</span><span class="p">)</span> <span class="c"># Find the query box</span>
<span class="n">elem</span><span class="o">.</span><span class="n">send_keys</span><span class="p">(</span><span class="s">"seleniumhq"</span> <span class="o">+</span> <span class="n">Keys</span><span class="o">.</span><span class="n">RETURN</span><span class="p">)</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.2</span><span class="p">)</span> <span class="c"># Let the page load, will be added to the API</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">browser</span><span class="o">.</span><span class="n">find_element_by_xpath</span><span class="p">(</span><span class="s">"//a[contains(@href,'http://seleniumhq.org')]"</span><span class="p">)</span>
<span class="k">except</span> <span class="n">NoSuchElementException</span><span class="p">:</span>
<span class="k">assert</span> <span class="mi">0</span><span class="p">,</span> <span class="s">"can't find seleniumhq"</span>
<span class="n">browser</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="documentation">
<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">Auto Generated API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api.html#selenium">Selenium</a><ul>
<li class="toctree-l3"><a class="reference internal" href="selenium/selenium.selenium.html">selenium.selenium</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#common">Common</a><ul>
<li class="toctree-l3"><a class="reference internal" href="common/selenium.common.exceptions.html">selenium.common.exceptions</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-common">Webdriver.common</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.action_chains.html">selenium.webdriver.common.action_chains</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.alert.html">selenium.webdriver.common.alert</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.by.html">selenium.webdriver.common.by</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.desired_capabilities.html">selenium.webdriver.common.desired_capabilities</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.keys.html">selenium.webdriver.common.keys</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.touch_actions.html">selenium.webdriver.common.touch_actions</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.utils.html">selenium.webdriver.common.utils</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.proxy.html">selenium.webdriver.common.proxy</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver/selenium.webdriver.common.html5.application_cache.html">selenium.webdriver.common.html5.application_cache</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-support">Webdriver.support</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.abstract_event_listener.html">selenium.webdriver.support.abstract_event_listener</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.color.html">selenium.webdriver.support.color</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.event_firing_webdriver.html">selenium.webdriver.support.event_firing_webdriver</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.expected_conditions.html">selenium.webdriver.support.expected_conditions</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.select.html">selenium.webdriver.support.select</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_support/selenium.webdriver.support.wait.html">selenium.webdriver.support.wait</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-chrome">Webdriver.chrome</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_chrome/selenium.webdriver.chrome.service.html">selenium.webdriver.chrome.service</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_chrome/selenium.webdriver.chrome.webdriver.html">selenium.webdriver.chrome.webdriver</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-firefox">Webdriver.firefox</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_firefox/selenium.webdriver.firefox.extension_connection.html">selenium.webdriver.firefox.extension_connection</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_firefox/selenium.webdriver.firefox.firefox_binary.html">selenium.webdriver.firefox.firefox_binary</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html">selenium.webdriver.firefox.firefox_profile</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_firefox/selenium.webdriver.firefox.webdriver.html">selenium.webdriver.firefox.webdriver</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-ie">Webdriver.ie</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_ie/selenium.webdriver.ie.webdriver.html">selenium.webdriver.ie.webdriver</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-phantomjs">Webdriver.phantomjs</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_phantomjs/selenium.webdriver.phantomjs.service.html">selenium.webdriver.phantomjs.service</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_phantomjs/selenium.webdriver.phantomjs.webdriver.html">selenium.webdriver.phantomjs.webdriver</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api.html#webdriver-remote">Webdriver.remote</a><ul>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.command.html">selenium.webdriver.remote.command</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.errorhandler.html">selenium.webdriver.remote.errorhandler</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.remote_connection.html">selenium.webdriver.remote.remote_connection</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.utils.html">selenium.webdriver.remote.utils</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.webdriver.html">selenium.webdriver.remote.webdriver</a></li>
<li class="toctree-l3"><a class="reference internal" href="webdriver_remote/selenium.webdriver.remote.webelement.html">selenium.webdriver.remote.webelement</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="use-the-source-luke">
<h2>Use The Source Luke!<a class="headerlink" href="#use-the-source-luke" title="Permalink to this headline">¶</a></h2>
<p><a class="reference external" href="https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/remote/webdriver.py">https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/remote/webdriver.py</a></p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#installing">Installing</a><ul>
<li><a class="reference internal" href="#python-client">Python Client</a></li>
<li><a class="reference internal" href="#java-server">Java Server</a></li>
</ul>
</li>
<li><a class="reference internal" href="#example">Example</a></li>
<li><a class="reference internal" href="#documentation">Documentation</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#use-the-source-luke">Use The Source Luke!</a></li>
</ul>
</li>
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="api.html"
title="next chapter">Selenium Documentation</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="api.html" title="Selenium Documentation"
>next</a> |</li>
<li><a href="#">Selenium 2.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, plightbo, simon.m.stewart, hbchai, jrhuggins, et al..
</div>
</body>
</html>