2008-12-02 10:05:41 +01:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
<!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>
|
|
|
|
|
<title>Module: SeleniumOnRails::TestBuilderActions</title>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
|
|
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
|
|
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
// <![CDATA[
|
|
|
|
|
|
|
|
|
|
function popupCode( url ) {
|
|
|
|
|
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggleCode( id ) {
|
|
|
|
|
if ( document.getElementById )
|
|
|
|
|
elem = document.getElementById( id );
|
|
|
|
|
else if ( document.all )
|
|
|
|
|
elem = eval( "document.all." + id );
|
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
elemStyle = elem.style;
|
|
|
|
|
|
|
|
|
|
if ( elemStyle.display != "block" ) {
|
|
|
|
|
elemStyle.display = "block"
|
|
|
|
|
} else {
|
|
|
|
|
elemStyle.display = "none"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Make codeblocks hidden by default
|
|
|
|
|
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
|
|
|
|
|
|
|
|
// ]]>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="classHeader">
|
|
|
|
|
<table class="header-table">
|
|
|
|
|
<tr class="top-aligned-row">
|
|
|
|
|
<td><strong>Module</strong></td>
|
|
|
|
|
<td class="class-name-in-header">SeleniumOnRails::TestBuilderActions</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr class="top-aligned-row">
|
|
|
|
|
<td><strong>In:</strong></td>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="../../files/lib/selenium_on_rails/test_builder_actions_rb.html">
|
|
|
|
|
lib/selenium_on_rails/test_builder_actions.rb
|
|
|
|
|
</a>
|
|
|
|
|
<br />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- banner header -->
|
|
|
|
|
|
|
|
|
|
<div id="bodyContent">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="contextContent">
|
|
|
|
|
|
|
|
|
|
<div id="description">
|
|
|
|
|
<p>
|
|
|
|
|
The actions available for <a
|
|
|
|
|
href="TestBuilder.html">SeleniumOnRails::TestBuilder</a> tests.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
For each action <tt>foo</tt> there‘s also an action
|
|
|
|
|
<tt>foo_and_wait</tt>.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-list">
|
|
|
|
|
<h3 class="section-bar">Methods</h3>
|
|
|
|
|
|
|
|
|
|
<div class="name-list">
|
|
|
|
|
<a href="#M000023">add_selection</a>
|
|
|
|
|
<a href="#M000034">alt_key_down</a>
|
|
|
|
|
<a href="#M000035">alt_key_up</a>
|
|
|
|
|
<a href="#M000030">answer_on_next_prompt</a>
|
|
|
|
|
<a href="#M000036">brake</a>
|
|
|
|
|
<a href="#M000020">check</a>
|
|
|
|
|
<a href="#M000029">choose_cancel_on_next_confirmation</a>
|
|
|
|
|
<a href="#M000011">click</a>
|
|
|
|
|
<a href="#M000012">click_at</a>
|
|
|
|
|
<a href="#M000033">close</a>
|
|
|
|
|
<a href="#M000037">control_key_down</a>
|
|
|
|
|
<a href="#M000038">control_key_up</a>
|
|
|
|
|
<a href="#M000039">create_cookie</a>
|
|
|
|
|
<a href="#M000040">delete_cookie</a>
|
|
|
|
|
<a href="#M000041">double_click</a>
|
|
|
|
|
<a href="#M000042">double_click_at</a>
|
|
|
|
|
<a href="#M000043">drag_and_drop</a>
|
|
|
|
|
<a href="#M000044">drag_and_drop_to_object</a>
|
|
|
|
|
<a href="#M000045">echo</a>
|
|
|
|
|
<a href="#M000013">fire_event</a>
|
|
|
|
|
<a href="#M000031">go_back</a>
|
|
|
|
|
<a href="#M000046">highlight</a>
|
|
|
|
|
<a href="#M000010">include_partial</a>
|
|
|
|
|
<a href="#M000015">key_down</a>
|
|
|
|
|
<a href="#M000014">key_press</a>
|
|
|
|
|
<a href="#M000016">key_up</a>
|
|
|
|
|
<a href="#M000047">meta_key_down</a>
|
|
|
|
|
<a href="#M000048">meta_key_up</a>
|
|
|
|
|
<a href="#M000018">mouse_down</a>
|
|
|
|
|
<a href="#M000049">mouse_down_at</a>
|
|
|
|
|
<a href="#M000050">mouse_move</a>
|
|
|
|
|
<a href="#M000051">mouse_move_at</a>
|
|
|
|
|
<a href="#M000052">mouse_out</a>
|
|
|
|
|
<a href="#M000017">mouse_over</a>
|
|
|
|
|
<a href="#M000053">mouse_up</a>
|
|
|
|
|
<a href="#M000054">mouse_up_at</a>
|
|
|
|
|
<a href="#M000026">open</a>
|
|
|
|
|
<a href="#M000055">open_window</a>
|
|
|
|
|
<a href="#M000056">pause</a>
|
|
|
|
|
<a href="#M000032">refresh</a>
|
|
|
|
|
<a href="#M000057">remove_all_selections</a>
|
|
|
|
|
<a href="#M000024">remove_selection</a>
|
|
|
|
|
<a href="#M000022">select</a>
|
|
|
|
|
<a href="#M000058">select_frame</a>
|
|
|
|
|
<a href="#M000027">select_window</a>
|
|
|
|
|
<a href="#M000067">set_context</a>
|
|
|
|
|
<a href="#M000059">set_cursor_position</a>
|
|
|
|
|
<a href="#M000060">set_mouse_speed</a>
|
|
|
|
|
<a href="#M000069">set_timeout</a>
|
|
|
|
|
<a href="#M000009">setup</a>
|
|
|
|
|
<a href="#M000061">shift_key_down</a>
|
|
|
|
|
<a href="#M000062">shift_key_up</a>
|
|
|
|
|
<a href="#M000063">store</a>
|
|
|
|
|
<a href="#M000025">submit</a>
|
|
|
|
|
<a href="#M000019">type</a>
|
|
|
|
|
<a href="#M000064">type_keys</a>
|
|
|
|
|
<a href="#M000021">uncheck</a>
|
|
|
|
|
<a href="#M000068">wait_for_condition</a>
|
|
|
|
|
<a href="#M000070">wait_for_page_to_load</a>
|
|
|
|
|
<a href="#M000028">wait_for_popup</a>
|
|
|
|
|
<a href="#M000065">window_focus</a>
|
|
|
|
|
<a href="#M000066">window_maximize</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- if includes -->
|
|
|
|
|
|
|
|
|
|
<div id="section">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- if method_list -->
|
|
|
|
|
<div id="methods">
|
|
|
|
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000023" class="method-detail">
|
|
|
|
|
<a name="M000023"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000023" class="method-signature">
|
|
|
|
|
<span class="method-name">add_selection</span><span class="method-args">(locator, option_locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Add a selection to the set of selected options in a multi-<a
|
|
|
|
|
href="TestBuilderActions.html#M000022">select</a> element using an option
|
|
|
|
|
locator.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
See the <tt><a href="TestBuilderActions.html#M000022">select</a></tt>
|
|
|
|
|
command for more information about option locators.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000023-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 148</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
148: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_selection</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
|
|
|
|
149: <span class="ruby-identifier">command</span> <span class="ruby-value str">'addSelection'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
150: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000034" class="method-detail">
|
|
|
|
|
<a name="M000034"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000034" class="method-signature">
|
|
|
|
|
<span class="method-name">alt_key_down</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user pressing the alt key and hold it down until do_alt_up()
|
|
|
|
|
is called or a new page is loaded.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000034-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 221</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
221: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">alt_key_down</span>
|
|
|
|
|
222: <span class="ruby-identifier">command</span> <span class="ruby-value str">'altKeyDown'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
223: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000035" class="method-detail">
|
|
|
|
|
<a name="M000035"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000035" class="method-signature">
|
|
|
|
|
<span class="method-name">alt_key_up</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user releasing the alt key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000035-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 226</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
226: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">alt_key_up</span>
|
|
|
|
|
227: <span class="ruby-identifier">command</span> <span class="ruby-value str">'altKeyUp'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
228: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000030" class="method-detail">
|
|
|
|
|
<a name="M000030"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000030" class="method-signature">
|
|
|
|
|
<span class="method-name">answer_on_next_prompt</span><span class="method-args">(answer)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Instructs Selenium to return the specified answer string in response to the
|
|
|
|
|
next JavaScript prompt (<tt>window.prompt()</tt>).
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000030-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 199</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
199: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">answer_on_next_prompt</span> <span class="ruby-identifier">answer</span>
|
|
|
|
|
200: <span class="ruby-identifier">command</span> <span class="ruby-value str">'answerOnNextPrompt'</span>, <span class="ruby-identifier">answer</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
201: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000036" class="method-detail">
|
|
|
|
|
<a name="M000036"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000036" class="method-signature">
|
|
|
|
|
<span class="method-name">brake</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Halt the currently running test, and wait for the user to press the
|
|
|
|
|
Continue button. This command is useful for debugging, but be careful when
|
|
|
|
|
using it, because it will force automated tests to hang until a user
|
|
|
|
|
intervenes manually.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
NOTE: <tt>break</tt> is a reserved word in Ruby, so we have to simulate
|
|
|
|
|
Selenium core‘s <tt>break()</tt> with <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000036">brake</a>()</tt>
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000036-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 236</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
236: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">brake</span>
|
|
|
|
|
237: <span class="ruby-identifier">command</span> <span class="ruby-value str">'break'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
238: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000020" class="method-detail">
|
|
|
|
|
<a name="M000020"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000020" class="method-signature">
|
|
|
|
|
<span class="method-name">check</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Check a toggle-button (checkbox/radio).
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000020-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 108</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
109: <span class="ruby-identifier">command</span> <span class="ruby-value str">'check'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
110: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000029" class="method-detail">
|
|
|
|
|
<a name="M000029"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000029" class="method-signature">
|
|
|
|
|
<span class="method-name">choose_cancel_on_next_confirmation</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
By default, Selenium‘s overridden <tt>window.confirm()</tt> function
|
|
|
|
|
will return <tt>true</tt>, as if the user had manually clicked OK. After
|
|
|
|
|
running this command, the next call to <tt>confirm()</tt> will return
|
|
|
|
|
<tt>false</tt>, as if the user had clicked Cancel.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000029-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 193</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
193: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">choose_cancel_on_next_confirmation</span>
|
|
|
|
|
194: <span class="ruby-identifier">command</span> <span class="ruby-value str">'chooseCancelOnNextConfirmation'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
195: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000011" class="method-detail">
|
|
|
|
|
<a name="M000011"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000011" class="method-signature">
|
|
|
|
|
<span class="method-name">click</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Clicks on a link, button, checkbox or radio button. If the <a
|
|
|
|
|
href="TestBuilderActions.html#M000011">click</a> action causes a new page
|
|
|
|
|
to load (like a link usually does), call <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000070">wait_for_page_to_load</a></tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000011-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 47</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">click</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
48: <span class="ruby-identifier">command</span> <span class="ruby-value str">'click'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
49: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000012" class="method-detail">
|
|
|
|
|
<a name="M000012"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000012" class="method-signature">
|
|
|
|
|
<span class="method-name">click_at</span><span class="method-args">(locator, coord_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Clicks on a link, button, checkbox or radio button. If the <a
|
|
|
|
|
href="TestBuilderActions.html#M000011">click</a> action causes a new page
|
|
|
|
|
to load (like a link usually does), call <a
|
|
|
|
|
href="TestBuilderActions.html#M000070">wait_for_page_to_load</a>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000012-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 53</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">click_at</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
|
|
|
|
54: <span class="ruby-identifier">command</span> <span class="ruby-value str">'clickAt'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
55: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000033" class="method-detail">
|
|
|
|
|
<a name="M000033"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000033" class="method-signature">
|
|
|
|
|
<span class="method-name">close</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user clicking the "<a
|
|
|
|
|
href="TestBuilderActions.html#M000033">close</a>" button in the
|
|
|
|
|
titlebar of a popup window or tab.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000033-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 215</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
215: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
|
|
|
|
216: <span class="ruby-identifier">command</span> <span class="ruby-value str">'close'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
217: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000037" class="method-detail">
|
|
|
|
|
<a name="M000037"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000037" class="method-signature">
|
|
|
|
|
<span class="method-name">control_key_down</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user pressing the alt key and hold it down until
|
|
|
|
|
do_control_up() is called or a new page is loaded.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000037-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 242</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
242: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">control_key_down</span>
|
|
|
|
|
243: <span class="ruby-identifier">command</span> <span class="ruby-value str">'controlKeyDown'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
244: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000038" class="method-detail">
|
|
|
|
|
<a name="M000038"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000038" class="method-signature">
|
|
|
|
|
<span class="method-name">control_key_up</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user releasing the control key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000038-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 247</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
247: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">control_key_up</span>
|
|
|
|
|
248: <span class="ruby-identifier">command</span> <span class="ruby-value str">'controlKeyUp'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
249: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000039" class="method-detail">
|
|
|
|
|
<a name="M000039"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000039" class="method-signature">
|
|
|
|
|
<span class="method-name">create_cookie</span><span class="method-args">(name_value_pair, options_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Create a new cookie whose path and domain are same with those of current
|
|
|
|
|
page under test, unless you specified a path for this cookie explicitly.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Arguments:
|
|
|
|
|
</p>
|
|
|
|
|
<ul>
|
|
|
|
|
<li><tt>name_value_pair</tt> - name and value of the cookie in a format
|
|
|
|
|
"name=value"
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
<li><tt>options_string</tt> - options for the cookie. Currently supported
|
|
|
|
|
options include ‘path’ and ‘max_age’. The
|
|
|
|
|
options_string‘s format is <tt>"path=/path/,
|
|
|
|
|
max_age=60"</tt>. The order of options are irrelevant, the unit of the
|
|
|
|
|
value of ‘max_age’ is second.
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000039-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 260</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_cookie</span> <span class="ruby-identifier">name_value_pair</span>, <span class="ruby-identifier">options_string</span>
|
|
|
|
|
261: <span class="ruby-identifier">command</span> <span class="ruby-value str">'createCookie'</span>, <span class="ruby-identifier">name_value_pair</span>, <span class="ruby-identifier">options_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
262: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000040" class="method-detail">
|
|
|
|
|
<a name="M000040"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000040" class="method-signature">
|
|
|
|
|
<span class="method-name">delete_cookie</span><span class="method-args">(name, path)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Delete a named cookie with specified path.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000040-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 265</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
265: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_cookie</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>
|
|
|
|
|
266: <span class="ruby-identifier">command</span> <span class="ruby-value str">'deleteCookie'</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">path</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
267: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000041" class="method-detail">
|
|
|
|
|
<a name="M000041"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000041" class="method-signature">
|
|
|
|
|
<span class="method-name">double_click</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Double clicks on a link, button, checkbox or radio button. If the double <a
|
|
|
|
|
href="TestBuilderActions.html#M000011">click</a> action causes a new page
|
|
|
|
|
to load (like a link usually does), call <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000070">wait_for_page_to_load</a></tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000041-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 271</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
271: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_click</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
272: <span class="ruby-identifier">command</span> <span class="ruby-value str">'doubleClick'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
273: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000042" class="method-detail">
|
|
|
|
|
<a name="M000042"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000042" class="method-signature">
|
|
|
|
|
<span class="method-name">double_click_at</span><span class="method-args">(locator, coord_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Doubleclicks on a link, button, checkbox or radio button. If the action
|
|
|
|
|
causes a new page to load (like a link usually does), call <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000070">wait_for_page_to_load</a></tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000042-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 277</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
277: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_click_at</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
|
|
|
|
278: <span class="ruby-identifier">command</span> <span class="ruby-value str">'doubleClickAt'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
279: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000043" class="method-detail">
|
|
|
|
|
<a name="M000043"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000043" class="method-signature">
|
|
|
|
|
<span class="method-name">drag_and_drop</span><span class="method-args">(locator, movements_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Drags an element a certain distance and then drops it.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000043-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 282</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
282: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drag_and_drop</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">movements_string</span>
|
|
|
|
|
283: <span class="ruby-identifier">command</span> <span class="ruby-value str">'dragAndDrop'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">movements_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
284: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000044" class="method-detail">
|
|
|
|
|
<a name="M000044"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000044" class="method-signature">
|
|
|
|
|
<span class="method-name">drag_and_drop_to_object</span><span class="method-args">(locator_of_object_to_be_dragged, locator_of_drag_destination_object)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Drags an element and drops it on another element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000044-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 287</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
287: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drag_and_drop_to_object</span> <span class="ruby-identifier">locator_of_object_to_be_dragged</span>, <span class="ruby-identifier">locator_of_drag_destination_object</span>
|
|
|
|
|
288: <span class="ruby-identifier">command</span> <span class="ruby-value str">'dragAndDropToObject'</span>, <span class="ruby-identifier">locator_of_object_to_be_dragged</span>, <span class="ruby-identifier">locator_of_drag_destination_object</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
289: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000045" class="method-detail">
|
|
|
|
|
<a name="M000045"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000045" class="method-signature">
|
|
|
|
|
<span class="method-name">echo</span><span class="method-args">(message)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Prints the specified message into the third table cell in your <a
|
|
|
|
|
href="Selenese.html">Selenese</a> tables. Useful for debugging.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000045-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 294</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
294: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">echo</span> <span class="ruby-identifier">message</span>
|
|
|
|
|
295: <span class="ruby-identifier">command</span> <span class="ruby-value str">'echo'</span>, <span class="ruby-identifier">message</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
296: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000013" class="method-detail">
|
|
|
|
|
<a name="M000013"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000013" class="method-signature">
|
|
|
|
|
<span class="method-name">fire_event</span><span class="method-args">(locator, event_name)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Explicitly simulate an event (e.g. <tt>"focus"</tt>,
|
|
|
|
|
<tt>"blur"</tt>), to trigger the corresponding
|
|
|
|
|
<tt>"on_event_"</tt> handler.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000013-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 59</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
59: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fire_event</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">event_name</span>
|
|
|
|
|
60: <span class="ruby-identifier">command</span> <span class="ruby-value str">'fireEvent'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">event_name</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
61: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000031" class="method-detail">
|
|
|
|
|
<a name="M000031"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000031" class="method-signature">
|
|
|
|
|
<span class="method-name">go_back</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user clicking the "back" button on their browser.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000031-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 204</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">go_back</span>
|
|
|
|
|
205: <span class="ruby-identifier">command</span> <span class="ruby-value str">'goBack'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
206: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000046" class="method-detail">
|
|
|
|
|
<a name="M000046"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000046" class="method-signature">
|
|
|
|
|
<span class="method-name">highlight</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Briefly changes the backgroundColor of the specified element yellow. Useful
|
|
|
|
|
for debugging.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000046-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 300</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
300: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">highlight</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
301: <span class="ruby-identifier">command</span> <span class="ruby-value str">'highlight'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
302: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000010" class="method-detail">
|
|
|
|
|
<a name="M000010"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000010" class="method-signature">
|
|
|
|
|
<span class="method-name">include_partial</span><span class="method-args">(path, local_assigns = {})</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Includes a partial. The path is relative to the Selenium tests root. The
|
|
|
|
|
starting _ and the file extension don‘t have to be specified.
|
|
|
|
|
</p>
|
|
|
|
|
<pre>
|
|
|
|
|
#include test/selenium/_partial.*
|
|
|
|
|
include_partial 'partial'
|
|
|
|
|
#include test/selenium/suite/_partial.*
|
|
|
|
|
include_partial 'suite/partial'
|
|
|
|
|
#include test/selenium/suite/_partial.* and provide local assigns
|
|
|
|
|
include_partial 'suite/partial', :foo => bar
|
|
|
|
|
</pre>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000010-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 39</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include_partial</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">local_assigns</span> = {}
|
|
|
|
|
40: <span class="ruby-identifier">partial</span> = <span class="ruby-ivar">@view</span>.<span class="ruby-identifier">render</span> <span class="ruby-identifier">:partial</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">local_assigns</span>
|
|
|
|
|
41: <span class="ruby-ivar">@output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">partial</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
42: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000015" class="method-detail">
|
|
|
|
|
<a name="M000015"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000015" class="method-signature">
|
|
|
|
|
<span class="method-name">key_down</span><span class="method-args">(locator, keycode)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user pressing a key (without releasing it yet).
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>keycode</tt> is the numeric keycode of the key to be pressed, normally
|
|
|
|
|
the ASCII value of that key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000015-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 75</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_down</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
|
|
|
|
76: <span class="ruby-identifier">command</span> <span class="ruby-value str">'keyDown'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
77: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000014" class="method-detail">
|
|
|
|
|
<a name="M000014"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000014" class="method-signature">
|
|
|
|
|
<span class="method-name">key_press</span><span class="method-args">(locator, keycode)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user pressing and releasing a key.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>keycode</tt> is the numeric keycode of the key to be pressed, normally
|
|
|
|
|
the ASCII value of that key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000014-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 67</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_press</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
|
|
|
|
68: <span class="ruby-identifier">command</span> <span class="ruby-value str">'keyPress'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
69: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000016" class="method-detail">
|
|
|
|
|
<a name="M000016"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000016" class="method-signature">
|
|
|
|
|
<span class="method-name">key_up</span><span class="method-args">(locator, keycode)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user releasing a key.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>keycode</tt> is the numeric keycode of the key to be released, normally
|
|
|
|
|
the ASCII value of that key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000016-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 83</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_up</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
|
|
|
|
84: <span class="ruby-identifier">command</span> <span class="ruby-value str">'keyUp'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">keycode</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
85: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000047" class="method-detail">
|
|
|
|
|
<a name="M000047"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000047" class="method-signature">
|
|
|
|
|
<span class="method-name">meta_key_down</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Press the meta key and hold it down until <tt>doMetaUp()</tt> is called or
|
|
|
|
|
a new page is loaded.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000047-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 306</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
306: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_key_down</span>
|
|
|
|
|
307: <span class="ruby-identifier">command</span> <span class="ruby-value str">'metaKeyDown'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
308: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000048" class="method-detail">
|
|
|
|
|
<a name="M000048"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000048" class="method-signature">
|
|
|
|
|
<span class="method-name">meta_key_up</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Release the meta key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000048-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 311</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
311: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_key_up</span>
|
|
|
|
|
312: <span class="ruby-identifier">command</span> <span class="ruby-value str">'metaKeyUp'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
313: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000018" class="method-detail">
|
|
|
|
|
<a name="M000018"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000018" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_down</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user pressing the mouse button (without releasing it yet) on
|
|
|
|
|
the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000018-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 94</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_down</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
95: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseDown'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
96: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000049" class="method-detail">
|
|
|
|
|
<a name="M000049"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000049" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_down_at</span><span class="method-args">(locator, coord_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user pressing the mouse button (without releasing it yet) on
|
|
|
|
|
the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000049-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 317</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
317: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_down_at</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
|
|
|
|
318: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseDownAt'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
319: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000050" class="method-detail">
|
|
|
|
|
<a name="M000050"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000050" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_move</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user moving the mouse.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000050-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 322</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
322: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_move</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
323: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseMove'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
324: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000051" class="method-detail">
|
|
|
|
|
<a name="M000051"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000051" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_move_at</span><span class="method-args">(locator, coord_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user moving the mouse relative to the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000051-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 327</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
327: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_move_at</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
|
|
|
|
328: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseMoveAt'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
329: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000052" class="method-detail">
|
|
|
|
|
<a name="M000052"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000052" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_out</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user moving the mouse off the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000052-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 332</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
332: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_out</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
333: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseOut'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
334: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000017" class="method-detail">
|
|
|
|
|
<a name="M000017"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000017" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_over</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user hovering a mouse over the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000017-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 88</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_over</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
89: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseOver'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
90: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000053" class="method-detail">
|
|
|
|
|
<a name="M000053"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000053" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_up</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user releasing the mouse button on the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000053-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 337</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
337: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_up</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
338: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseUp'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
339: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000054" class="method-detail">
|
|
|
|
|
<a name="M000054"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000054" class="method-signature">
|
|
|
|
|
<span class="method-name">mouse_up_at</span><span class="method-args">(locator, coord_string)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates a user pressing the mouse button (without releasing it yet) on
|
|
|
|
|
the specified element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000054-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 343</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
343: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mouse_up_at</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
|
|
|
|
344: <span class="ruby-identifier">command</span> <span class="ruby-value str">'mouseUpAt'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">coord_string</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
345: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000026" class="method-detail">
|
|
|
|
|
<a name="M000026"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000026" class="method-signature">
|
|
|
|
|
<span class="method-name">open</span><span class="method-args">(url)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Opens an URL in the test frame. This accepts both relative and absolute
|
|
|
|
|
URLs. The <tt><a href="TestBuilderActions.html#M000026">open</a></tt>
|
|
|
|
|
command waits for the page to load before proceeding, i.e. you don‘t
|
|
|
|
|
have to call <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000070">wait_for_page_to_load</a></tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Note: The URL must be on the same domain as the runner HTML due to security
|
|
|
|
|
restrictions in the browser (Same Origin Policy).
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000026-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 172</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span> <span class="ruby-identifier">url</span>
|
|
|
|
|
173: <span class="ruby-identifier">command</span> <span class="ruby-value str">'open'</span>, <span class="ruby-identifier">url_arg</span>(<span class="ruby-identifier">url</span>)
|
2008-12-02 10:05:41 +01:00
|
|
|
174: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000055" class="method-detail">
|
|
|
|
|
<a name="M000055"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000055" class="method-signature">
|
|
|
|
|
<span class="method-name">open_window</span><span class="method-args">(url, window_id)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Opens a popup window (if a window with that ID isn‘t already <a
|
|
|
|
|
href="TestBuilderActions.html#M000026">open</a>). After opening the window,
|
|
|
|
|
you‘ll need to <a href="TestBuilderActions.html#M000022">select</a>
|
|
|
|
|
it using the <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000027">select_window</a></tt> command.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
This command can also be a useful workaround for bug SEL-339. In some
|
|
|
|
|
cases, Selenium will be unable to intercept a call to window.open (if the
|
|
|
|
|
call occurs during or before the "onLoad" event, for example). In
|
|
|
|
|
those cases, you can force Selenium to notice the <a
|
|
|
|
|
href="TestBuilderActions.html#M000026">open</a> window‘s name by
|
|
|
|
|
using the Selenium openWindow command, using an empty (blank) url, like
|
|
|
|
|
this: <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000055">open_window</a>("",
|
|
|
|
|
"myFunnyWindow")</tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000055-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 355</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
355: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open_window</span> <span class="ruby-identifier">url</span>, <span class="ruby-identifier">window_id</span>
|
|
|
|
|
356: <span class="ruby-identifier">command</span> <span class="ruby-value str">'openWindow'</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">window_id</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
357: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000056" class="method-detail">
|
|
|
|
|
<a name="M000056"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000056" class="method-signature">
|
|
|
|
|
<span class="method-name">pause</span><span class="method-args">(wait_time)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Wait for the specified amount of time (in milliseconds).
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000056-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 360</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
360: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pause</span> <span class="ruby-identifier">wait_time</span>
|
|
|
|
|
361: <span class="ruby-identifier">command</span> <span class="ruby-value str">'pause'</span>, <span class="ruby-identifier">wait_time</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
362: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000032" class="method-detail">
|
|
|
|
|
<a name="M000032"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000032" class="method-signature">
|
|
|
|
|
<span class="method-name">refresh</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates the user clicking the "Refresh" button on their
|
|
|
|
|
browser.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000032-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 209</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
209: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">refresh</span>
|
|
|
|
|
210: <span class="ruby-identifier">command</span> <span class="ruby-value str">'refresh'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
211: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000057" class="method-detail">
|
|
|
|
|
<a name="M000057"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000057" class="method-signature">
|
|
|
|
|
<span class="method-name">remove_all_selections</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Unselects all of the selected options in a multi-<a
|
|
|
|
|
href="TestBuilderActions.html#M000022">select</a> element.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000057-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 365</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
365: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_all_selections</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
366: <span class="ruby-identifier">command</span> <span class="ruby-value str">'removeAllSelections'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
367: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000024" class="method-detail">
|
|
|
|
|
<a name="M000024"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000024" class="method-signature">
|
|
|
|
|
<span class="method-name">remove_selection</span><span class="method-args">(locator, option_locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Remove a selection from the set of selected options in a multi-<a
|
|
|
|
|
href="TestBuilderActions.html#M000022">select</a> element using an option
|
|
|
|
|
locator.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
See the <tt><a href="TestBuilderActions.html#M000022">select</a></tt>
|
|
|
|
|
command for more information about option locators.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000024-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 156</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_selection</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
|
|
|
|
157: <span class="ruby-identifier">command</span> <span class="ruby-value str">'removeSelection'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
158: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000022" class="method-detail">
|
|
|
|
|
<a name="M000022"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000022" class="method-signature">
|
|
|
|
|
<span class="method-name">select</span><span class="method-args">(locator, option_locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Select an option from a drop-down using an option locator.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Option locators provide different ways of specifying options of an HTML
|
|
|
|
|
Select element (e.g. for selecting a specific option, or for asserting that
|
|
|
|
|
the selected option satisfies a specification). There are several forms of
|
|
|
|
|
Select Option Locator.
|
|
|
|
|
</p>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>label=labelPattern matches options based on their labels, i.e. the visible
|
|
|
|
|
text. (This is the default.)
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
label=regexp:^[Oo]ther
|
|
|
|
|
</pre>
|
|
|
|
|
</li>
|
|
|
|
|
<li>value=valuePattern matches options based on their values.
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
value=other
|
|
|
|
|
</pre>
|
|
|
|
|
</li>
|
|
|
|
|
<li>id=id matches options based on their ids.
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
id=option1
|
|
|
|
|
</pre>
|
|
|
|
|
</li>
|
|
|
|
|
<li>index=index matches an option based on its index (offset from zero).
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
index=2
|
|
|
|
|
</pre>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>
|
|
|
|
|
If no option locator prefix is provided, the default behaviour is to match
|
|
|
|
|
on label.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000022-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 140</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
|
|
|
|
141: <span class="ruby-identifier">command</span> <span class="ruby-value str">'select'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">option_locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
142: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000058" class="method-detail">
|
|
|
|
|
<a name="M000058"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000058" class="method-signature">
|
|
|
|
|
<span class="method-name">select_frame</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Selects a frame within the current window. (You may invoke this command
|
|
|
|
|
multiple times to <a href="TestBuilderActions.html#M000022">select</a>
|
|
|
|
|
nested frames.) To <a href="TestBuilderActions.html#M000022">select</a> the
|
|
|
|
|
parent frame, use "relative=parent" as a locator; to <a
|
|
|
|
|
href="TestBuilderActions.html#M000022">select</a> the top frame, use
|
|
|
|
|
"relative=top".
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
You may also use a DOM expression to identify the frame you want directly,
|
|
|
|
|
like this: <tt><a
|
|
|
|
|
href="http://"subframe"">dom=frames["main"].frames</a></tt>
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000058-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 375</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
375: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select_frame</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
376: <span class="ruby-identifier">command</span> <span class="ruby-value str">'selectFrame'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
377: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000027" class="method-detail">
|
|
|
|
|
<a name="M000027"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000027" class="method-signature">
|
|
|
|
|
<span class="method-name">select_window</span><span class="method-args">(window_id)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Selects a popup window; once a popup window has been selected, all commands
|
|
|
|
|
go to that window. To <a href="TestBuilderActions.html#M000022">select</a>
|
|
|
|
|
the main window again, use <tt>nil</tt> as the target.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000027-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 178</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
178: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select_window</span> <span class="ruby-identifier">window_id</span>
|
|
|
|
|
179: <span class="ruby-identifier">command</span> <span class="ruby-value str">'selectWindow'</span>, <span class="ruby-identifier">window_id</span><span class="ruby-operator">||</span><span class="ruby-value str">'null'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
180: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000067" class="method-detail">
|
|
|
|
|
<a name="M000067"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000067" class="method-signature">
|
|
|
|
|
<span class="method-name">set_context</span><span class="method-args">(context, log_level_threshold = nil)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Writes a message to the status bar and adds a note to the browser-side log.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>context</tt> is the message sent to the browser.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>log_level_threshold</tt> can be <tt>nil</tt>, <tt>:debug</tt>,
|
|
|
|
|
<tt>:info</tt>, <tt>:warn</tt> or <tt>:error</tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000067-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 448</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
448: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_context</span> <span class="ruby-identifier">context</span>, <span class="ruby-identifier">log_level_threshold</span> = <span class="ruby-keyword kw">nil</span>
|
|
|
|
|
449: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">log_level_threshold</span>
|
|
|
|
|
450: <span class="ruby-identifier">command</span> <span class="ruby-value str">'setContext'</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">log_level_threshold</span>.<span class="ruby-identifier">to_s</span>
|
|
|
|
|
451: <span class="ruby-keyword kw">else</span>
|
|
|
|
|
452: <span class="ruby-identifier">command</span> <span class="ruby-value str">'setContext'</span>, <span class="ruby-identifier">context</span>
|
|
|
|
|
453: <span class="ruby-keyword kw">end</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
454: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000059" class="method-detail">
|
|
|
|
|
<a name="M000059"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000059" class="method-signature">
|
|
|
|
|
<span class="method-name">set_cursor_position</span><span class="method-args">(locator, position)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Moves the text cursor to the specified position in the given input element
|
|
|
|
|
or textarea. This method will fail if the specified element isn‘t an
|
|
|
|
|
input element or textarea.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000059-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 381</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
381: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_cursor_position</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">position</span>
|
|
|
|
|
382: <span class="ruby-identifier">command</span> <span class="ruby-value str">'setCursorPosition'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">position</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
383: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000060" class="method-detail">
|
|
|
|
|
<a name="M000060"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000060" class="method-signature">
|
|
|
|
|
<span class="method-name">set_mouse_speed</span><span class="method-args">(pixels)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Configure the number of pixels between "mousemove" events during
|
|
|
|
|
dragAndDrop commands (default=10). Setting this value to 0 means that
|
|
|
|
|
we‘ll send a "mousemove" event to every single pixel in
|
|
|
|
|
between the start location and the end location; that can be very slow, and
|
|
|
|
|
may cause some browsers to force the JavaScript to timeout.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
If the mouse speed is greater than the distance between the two dragged
|
|
|
|
|
objects, we‘ll just send one "mousemove" at the start
|
|
|
|
|
location and then one final one at the end location.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000060-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 393</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
393: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_mouse_speed</span> <span class="ruby-identifier">pixels</span>
|
|
|
|
|
394: <span class="ruby-identifier">command</span> <span class="ruby-value str">'setMouseSpeed'</span>, <span class="ruby-identifier">pixels</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
395: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000069" class="method-detail">
|
|
|
|
|
<a name="M000069"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000069" class="method-signature">
|
|
|
|
|
<span class="method-name">set_timeout</span><span class="method-args">(timeout)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Specifies the amount of time that Selenium will wait for actions to
|
|
|
|
|
complete.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Actions that require waiting include <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000026">open</a></tt> and the
|
|
|
|
|
<tt>wait_for*</tt> actions.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
The default timeout is 30 seconds.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>timeout</tt> is specified in milliseconds.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000069-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 480</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
480: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_timeout</span> <span class="ruby-identifier">timeout</span>
|
|
|
|
|
481: <span class="ruby-identifier">command</span> <span class="ruby-value str">'setTimeout'</span>, <span class="ruby-identifier">timeout</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
482: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000009" class="method-detail">
|
|
|
|
|
<a name="M000009"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000009" class="method-signature">
|
|
|
|
|
<span class="method-name">setup</span><span class="method-args">(options = {})</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Tell Selenium on Rails to clear the session and load any fixtures. DO NOT
|
|
|
|
|
CALL THIS AGAINST NON-TEST DATABASES. The supported <tt>options</tt> are
|
|
|
|
|
<tt>:keep_session</tt>, <tt>:fixtures</tt> and <tt>:clear_tables</tt>
|
|
|
|
|
</p>
|
|
|
|
|
<pre>
|
|
|
|
|
setup
|
|
|
|
|
setup :keep_session
|
|
|
|
|
setup :fixtures => :all
|
|
|
|
|
setup :keep_session, :fixtures => [:foo, :bar]
|
|
|
|
|
setup :clear_tables => [:foo, :bar]
|
|
|
|
|
</pre>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000009-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 14</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">options</span> = {}
|
|
|
|
|
15: <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">options</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
|
|
|
|
|
16:
|
|
|
|
|
17: <span class="ruby-identifier">opts</span> = {<span class="ruby-identifier">:controller</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'selenium'</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'setup'</span>}
|
|
|
|
|
18: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:keep_session</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">:keep_session</span>
|
|
|
|
|
19:
|
|
|
|
|
20: [<span class="ruby-identifier">:fixtures</span>, <span class="ruby-identifier">:clear_tables</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
|
|
|
|
21: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">f</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">key</span>])
|
|
|
|
|
22: <span class="ruby-identifier">f</span> = [<span class="ruby-identifier">f</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span>
|
|
|
|
|
23: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">join</span> <span class="ruby-value str">','</span>
|
|
|
|
|
24: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
25: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
26:
|
|
|
|
|
27: <span class="ruby-identifier">open</span> <span class="ruby-identifier">opts</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
28: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000061" class="method-detail">
|
|
|
|
|
<a name="M000061"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000061" class="method-signature">
|
|
|
|
|
<span class="method-name">shift_key_down</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Press the shift key and hold it down until <tt>doShiftUp()</tt> is called
|
|
|
|
|
or a new page is loaded.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000061-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 399</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
399: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shift_key_down</span>
|
|
|
|
|
400: <span class="ruby-identifier">command</span> <span class="ruby-value str">'shiftKeyDown'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
401: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000062" class="method-detail">
|
|
|
|
|
<a name="M000062"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000062" class="method-signature">
|
|
|
|
|
<span class="method-name">shift_key_up</span><span class="method-args">()</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Release the shift key.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000062-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 404</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
404: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shift_key_up</span>
|
|
|
|
|
405: <span class="ruby-identifier">command</span> <span class="ruby-value str">'shiftKeyUp'</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
406: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000063" class="method-detail">
|
|
|
|
|
<a name="M000063"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000063" class="method-signature">
|
|
|
|
|
<span class="method-name">store</span><span class="method-args">(expression, variable_name)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
This command is a synonym for <tt>store_expression</tt>.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000063-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 409</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
409: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span> <span class="ruby-identifier">expression</span>, <span class="ruby-identifier">variable_name</span>
|
|
|
|
|
410: <span class="ruby-identifier">command</span> <span class="ruby-value str">'store'</span>, <span class="ruby-identifier">expression</span>, <span class="ruby-identifier">variable_name</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
411: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000025" class="method-detail">
|
|
|
|
|
<a name="M000025"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000025" class="method-signature">
|
|
|
|
|
<span class="method-name">submit</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Submit the specified form. This is particularly useful for forms without <a
|
|
|
|
|
href="TestBuilderActions.html#M000025">submit</a> buttons, e.g.
|
|
|
|
|
single-input "Search" forms.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000025-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 162</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
162: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
163: <span class="ruby-identifier">command</span> <span class="ruby-value str">'submit'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
164: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000019" class="method-detail">
|
|
|
|
|
<a name="M000019"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000019" class="method-signature">
|
|
|
|
|
<span class="method-name">type</span><span class="method-args">(locator, value)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Sets the value of an input field, as though you typed it in.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Can also be used to set the value of combo boxes, <a
|
|
|
|
|
href="TestBuilderActions.html#M000020">check</a> boxes, etc. In these
|
|
|
|
|
cases, <tt>value</tt> should be the value of the option selected, not the
|
|
|
|
|
visible text.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000019-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 103</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
103: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">value</span>
|
|
|
|
|
104: <span class="ruby-identifier">command</span> <span class="ruby-value str">'type'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">value</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
105: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000064" class="method-detail">
|
|
|
|
|
<a name="M000064"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000064" class="method-signature">
|
|
|
|
|
<span class="method-name">type_keys</span><span class="method-args">(locator, value)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Simulates keystroke events on the specified element, as though you typed
|
|
|
|
|
the value key-by-key.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
This is a convenience method for calling <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000015">key_down</a></tt>, <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000016">key_up</a></tt>, <tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000014">key_press</a></tt> for every
|
|
|
|
|
character in the specified string; this is useful for dynamic UI widgets
|
|
|
|
|
(like auto-completing combo boxes) that require explicit key events.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Unlike the simple "<a
|
|
|
|
|
href="TestBuilderActions.html#M000019">type</a>" command, which forces
|
|
|
|
|
the specified value into the page directly, this command may or may not
|
|
|
|
|
have any visible effect, even in cases where typing keys would normally
|
|
|
|
|
have a visible effect. For example, if you use "<tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000064">type_keys</a></tt>" on a form
|
|
|
|
|
element, you may or may not see the results of what you typed in the field.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
In some cases, you may need to use the simple "<a
|
|
|
|
|
href="TestBuilderActions.html#M000019">type</a>" command to set the
|
|
|
|
|
value of the field and then the "<tt><a
|
|
|
|
|
href="TestBuilderActions.html#M000064">type_keys</a></tt>" command to
|
|
|
|
|
send the keystroke events corresponding to what you just typed.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000064-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 428</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
428: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type_keys</span> <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">value</span>
|
|
|
|
|
429: <span class="ruby-identifier">command</span> <span class="ruby-value str">'typeKeys'</span>, <span class="ruby-identifier">locator</span>, <span class="ruby-identifier">value</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
430: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000021" class="method-detail">
|
|
|
|
|
<a name="M000021"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000021" class="method-signature">
|
|
|
|
|
<span class="method-name">uncheck</span><span class="method-args">(locator)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Uncheck a toggle-button (checkbox/radio).
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000021-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 113</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uncheck</span> <span class="ruby-identifier">locator</span>
|
|
|
|
|
114: <span class="ruby-identifier">command</span> <span class="ruby-value str">'uncheck'</span>, <span class="ruby-identifier">locator</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
115: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000068" class="method-detail">
|
|
|
|
|
<a name="M000068"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000068" class="method-signature">
|
|
|
|
|
<span class="method-name">wait_for_condition</span><span class="method-args">(script, timeout)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Runs the specified JavaScript snippet repeatedly until it evaluates to
|
|
|
|
|
<tt>true</tt>. The snippet may have multiple lines, but only the result of
|
|
|
|
|
the last line will be considered.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Note that, by default, the snippet will be run in the runner‘s test
|
|
|
|
|
window, not in the window of your application. To get the window of your
|
|
|
|
|
application, you can use the JavaScript snippet
|
|
|
|
|
<tt>selenium.browserbot.getCurrentWindow()</tt>, and then run your
|
|
|
|
|
JavaScript in there.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>timeout</tt> is specified in milliseconds.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000068-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 467</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
467: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait_for_condition</span> <span class="ruby-identifier">script</span>, <span class="ruby-identifier">timeout</span>
|
|
|
|
|
468: <span class="ruby-identifier">command</span> <span class="ruby-value str">'waitForCondition'</span>, <span class="ruby-identifier">script</span>, <span class="ruby-identifier">timeout</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
469: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000070" class="method-detail">
|
|
|
|
|
<a name="M000070"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000070" class="method-signature">
|
|
|
|
|
<span class="method-name">wait_for_page_to_load</span><span class="method-args">(timeout)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Waits for a new page to load.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
You can use this command instead of the <tt>and_wait</tt> suffixes,
|
|
|
|
|
<tt>click_and_wait</tt>, <tt>select_and_wait</tt>, <tt>type_and_wait</tt>
|
|
|
|
|
etc. (which are only available in the JS API).
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Selenium constantly keeps track of new pages loading, and sets a
|
|
|
|
|
<tt>newPageLoaded</tt> flag when it first notices a page load. Running any
|
|
|
|
|
other Selenium command after turns the flag to <tt>false</tt>. Hence, if
|
|
|
|
|
you want to wait for a page to load, you must wait immediately after a
|
|
|
|
|
Selenium command that caused a page-load.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<tt>timeout</tt> is specified in milliseconds.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000070-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 497</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
497: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait_for_page_to_load</span> <span class="ruby-identifier">timeout</span>
|
|
|
|
|
498: <span class="ruby-identifier">command</span> <span class="ruby-value str">'waitForPageToLoad'</span>, <span class="ruby-identifier">timeout</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
499: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000028" class="method-detail">
|
|
|
|
|
<a name="M000028"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000028" class="method-signature">
|
|
|
|
|
<span class="method-name">wait_for_popup</span><span class="method-args">(window_id, timeout)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Waits for a popup window to appear and load up.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
The <tt>timeout</tt> is specified in milliseconds.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000028-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 185</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait_for_popup</span> <span class="ruby-identifier">window_id</span>, <span class="ruby-identifier">timeout</span>
|
|
|
|
|
186: <span class="ruby-identifier">command</span> <span class="ruby-value str">'waitForPopUp'</span>, <span class="ruby-identifier">window_id</span><span class="ruby-operator">||</span><span class="ruby-value str">'null'</span>, <span class="ruby-identifier">timeout</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
187: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000065" class="method-detail">
|
|
|
|
|
<a name="M000065"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000065" class="method-signature">
|
|
|
|
|
<span class="method-name">window_focus</span><span class="method-args">(window_name)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Gives focus to a window.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000065-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 433</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
433: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">window_focus</span> <span class="ruby-identifier">window_name</span>
|
|
|
|
|
434: <span class="ruby-identifier">command</span> <span class="ruby-value str">'windowFocus'</span>, <span class="ruby-identifier">window_name</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
435: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="method-M000066" class="method-detail">
|
|
|
|
|
<a name="M000066"></a>
|
|
|
|
|
|
|
|
|
|
<div class="method-heading">
|
|
|
|
|
<a href="#M000066" class="method-signature">
|
|
|
|
|
<span class="method-name">window_maximize</span><span class="method-args">(window_name)</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
<p>
|
|
|
|
|
Resize window to take up the entire screen.
|
|
|
|
|
</p>
|
|
|
|
|
<p><a class="source-toggle" href="#"
|
|
|
|
|
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
|
|
|
|
<div class="method-source-code" id="M000066-source">
|
|
|
|
|
<pre>
|
|
|
|
|
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder_actions.rb, line 438</span>
|
2009-12-14 11:51:36 -05:00
|
|
|
438: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">window_maximize</span> <span class="ruby-identifier">window_name</span>
|
|
|
|
|
439: <span class="ruby-identifier">command</span> <span class="ruby-value str">'windowMaximize'</span>, <span class="ruby-identifier">window_name</span>
|
2008-12-02 10:05:41 +01:00
|
|
|
440: <span class="ruby-keyword kw">end</span>
|
|
|
|
|
</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="validator-badges">
|
|
|
|
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</body>
|
2007-03-30 12:34:56 +00:00
|
|
|
</html>
|