blob: b965337ee41550e6382f093cf0651f08b6c20cf3 [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::Element
&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 (E)</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">Element</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::Element
</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::Element</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/element.rb</dd>
</dl>
<div class="clear"></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>
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="#%3D%3D-instance_method" title="#== (instance method)">- (Object) <strong>==</strong>(other) </a>
(also: #eql?)
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Object) <strong>as_json</strong>(opts = nil) </a>
</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'>
<p>For Rails 3 - <a
href="http://jonathanjulian.com/2010/04/rails-to_json-or-as_json">jonathanjulian.com/2010/04/rails-to_json-or-as_json</a>/.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#attribute-instance_method" title="#attribute (instance method)">- (String<sup>?</sup>) <strong>attribute</strong>(name) </a>
(also: #[])
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the value of a the given attribute of the element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#clear-instance_method" title="#clear (instance method)">- (Object) <strong>clear</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>If this element is a text entry element, this will clear the value.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#click-instance_method" title="#click (instance method)">- (Object) <strong>click</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Click this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#css_value-instance_method" title="#css_value (instance method)">- (Object) <strong>css_value</strong>(prop) </a>
(also: #style)
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the value of the given CSS property.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#displayed%3F-instance_method" title="#displayed? (instance method)">- (Boolean) <strong>displayed?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Is the element displayed?.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#enabled%3F-instance_method" title="#enabled? (instance method)">- (Boolean) <strong>enabled?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Is the element enabled?.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#hash-instance_method" title="#hash (instance method)">- (Object) <strong>hash</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Element) <strong>initialize</strong>(bridge, id) </a>
</span>
<span class="note title constructor">constructor</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'>
<p>Creates a new Element.</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="#location-instance_method" title="#location (instance method)">- (WebDriver::Point) <strong>location</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the location of this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#location_once_scrolled_into_view-instance_method" title="#location_once_scrolled_into_view (instance method)">- (WebDriver::Point) <strong>location_once_scrolled_into_view</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Determine an element's location on the screen once it has been scrolled
into view.</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'>
<p>for SearchContext and execute_script.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#selected%3F-instance_method" title="#selected? (instance method)">- (Boolean) <strong>selected?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Is the element selected?.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#send_keys-instance_method" title="#send_keys (instance method)">- (Object) <strong>send_keys</strong>(*args) </a>
(also: #send_key)
</span>
<span class="summary_desc"><div class='inline'>
<p>Send keystrokes to this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#size-instance_method" title="#size (instance method)">- (WebDriver::Dimension) <strong>size</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the size of this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#submit-instance_method" title="#submit (instance method)">- (Object) <strong>submit</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Submit this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#tag_name-instance_method" title="#tag_name (instance method)">- (String) <strong>tag_name</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the tag name of the element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#text-instance_method" title="#text (instance method)">- (String) <strong>text</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the text content of this element.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_json-instance_method" title="#to_json (instance method)">- (Object) <strong>to_json</strong>(*args) </a>
</span>
<span class="private note title">private</span>
<span class="summary_desc"><div class='inline'>
<p>Convert to a WebElement JSON Object for transmission over the wire.</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::Element (class)">Element</a></span></tt>) <strong>initialize</strong>(bridge, id)
</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>Creates a new Element</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 12</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='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
<span class='ivar'>@bridge</span><span class='comma'>,</span> <span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_bridge'>bridge</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</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>Object</tt>) <strong>==</strong>(other)
<span class="aliases">Also known as:
<span class="names"><span id='eql?-instance_method'>eql?</span></span>
</span>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 20</span>
<span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_elementEquals'>elementEquals</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="as_json-instance_method">
- (<tt>Object</tt>) <strong>as_json</strong>(opts = nil)
</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>For Rails 3 - <a
href="http://jonathanjulian.com/2010/04/rails-to_json-or-as_json">jonathanjulian.com/2010/04/rails-to_json-or-as_json</a>/</p>
</div>
</div>
<div class="tags">
</div><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/element.rb', line 274</span>
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='lbrace'>{</span> <span class='symbol'>:ELEMENT</span> <span class='op'>=&gt;</span> <span class='ivar'>@id</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="attribute-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt><sup>?</sup>) <strong>attribute</strong>(name)
<span class="aliases">Also known as:
<span class="names"><span id='[]-instance_method'>[]</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Get the value of a the given attribute of the element. Will return the
current value, even if this has been modified after the page has been
loaded. More exactly, this method will return the value of the given
attribute, unless that attribute is not present, in which case the value of
the property with the same name is returned. If neither value is set, nil
is returned. The "style" attribute is converted as best can be to a text
representation with a trailing semi-colon. The following are deemed to be
"boolean" attributes, and will return either "true" or "false":</p>
<p>async, autofocus, autoplay, checked, compact, complete, controls, declare,
defaultchecked, defaultselected, defer, disabled, draggable, ended,
formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope,
loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open,
paused, pubdate, readonly, required, reversed, scoped, seamless, seeking,
selected, spellcheck, truespeed, willvalidate</p>
<p>Finally, the following commonly mis-capitalized attribute/property names
are evaluated as expected:</p>
<p>class, readonly</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>attribute</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>name</p>
</div>
</li>
</ul>
<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>, <tt>nil</tt>)</span>
&mdash;
<div class='inline'>
<p>attribute value</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
97
98
99</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 97</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attribute'>attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementAttribute'>getElementAttribute</span> <span class='ivar'>@id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="clear-instance_method">
- (<tt>Object</tt>) <strong>clear</strong>
</h3><div class="docstring">
<div class="discussion">
<p>If this element is a text entry element, this will clear the value. Has no
effect on other elements. Text entry elements are INPUT and TEXTAREA
elements.</p>
<p>Note that the events fired by this event may not be as you'd expect. In
particular, we don't fire any keyboard or mouse events. If you want to
ensure keyboard events are fired, consider using #send_keys with the
backspace key. To ensure you get a change event, consider following with a
call to #send_keys with the tab key.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
140
141
142</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 140</span>
<span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_clearElement'>clearElement</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="click-instance_method">
- (<tt>Object</tt>) <strong>click</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Click this element. If this causes a new page to load, this method will
attempt to block until the page has loaded. At this point, you should
discard all references to this element and any further operations performed
on this element will raise a StaleElementReferenceError unless you know
that the element and the page will still be present. If click() causes a
new page to be loaded via an event or is done by sending a native event
then the method will <b>not</b> wait for it to be loaded and the caller
should verify that a new page has been loaded.</p>
<p>There are some preconditions for an element to be clicked. The element
must be visible and it must have a height and width greater then 0.</p>
<p>Equivalent to:</p>
<pre class="code ruby"><code><span class='id identifier rubyid_driver'>driver</span><span class='period'>.</span><span class='id identifier rubyid_action'>action</span><span class='period'>.</span><span class='id identifier rubyid_click'>click</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='rparen'>)</span></code></pre>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<p class="example_title"><div class='inline'>
<p>Click on a button</p>
</div></p>
<pre class="example code">
<span class='id identifier rubyid_driver'>driver</span><span class='period'>.</span><span class='id identifier rubyid_find_element'>find_element</span><span class='lparen'>(</span><span class='symbol'>:tag_name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>button</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_click'>click</span></pre>
</div>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>StaleElementReferenceError</tt>)</span>
&mdash;
<div class='inline'>
<p>if the element no longer exists as defined</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
53
54
55</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 53</span>
<span class='kw'>def</span> <span class='id identifier rubyid_click'>click</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_clickElement'>clickElement</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="css_value-instance_method">
- (<tt>Object</tt>) <strong>css_value</strong>(prop)
<span class="aliases">Also known as:
<span class="names"><span id='style-instance_method'>style</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Get the value of the given CSS property</p>
<p>Note that shorthand CSS properties (e.g. background, font, border,
border-top, margin, margin-top, padding, padding-top, list-style, outline,
pause, cue) are not returned, in accordance with the DOM CSS2 specification
- you should directly access the longhand properties (e.g.
background-color) to access the desired values.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li><a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration" target="_parent" title="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration">http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration</a></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
193
194
195</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 193</span>
<span class='kw'>def</span> <span class='id identifier rubyid_css_value'>css_value</span><span class='lparen'>(</span><span class='id identifier rubyid_prop'>prop</span><span class='rparen'>)</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementValueOfCssProperty'>getElementValueOfCssProperty</span> <span class='ivar'>@id</span><span class='comma'>,</span> <span class='id identifier rubyid_prop'>prop</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="displayed?-instance_method">
- (<tt>Boolean</tt>) <strong>displayed?</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Is the element displayed?</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">
170
171
172</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 170</span>
<span class='kw'>def</span> <span class='id identifier rubyid_displayed?'>displayed?</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_isElementDisplayed'>isElementDisplayed</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="enabled?-instance_method">
- (<tt>Boolean</tt>) <strong>enabled?</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Is the element enabled?</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">
150
151
152</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 150</span>
<span class='kw'>def</span> <span class='id identifier rubyid_enabled?'>enabled?</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_isElementEnabled'>isElementEnabled</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="hash-instance_method">
- (<tt>Object</tt>) <strong>hash</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 25</span>
<span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span>
<span class='ivar'>@id</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span> <span class='op'>^</span> <span class='ivar'>@bridge</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</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">
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 16</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 id=%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='ivar'>@id</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="location-instance_method">
- (<tt><span class='object_link'><a href="Point.html" title="Selenium::WebDriver::Point (class)">WebDriver::Point</a></span></tt>) <strong>location</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the location of this element.</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="Point.html" title="Selenium::WebDriver::Point (class)">WebDriver::Point</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
204
205
206</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 204</span>
<span class='kw'>def</span> <span class='id identifier rubyid_location'>location</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementLocation'>getElementLocation</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="location_once_scrolled_into_view-instance_method">
- (<tt><span class='object_link'><a href="Point.html" title="Selenium::WebDriver::Point (class)">WebDriver::Point</a></span></tt>) <strong>location_once_scrolled_into_view</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Determine an element's location on the screen once it has been scrolled
into view.</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="Point.html" title="Selenium::WebDriver::Point (class)">WebDriver::Point</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
214
215
216</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 214</span>
<span class='kw'>def</span> <span class='id identifier rubyid_location_once_scrolled_into_view'>location_once_scrolled_into_view</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementLocationOnceScrolledIntoView'>getElementLocationOnceScrolledIntoView</span> <span class='ivar'>@id</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>
<p>for SearchContext and execute_script</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
253
254
255</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 253</span>
<span class='kw'>def</span> <span class='id identifier rubyid_ref'>ref</span>
<span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="selected?-instance_method">
- (<tt>Boolean</tt>) <strong>selected?</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Is the element selected?</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">
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 160</span>
<span class='kw'>def</span> <span class='id identifier rubyid_selected?'>selected?</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_isElementSelected'>isElementSelected</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="send_keys-instance_method">
- (<tt>Object</tt>) <strong>send_keys</strong>(*args)
<span class="aliases">Also known as:
<span class="names"><span id='send_key-instance_method'>send_key</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Send keystrokes to this element</p>
<p>Examples:</p>
<pre class="code ruby"><code><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_send_keys'>send_keys</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>foo</span><span class='tstring_end'>&quot;</span></span> <span class='comment'>#=&gt; value: 'foo'
</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_send_keys'>send_keys</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>tet</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:arrow_left</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>s</span><span class='tstring_end'>&quot;</span></span> <span class='comment'>#=&gt; value: 'test'
</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_send_keys'>send_keys</span> <span class='lbracket'>[</span><span class='symbol'>:control</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:space</span> <span class='comment'>#=&gt; value: ' '</span></code></pre>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'></span>
<span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>, <tt>Symbol</tt>, <tt>Array</tt>)</span>
</li>
</ul>
<p class="tag_title">See Also:</p>
<ul class="see">
<li><span class='object_link'><a href="Keys.html#KEYS-constant" title="Selenium::WebDriver::Keys::KEYS (constant)">Keys::KEYS</a></span></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
125
126
127</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 125</span>
<span class='kw'>def</span> <span class='id identifier rubyid_send_keys'>send_keys</span><span class='lparen'>(</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_sendKeysToElement'>sendKeysToElement</span> <span class='ivar'>@id</span><span class='comma'>,</span> <span class='const'>Keys</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</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="size-instance_method">
- (<tt><span class='object_link'><a href="Dimension.html" title="Selenium::WebDriver::Dimension (class)">WebDriver::Dimension</a></span></tt>) <strong>size</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the size of this element</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="Dimension.html" title="Selenium::WebDriver::Dimension (class)">WebDriver::Dimension</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
224
225
226</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 224</span>
<span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementSize'>getElementSize</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="submit-instance_method">
- (<tt>Object</tt>) <strong>submit</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Submit this element</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
178
179
180</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 178</span>
<span class='kw'>def</span> <span class='id identifier rubyid_submit'>submit</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_submitElement'>submitElement</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="tag_name-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>tag_name</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the tag name of the element.</p>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<p class="example_title"><div class='inline'>
<p>Get the tagname of an INPUT element(returns "input")</p>
</div></p>
<pre class="example code">
<span class='id identifier rubyid_driver'>driver</span><span class='period'>.</span><span class='id identifier rubyid_find_element'>find_element</span><span class='lparen'>(</span><span class='symbol'>:xpath</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>//input</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag_name'>tag_name</span></pre>
</div>
<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>
&mdash;
<div class='inline'>
<p>The tag name of this element.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
67
68
69</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 67</span>
<span class='kw'>def</span> <span class='id identifier rubyid_tag_name'>tag_name</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementTagName'>getElementTagName</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="text-instance_method">
- (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>text</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Get the text content of this element</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">
107
108
109</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 107</span>
<span class='kw'>def</span> <span class='id identifier rubyid_text'>text</span>
<span class='id identifier rubyid_bridge'>bridge</span><span class='period'>.</span><span class='id identifier rubyid_getElementText'>getElementText</span> <span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="to_json-instance_method">
- (<tt>Object</tt>) <strong>to_json</strong>(*args)
</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>Convert to a WebElement JSON Object for transmission over the wire.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">See Also:</p>
<ul class="see">
<li><a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#Basic_Concepts_And_Terms" target="_parent" title="http://code.google.com/p/selenium/wiki/JsonWireProtocol#Basic_Concepts_And_Terms">http://code.google.com/p/selenium/wiki/JsonWireProtocol#Basic_Concepts_And_Terms</a></li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
264
265
266</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rb/lib/selenium/webdriver/common/element.rb', line 264</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
<span class='const'>WebDriver</span><span class='period'>.</span><span class='id identifier rubyid_json_dump'>json_dump</span> <span class='id identifier rubyid_as_json'>as_json</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Thu Jul 19 12:32:29 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>