blob: 0e14d0006f7e306ec02cb849b1ee83dadc1ff296 [file] [log] [blame]
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: Selenium::WebDriver::Driver
&mdash; Documentation by YARD 0.8.1
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!" + escape(window.location.href);
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<a href="../../_index.html">Index (D)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Selenium.html" title="Selenium (module)">Selenium</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../WebDriver.html" title="Selenium::WebDriver (module)">WebDriver</a></span></span>
&raquo;
<span class="title">Driver</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Selenium::WebDriver::Driver
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Selenium::WebDriver::Driver</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2"><span class='object_link'><a href="SearchContext.html" title="Selenium::WebDriver::SearchContext (module)">SearchContext</a></span></dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">rb/lib/selenium/webdriver/common/driver.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>The main class through which you control the browser.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="SearchContext.html" title="Selenium::WebDriver::SearchContext (module)">SearchContext</a></span></li>
<li><span class='object_link'><a href="Navigation.html" title="Selenium::WebDriver::Navigation (class)">Navigation</a></span></li>
<li><span class='object_link'><a href="TargetLocator.html" title="Selenium::WebDriver::TargetLocator (class)">TargetLocator</a></span></li>
<li><span class='object_link'><a href="Options.html" title="Selenium::WebDriver::Options (class)">Options</a></span></li>
</ul>
</div>
<h2>Constant Summary</h2>
<h2>Constant Summary</h2>
<h3 class="inherited">Constants included
from <span class='object_link'><a href="SearchContext.html" title="Selenium::WebDriver::SearchContext (module)">SearchContext</a></span></h3>
<p class="inherited"><span class='object_link'><a href="SearchContext.html#FINDERS-constant" title="Selenium::WebDriver::SearchContext::FINDERS (constant)">SearchContext::FINDERS</a></span></p>
<h2>
Class Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#for-class_method" title="for (class method)">+ (Driver) <strong>for</strong>(browser, opts = {}) </a>
</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (WebDriver::Element) <strong>[]</strong>(sel) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the first element matching the given selector.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#browser-instance_method" title="#browser (instance method)">- (Object) <strong>browser</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#capabilities-instance_method" title="#capabilities (instance method)">- (Object) <strong>capabilities</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#close-instance_method" title="#close (instance method)">- (Object) <strong>close</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Close the current window, or the browser if no windows are left.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#current_url-instance_method" title="#current_url (instance method)">- (String) <strong>current_url</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the URL of the current page.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#execute_async_script-instance_method" title="#execute_async_script (instance method)">- (WebDriver::Element, ...) <strong>execute_async_script</strong>(script, *args) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Execute an asynchronous piece of JavaScript in the context of the currently
selected frame or window.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#execute_script-instance_method" title="#execute_script (instance method)">- (WebDriver::Element, ...) <strong>execute_script</strong>(script, *args) </a>
(also: #script)
</span>
<span class="summary_desc"><div class='inline'>
<p>Execute the given JavaScript.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(url) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Opens the specified URL in the browser.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Driver) <strong>initialize</strong>(bridge) </a>
</span>
<span class="note title constructor">constructor</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'>
<p>A new Driver instance with the given bridge.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#inspect-instance_method" title="#inspect (instance method)">- (Object) <strong>inspect</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#manage-instance_method" title="#manage (instance method)">- (Options) <strong>manage</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#navigate-instance_method" title="#navigate (instance method)">- (Navigation) <strong>navigate</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#page_source-instance_method" title="#page_source (instance method)">- (String) <strong>page_source</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the source of the current page.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#quit-instance_method" title="#quit (instance method)">- (Object) <strong>quit</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Quit the browser.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#ref-instance_method" title="#ref (instance method)">- (Object) <strong>ref</strong> </a>
</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#switch_to-instance_method" title="#switch_to (instance method)">- (TargetLocator) <strong>switch_to</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#title-instance_method" title="#title (instance method)">- (String) <strong>title</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the title of the current page.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#visible%3D-instance_method" title="#visible= (instance method)">- (Object) <strong>visible=</strong>(bool) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set the visibility of the browser.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#visible%3F-instance_method" title="#visible? (instance method)">- (Boolean) <strong>visible?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the visibility of the browser.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#window_handle-instance_method" title="#window_handle (instance method)">- (String) <strong>window_handle</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the current window handle.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#window_handles-instance_method" title="#window_handles (instance method)">- (Array) <strong>window_handles</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the window handles of open browser windows.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="SearchContext.html" title="Selenium::WebDriver::SearchContext (module)">SearchContext</a></span></h3>
<p class="inherited"><span class='object_link'><a href="SearchContext.html#find_element-instance_method" title="Selenium::WebDriver::SearchContext#find_element (method)">#find_element</a></span>, <span class='object_link'><a href="SearchContext.html#find_elements-instance_method" title="Selenium::WebDriver::SearchContext#find_elements (method)">#find_elements</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
- (<tt><span class='object_link'><a href="" title="Selenium::WebDriver::Driver (class)">Driver</a></span></tt>) <strong>initialize</strong>(bridge)
</h3><div class="docstring">
<div class="discussion">
<p class="note private">
<strong>This method is part of a private API.</strong>
You should avoid using this method if possible, as it may be removed or be changed in the future.
</p>
<p>A new Driver instance with the given bridge. End users should use
Selenium::WebDriver.for instead of using this directly.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
63
64
65
66
67
68
69
70</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 63</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='rparen'>)</span>
<span class='ivar'>@bridge</span> <span class='op'>=</span> <span class='id identifier rubyid_bridge'>bridge</span>
<span class='comment'># TODO: refactor this away
</span> <span class='kw'>unless</span> <span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_driver_extensions'>driver_extensions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_extend'>extend</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_driver_extensions'>driver_extensions</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="for-class_method">
+ (<tt><span class='object_link'><a href="" title="Selenium::WebDriver::Driver (class)">Driver</a></span></tt>) <strong>for</strong>(browser, opts = {})
</h3><div class="docstring">
<div class="discussion">
<p class="note private">
<strong>This method is part of a private API.</strong>
You should avoid using this method if possible, as it may be removed or be changed in the future.
</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Selenium::WebDriver::Driver (class)">Driver</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="../WebDriver.html#for-class_method" title="Selenium::WebDriver.for (method)">Selenium::WebDriver.for</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 26</span>
<span class='kw'>def</span> <span class='kw'>for</span><span class='lparen'>(</span><span class='id identifier rubyid_browser'>browser</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_listener'>listener</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:listener</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_browser'>browser</span>
<span class='kw'>when</span> <span class='symbol'>:firefox</span><span class='comma'>,</span> <span class='symbol'>:ff</span>
<span class='const'>Firefox</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:remote</span>
<span class='const'>Remote</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:ie</span><span class='comma'>,</span> <span class='symbol'>:internet_explorer</span>
<span class='const'>IE</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:chrome</span>
<span class='const'>Chrome</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:android</span>
<span class='const'>Android</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:iphone</span>
<span class='const'>IPhone</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:opera</span>
<span class='const'>Opera</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:safari</span>
<span class='const'>Safari</span><span class='op'>::</span><span class='const'>Bridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unknown driver: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_browser'>browser</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_bridge'>bridge</span> <span class='op'>=</span> <span class='const'>Support</span><span class='op'>::</span><span class='const'>EventFiringBridge</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='comma'>,</span> <span class='id identifier rubyid_listener'>listener</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_listener'>listener</span>
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="[]-instance_method">
- (<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>) <strong>[]</strong>(sel)
</h3><div class="docstring">
<div class="discussion">
<p>Get the first element matching the given selector. If given a String or
Symbol, it will be used as the id of the element.</p>
<p>Examples:</p>
<pre class="code ruby"><code><span class='id identifier rubyid_driver'>driver</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>someElementId</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='comment'>#=&gt; #&lt;WebDriver::Element:0x1011c3b88&gt;
</span><span class='id identifier rubyid_driver'>driver</span><span class='lbracket'>[</span><span class='symbol'>:tag_name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>div</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='comment'>#=&gt; #&lt;WebDriver::Element:0x1011c3b88&gt;</span></code></pre>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>id</span>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Hash</tt>)</span>
&mdash;
<div class='inline'>
<p>or selector</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
266
267
268
269
270
271
272</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 266</span>
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_sel'>sel</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Symbol</span><span class='rparen'>)</span>
<span class='id identifier rubyid_sel'>sel</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_sel'>sel</span> <span class='rbrace'>}</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_find_element'>find_element</span> <span class='id identifier rubyid_sel'>sel</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="browser-instance_method">
- (<tt>Object</tt>) <strong>browser</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
274
275
276</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 274</span>
<span class='kw'>def</span> <span class='id identifier rubyid_browser'>browser</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_browser'>browser</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="capabilities-instance_method">
- (<tt>Object</tt>) <strong>capabilities</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
278
279
280</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 278</span>
<span class='kw'>def</span> <span class='id identifier rubyid_capabilities'>capabilities</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_capabilities'>capabilities</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="close-instance_method">
- (<tt>Object</tt>) <strong>close</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Close the current window, or the browser if no windows are left.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
173
174
175</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 173</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="current_url-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>current_url</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the URL of the current page</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
117
118
119</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 117</span>
<span class='kw'>def</span> <span class='id identifier rubyid_current_url'>current_url</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getCurrentUrl'>getCurrentUrl</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="execute_async_script-instance_method">
- (<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, ...) <strong>execute_async_script</strong>(script, *args)
</h3><div class="docstring">
<div class="discussion">
<p>Execute an asynchronous piece of JavaScript in the context of the currently
selected frame or window. Unlike executing execute_script (synchronous
JavaScript), scripts executed with this method must explicitly signal they
are finished by invoking the provided callback. This callback is always
injected into the executed function as the last argument.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>script</span>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>JavaSCript source to execute</p>
</div>
</li>
<li>
<span class='name'>*args</span>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, <tt>Integer</tt>, <tt>Float</tt>, <tt>Boolean</tt>, <tt>NilClass</tt>, <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Array</tt>)</span>
&mdash;
<div class='inline'>
<p>Arguments to the script. May be empty.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, <tt>Integer</tt>, <tt>Float</tt>, <tt>Boolean</tt>, <tt>NilClass</tt>, <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Array</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
229
230
231</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 229</span>
<span class='kw'>def</span> <span class='id identifier rubyid_execute_async_script'>execute_async_script</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_executeAsyncScript'>executeAsyncScript</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="execute_script-instance_method">
- (<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, ...) <strong>execute_script</strong>(script, *args)
<span class="aliases">Also known as:
<span class="names"><span id='script-instance_method'>script</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Execute the given JavaScript</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>script</span>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>JavaScript source to execute</p>
</div>
</li>
<li>
<span class='name'>*args</span>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, <tt>Integer</tt>, <tt>Float</tt>, <tt>Boolean</tt>, <tt>NilClass</tt>, <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Array</tt>)</span>
&mdash;
<div class='inline'>
<p>Arguments will be available in the given script in the 'arguments'
pseudo-array.</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Element.html" title="Selenium::WebDriver::Element (class)">WebDriver::Element</a></span></tt>, <tt>Integer</tt>, <tt>Float</tt>, <tt>Boolean</tt>, <tt>NilClass</tt>, <tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Array</tt>)</span>
&mdash;
<div class='inline'>
<p>The value returned from the script.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
210
211
212</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 210</span>
<span class='kw'>def</span> <span class='id identifier rubyid_execute_script'>execute_script</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_executeScript'>executeScript</span><span class='lparen'>(</span><span class='id identifier rubyid_script'>script</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="get-instance_method">
- (<tt>Object</tt>) <strong>get</strong>(url)
</h3><div class="docstring">
<div class="discussion">
<p>Opens the specified URL in the browser.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
107
108
109</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 107</span>
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
<span class='id identifier rubyid_navigate'>navigate</span><span class='period'>.</span><span class='id identifier rubyid_to'>to</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="inspect-instance_method">
- (<tt>Object</tt>) <strong>inspect</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
72
73
74</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 72</span>
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#&lt;%s:0x%x browser=%s&gt;</span><span class='tstring_end'>'</span></span> <span class='op'>%</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='op'>*</span><span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_browser'>browser</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="manage-instance_method">
- (<tt><span class='object_link'><a href="Options.html" title="Selenium::WebDriver::Options (class)">Options</a></span></tt>) <strong>manage</strong>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Options.html" title="Selenium::WebDriver::Options (class)">Options</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="Options.html" title="Selenium::WebDriver::Options (class)">Options</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
99
100
101</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 99</span>
<span class='kw'>def</span> <span class='id identifier rubyid_manage'>manage</span>
<span class='ivar'>@manage</span> <span class='op'>||=</span> <span class='const'>WebDriver</span><span class='op'>::</span><span class='const'>Options</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="navigate-instance_method">
- (<tt><span class='object_link'><a href="Navigation.html" title="Selenium::WebDriver::Navigation (class)">Navigation</a></span></tt>) <strong>navigate</strong>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="Navigation.html" title="Selenium::WebDriver::Navigation (class)">Navigation</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="Navigation.html" title="Selenium::WebDriver::Navigation (class)">Navigation</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
81
82
83</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 81</span>
<span class='kw'>def</span> <span class='id identifier rubyid_navigate'>navigate</span>
<span class='ivar'>@navigate</span> <span class='op'>||=</span> <span class='const'>WebDriver</span><span class='op'>::</span><span class='const'>Navigation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="page_source-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>page_source</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the source of the current page</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
137
138
139</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 137</span>
<span class='kw'>def</span> <span class='id identifier rubyid_page_source'>page_source</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getPageSource'>getPageSource</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="quit-instance_method">
- (<tt>Object</tt>) <strong>quit</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Quit the browser</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
165
166
167</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 165</span>
<span class='kw'>def</span> <span class='id identifier rubyid_quit'>quit</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_quit'>quit</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="ref-instance_method">
- (<tt>Object</tt>) <strong>ref</strong>
</h3><div class="docstring">
<div class="discussion">
<p class="note private">
<strong>This method is part of a private API.</strong>
You should avoid using this method if possible, as it may be removed or be changed in the future.
</p>
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="SearchContext.html" title="Selenium::WebDriver::SearchContext (module)">SearchContext</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
287
288
289</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 287</span>
<span class='kw'>def</span> <span class='id identifier rubyid_ref'>ref</span>
<span class='kw'>nil</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="switch_to-instance_method">
- (<tt><span class='object_link'><a href="TargetLocator.html" title="Selenium::WebDriver::TargetLocator (class)">TargetLocator</a></span></tt>) <strong>switch_to</strong>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="TargetLocator.html" title="Selenium::WebDriver::TargetLocator (class)">TargetLocator</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="TargetLocator.html" title="Selenium::WebDriver::TargetLocator (class)">TargetLocator</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
90
91
92</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 90</span>
<span class='kw'>def</span> <span class='id identifier rubyid_switch_to'>switch_to</span>
<span class='ivar'>@switch_to</span> <span class='op'>||=</span> <span class='const'>WebDriver</span><span class='op'>::</span><span class='const'>TargetLocator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_bridge'>bridge</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="title-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>title</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the title of the current page</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
127
128
129</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 127</span>
<span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getTitle'>getTitle</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="visible=-instance_method">
- (<tt>Object</tt>) <strong>visible=</strong>(bool)
</h3><div class="docstring">
<div class="discussion">
<p>Set the visibility of the browser. Not applicable for all browsers.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'></span>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
157
158
159</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 157</span>
<span class='kw'>def</span> <span class='id identifier rubyid_visible='>visible=</span><span class='lparen'>(</span><span class='id identifier rubyid_bool'>bool</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_setBrowserVisible'>setBrowserVisible</span> <span class='id identifier rubyid_bool'>bool</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="visible?-instance_method">
- (<tt>Boolean</tt>) <strong>visible?</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the visibility of the browser. Not applicable for all browsers.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
147
148
149</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 147</span>
<span class='kw'>def</span> <span class='id identifier rubyid_visible?'>visible?</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getBrowserVisible'>getBrowserVisible</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="window_handle-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>window_handle</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the current window handle</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
194
195
196</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 194</span>
<span class='kw'>def</span> <span class='id identifier rubyid_window_handle'>window_handle</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getCurrentWindowHandle'>getCurrentWindowHandle</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="window_handles-instance_method">
- (<tt>Array</tt>) <strong>window_handles</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the window handles of open browser windows.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="TargetLocator.html#window-instance_method" title="Selenium::WebDriver::TargetLocator#window (method)">TargetLocator#window</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
184
185
186</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/driver.rb', line 184</span>
<span class='kw'>def</span> <span class='id identifier rubyid_window_handles'>window_handles</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getWindowHandles'>getWindowHandles</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Thu Jul 19 12:32:27 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.1 (ruby-1.9.3).
</div>
</body>
</html>