<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.page.action_runner</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.page.html"><font color="#ffffff">page</font></a>.action_runner</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/action_runner.py">telemetry/page/action_runner.py</a></font></td></tr></table>
<p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br>
# Use of this source code is governed by a BSD-style license that can be<br>
# found in the LICENSE file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td><td width="25%" valign=top><a href="telemetry.web_perf.timeline_interaction_record.html">telemetry.web_perf.timeline_interaction_record</a><br>
</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.page.action_runner.html#ActionRunner">ActionRunner</a>
</font></dt><dt><font face="helvetica, arial"><a href="telemetry.page.action_runner.html#Interaction">Interaction</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ActionRunner">class <strong>ActionRunner</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ActionRunner-ClickElement"><strong>ClickElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>)</dt><dd><tt>Click an element.<br>
<br>
The element may be selected via selector, text, or element_function.<br>
Only one of these arguments must be specified.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'(function() { return foo.element; })()'.</tt></dd></dl>
<dl><dt><a name="ActionRunner-CreateGestureInteraction"><strong>CreateGestureInteraction</strong></a>(self, label, repeatable<font color="#909090">=False</font>)</dt><dd><tt>Create an action.<a href="#Interaction">Interaction</a> <a href="__builtin__.html#object">object</a> that issues gesture-based<br>
interaction record.<br>
<br>
This is similar to normal interaction record, but it will<br>
auto-narrow the interaction time period to only include the<br>
synthetic gesture event output by Chrome. This is typically use to<br>
reduce noise in gesture-based analysis (e.g., analysis for a<br>
swipe/scroll).<br>
<br>
The interaction record label will be prepended with 'Gesture_'.<br>
<br>
e.g:<br>
with action_runner.<a href="#ActionRunner-CreateGestureInteraction">CreateGestureInteraction</a>('Scroll-1'):<br>
action_runner.<a href="#ActionRunner-ScrollPage">ScrollPage</a>()<br>
<br>
Args:<br>
label: A label for this particular interaction. This can be any<br>
user-defined string, but must not contain '/'.<br>
repeatable: Whether other interactions may use the same logical name<br>
as this interaction. All interactions with the same logical name must<br>
have the same flags.<br>
<br>
Returns:<br>
An instance of action_runner.<a href="#Interaction">Interaction</a></tt></dd></dl>
<dl><dt><a name="ActionRunner-CreateInteraction"><strong>CreateInteraction</strong></a>(self, label, repeatable<font color="#909090">=False</font>)</dt><dd><tt>Create an action.<a href="#Interaction">Interaction</a> <a href="__builtin__.html#object">object</a> that issues interaction record.<br>
<br>
An interaction record is a labeled time period containing<br>
interaction that developers care about. Each set of metrics<br>
specified in flags will be calculated for this time period.<br>
<br>
To mark the start of interaction record, call Begin() method on the returned<br>
<a href="__builtin__.html#object">object</a>. To mark the finish of interaction record, call End() method on<br>
it. Or better yet, use the with statement to create an<br>
interaction record that covers the actions in the with block.<br>
<br>
e.g:<br>
with action_runner.<a href="#ActionRunner-CreateInteraction">CreateInteraction</a>('Animation-1'):<br>
action_runner.<a href="#ActionRunner-TapElement">TapElement</a>(...)<br>
action_runner.<a href="#ActionRunner-WaitForJavaScriptCondition">WaitForJavaScriptCondition</a>(...)<br>
<br>
Args:<br>
label: A label for this particular interaction. This can be any<br>
user-defined string, but must not contain '/'.<br>
repeatable: Whether other interactions may use the same logical name<br>
as this interaction. All interactions with the same logical name must<br>
have the same flags.<br>
<br>
Returns:<br>
An instance of action_runner.<a href="#Interaction">Interaction</a></tt></dd></dl>
<dl><dt><a name="ActionRunner-DragPage"><strong>DragPage</strong></a>(self, left_start_ratio, top_start_ratio, left_end_ratio, top_end_ratio, speed_in_pixels_per_second<font color="#909090">=800</font>, use_touch<font color="#909090">=False</font>, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>)</dt><dd><tt>Perform a drag gesture on the page.<br>
<br>
You should specify a start and an end point in ratios of page width and<br>
height (see drag.js for full implementation).<br>
<br>
Args:<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
left_end_ratio: The horizontal ending coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_end_ratio: The vertical ending coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).<br>
use_touch: Whether dragging should be done with touch input.</tt></dd></dl>
<dl><dt><a name="ActionRunner-EvaluateJavaScript"><strong>EvaluateJavaScript</strong></a>(self, expression)</dt><dd><tt>Returns the evaluation result of the given JavaScript expression.<br>
<br>
The evaluation results must be convertible to JSON. If the result<br>
is not needed, use ExecuteJavaScript instead.<br>
<br>
Example: num = runner.<a href="#ActionRunner-EvaluateJavaScript">EvaluateJavaScript</a>('document.location.href')<br>
<br>
Args:<br>
expression: The expression to evaluate (provided as string).<br>
<br>
Raises:<br>
EvaluationException: The statement expression failed to execute<br>
or the evaluation result can not be JSON-ized.</tt></dd></dl>
<dl><dt><a name="ActionRunner-ExecuteJavaScript"><strong>ExecuteJavaScript</strong></a>(self, statement)</dt><dd><tt>Executes a given JavaScript expression. Does not return the result.<br>
<br>
Example: runner.<a href="#ActionRunner-ExecuteJavaScript">ExecuteJavaScript</a>('var foo = 1;');<br>
<br>
Args:<br>
statement: The statement to execute (provided as string).<br>
<br>
Raises:<br>
EvaluationException: The statement failed to execute.</tt></dd></dl>
<dl><dt><a name="ActionRunner-ForceGarbageCollection"><strong>ForceGarbageCollection</strong></a>(self)</dt><dd><tt>Forces JavaScript garbage collection on the page.</tt></dd></dl>
<dl><dt><a name="ActionRunner-LoadMedia"><strong>LoadMedia</strong></a>(self, selector<font color="#909090">=None</font>, event_timeout_in_seconds<font color="#909090">=0</font>, event_to_await<font color="#909090">='canplaythrough'</font>)</dt><dd><tt>Invokes load() on media elements and awaits an event.<br>
<br>
Args:<br>
selector: A CSS selector describing the element. If none is<br>
specified, play the first media element on the page. If the<br>
selector matches more than 1 media element, all of them will<br>
be played.<br>
event_timeout_in_seconds: Maximum waiting time for the event to be fired.<br>
0 means do not wait.<br>
event_to_await: Which event to await. For example: 'canplaythrough' or<br>
'loadedmetadata'.<br>
<br>
Raises:<br>
TimeoutException: If the maximum waiting time is exceeded.</tt></dd></dl>
<dl><dt><a name="ActionRunner-LoopMedia"><strong>LoopMedia</strong></a>(self, loop_count, selector<font color="#909090">=None</font>, timeout_in_seconds<font color="#909090">=None</font>)</dt><dd><tt>Loops a media playback.<br>
<br>
Args:<br>
loop_count: The number of times to loop the playback.<br>
selector: A CSS selector describing the element. If none is<br>
specified, loop the first media element on the page. If the<br>
selector matches more than 1 media element, all of them will<br>
be looped.<br>
timeout_in_seconds: Maximum waiting time for the looped playback to<br>
complete. 0 means do not wait. None (the default) means to<br>
wait loop_count * 60 seconds.<br>
<br>
Raises:<br>
TimeoutException: If the maximum waiting time is exceeded.</tt></dd></dl>
<dl><dt><a name="ActionRunner-MouseClick"><strong>MouseClick</strong></a>(self, selector<font color="#909090">=None</font>)</dt><dd><tt>Mouse click the given element.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.</tt></dd></dl>
<dl><dt><a name="ActionRunner-Navigate"><strong>Navigate</strong></a>(self, url, script_to_evaluate_on_commit<font color="#909090">=None</font>, timeout_in_seconds<font color="#909090">=60</font>)</dt><dd><tt>Navigates to url.<br>
<br>
If |script_to_evaluate_on_commit| is given, the script source string will be<br>
evaluated when the navigation is committed. This is after the context of<br>
the page exists, but before any script on the page itself has executed.</tt></dd></dl>
<dl><dt><a name="ActionRunner-PauseInteractive"><strong>PauseInteractive</strong></a>(self)</dt><dd><tt>Pause the page execution and wait for terminal interaction.<br>
<br>
This is typically used for debugging. You can use this to pause<br>
the page execution and inspect the browser state before<br>
continuing.</tt></dd></dl>
<dl><dt><a name="ActionRunner-PinchElement"><strong>PinchElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, left_anchor_ratio<font color="#909090">=0.5</font>, top_anchor_ratio<font color="#909090">=0.5</font>, scale_factor<font color="#909090">=None</font>, speed_in_pixels_per_second<font color="#909090">=800</font>)</dt><dd><tt>Perform the pinch gesture on an element.<br>
<br>
It computes the pinch gesture automatically based on the anchor<br>
coordinate and the scale factor. The scale factor is the ratio of<br>
of the final span and the initial span of the gesture.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'function() { return foo.element; }'.<br>
left_anchor_ratio: The horizontal pinch anchor coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
top_anchor_ratio: The vertical pinch anchor coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
scale_factor: The ratio of the final span to the initial span.<br>
The default scale factor is<br>
3.0 / (window.outerWidth/window.innerWidth).<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-PinchPage"><strong>PinchPage</strong></a>(self, left_anchor_ratio<font color="#909090">=0.5</font>, top_anchor_ratio<font color="#909090">=0.5</font>, scale_factor<font color="#909090">=None</font>, speed_in_pixels_per_second<font color="#909090">=800</font>)</dt><dd><tt>Perform the pinch gesture on the page.<br>
<br>
It computes the pinch gesture automatically based on the anchor<br>
coordinate and the scale factor. The scale factor is the ratio of<br>
of the final span and the initial span of the gesture.<br>
<br>
Args:<br>
left_anchor_ratio: The horizontal pinch anchor coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_anchor_ratio: The vertical pinch anchor coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
scale_factor: The ratio of the final span to the initial span.<br>
The default scale factor is<br>
3.0 / (window.outerWidth/window.innerWidth).<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-PlayMedia"><strong>PlayMedia</strong></a>(self, selector<font color="#909090">=None</font>, playing_event_timeout_in_seconds<font color="#909090">=0</font>, ended_event_timeout_in_seconds<font color="#909090">=0</font>)</dt><dd><tt>Invokes the "play" action on media elements (such as video).<br>
<br>
Args:<br>
selector: A CSS selector describing the element. If none is<br>
specified, play the first media element on the page. If the<br>
selector matches more than 1 media element, all of them will<br>
be played.<br>
playing_event_timeout_in_seconds: Maximum waiting time for the "playing"<br>
event (dispatched when the media begins to play) to be fired.<br>
0 means do not wait.<br>
ended_event_timeout_in_seconds: Maximum waiting time for the "ended"<br>
event (dispatched when playback completes) to be fired.<br>
0 means do not wait.<br>
<br>
Raises:<br>
TimeoutException: If the maximum waiting time is exceeded.</tt></dd></dl>
<dl><dt><a name="ActionRunner-ReloadPage"><strong>ReloadPage</strong></a>(self)</dt><dd><tt>Reloads the page.</tt></dd></dl>
<dl><dt><a name="ActionRunner-RepaintContinuously"><strong>RepaintContinuously</strong></a>(self, seconds)</dt><dd><tt>Continuously repaints the visible content.<br>
<br>
It does this by requesting animation frames until the given number<br>
of seconds have elapsed AND at least three RAFs have been<br>
fired. Times out after max(60, self.<strong>seconds</strong>), if less than three<br>
RAFs were fired.</tt></dd></dl>
<dl><dt><a name="ActionRunner-RepeatableBrowserDrivenScroll"><strong>RepeatableBrowserDrivenScroll</strong></a>(self, x_scroll_distance_ratio<font color="#909090">=0.0</font>, y_scroll_distance_ratio<font color="#909090">=0.5</font>, repeat_count<font color="#909090">=0</font>, repeat_delay_ms<font color="#909090">=250</font>)</dt><dd><tt>Perform a browser driven repeatable scroll gesture.<br>
<br>
The scroll gesture is driven from the browser, this is useful because the<br>
main thread often isn't resposive but the browser process usually is, so the<br>
delay between the scroll gestures should be consistent.<br>
<br>
Args:<br>
x_scroll_distance_ratio: The horizontal lenght of the scroll as a fraction<br>
of the screen width.<br>
y_scroll_distance_ratio: The vertical lenght of the scroll as a fraction<br>
of the screen height.<br>
repeat_count: The number of additional times to repeat the gesture.<br>
repeat_delay_ms: The delay in milliseconds between each scroll gesture.</tt></dd></dl>
<dl><dt><a name="ActionRunner-ScrollBounceElement"><strong>ScrollBounceElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='down'</font>, distance<font color="#909090">=100</font>, overscroll<font color="#909090">=10</font>, repeat_count<font color="#909090">=10</font>, speed_in_pixels_per_second<font color="#909090">=400</font>)</dt><dd><tt>Perform scroll bounce gesture on the element.<br>
<br>
This gesture scrolls on the element by the number of pixels specified in<br>
distance, in the given direction, followed by a scroll by<br>
(distance + overscroll) pixels in the opposite direction.<br>
The above gesture is repeated repeat_count times.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'function() { return foo.element; }'.<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
direction: The direction of scroll, either 'left', 'right',<br>
'up', 'down', 'upleft', 'upright', 'downleft', or 'downright'<br>
distance: The distance to scroll (in pixel).<br>
overscroll: The number of additional pixels to scroll back, in<br>
addition to the givendistance.<br>
repeat_count: How often we want to repeat the full gesture.<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-ScrollBouncePage"><strong>ScrollBouncePage</strong></a>(self, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='down'</font>, distance<font color="#909090">=100</font>, overscroll<font color="#909090">=10</font>, repeat_count<font color="#909090">=10</font>, speed_in_pixels_per_second<font color="#909090">=400</font>)</dt><dd><tt>Perform scroll bounce gesture on the page.<br>
<br>
This gesture scrolls the page by the number of pixels specified in<br>
distance, in the given direction, followed by a scroll by<br>
(distance + overscroll) pixels in the opposite direction.<br>
The above gesture is repeated repeat_count times.<br>
<br>
Args:<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
direction: The direction of scroll, either 'left', 'right',<br>
'up', 'down', 'upleft', 'upright', 'downleft', or 'downright'<br>
distance: The distance to scroll (in pixel).<br>
overscroll: The number of additional pixels to scroll back, in<br>
addition to the givendistance.<br>
repeat_count: How often we want to repeat the full gesture.<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-ScrollElement"><strong>ScrollElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='down'</font>, distance<font color="#909090">=None</font>, distance_expr<font color="#909090">=None</font>, speed_in_pixels_per_second<font color="#909090">=800</font>, use_touch<font color="#909090">=False</font>, synthetic_gesture_source<font color="#909090">='DEFAULT'</font>)</dt><dd><tt>Perform scroll gesture on the element.<br>
<br>
The element may be selected via selector, text, or element_function.<br>
Only one of these arguments must be specified.<br>
<br>
You may specify distance or distance_expr, but not both. If<br>
neither is specified, the default scroll distance is variable<br>
depending on direction (see scroll.js for full implementation).<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'function() { return foo.element; }'.<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
direction: The direction of scroll, either 'left', 'right',<br>
'up', 'down', 'upleft', 'upright', 'downleft', or 'downright'<br>
distance: The distance to scroll (in pixel).<br>
distance_expr: A JavaScript expression (as string) that can be<br>
evaluated to compute scroll distance. Example:<br>
'window.scrollTop' or '(function() { return crazyMath(); })()'.<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).<br>
use_touch: Whether scrolling should be done with touch input.<br>
synthetic_gesture_source: the source input device type for the<br>
synthetic gesture: 'DEFAULT', 'TOUCH' or 'MOUSE'.</tt></dd></dl>
<dl><dt><a name="ActionRunner-ScrollPage"><strong>ScrollPage</strong></a>(self, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='down'</font>, distance<font color="#909090">=None</font>, distance_expr<font color="#909090">=None</font>, speed_in_pixels_per_second<font color="#909090">=800</font>, use_touch<font color="#909090">=False</font>, synthetic_gesture_source<font color="#909090">='DEFAULT'</font>)</dt><dd><tt>Perform scroll gesture on the page.<br>
<br>
You may specify distance or distance_expr, but not both. If<br>
neither is specified, the default scroll distance is variable<br>
depending on direction (see scroll.js for full implementation).<br>
<br>
Args:<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
direction: The direction of scroll, either 'left', 'right',<br>
'up', 'down', 'upleft', 'upright', 'downleft', or 'downright'<br>
distance: The distance to scroll (in pixel).<br>
distance_expr: A JavaScript expression (as string) that can be<br>
evaluated to compute scroll distance. Example:<br>
'window.scrollTop' or '(function() { return crazyMath(); })()'.<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).<br>
use_touch: Whether scrolling should be done with touch input.<br>
synthetic_gesture_source: the source input device type for the<br>
synthetic gesture: 'DEFAULT', 'TOUCH' or 'MOUSE'.</tt></dd></dl>
<dl><dt><a name="ActionRunner-SeekMedia"><strong>SeekMedia</strong></a>(self, seconds, selector<font color="#909090">=None</font>, timeout_in_seconds<font color="#909090">=0</font>, log_time<font color="#909090">=True</font>, label<font color="#909090">=''</font>)</dt><dd><tt>Performs a seek action on media elements (such as video).<br>
<br>
Args:<br>
seconds: The media time to seek to.<br>
selector: A CSS selector describing the element. If none is<br>
specified, seek the first media element on the page. If the<br>
selector matches more than 1 media element, all of them will<br>
be seeked.<br>
timeout_in_seconds: Maximum waiting time for the "seeked" event<br>
(dispatched when the seeked operation completes) to be<br>
fired. 0 means do not wait.<br>
log_time: Whether to log the seek time for the perf<br>
measurement. Useful when performing multiple seek.<br>
label: A suffix string to name the seek perf measurement.<br>
<br>
Raises:<br>
TimeoutException: If the maximum waiting time is exceeded.</tt></dd></dl>
<dl><dt><a name="ActionRunner-SwipeElement"><strong>SwipeElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='left'</font>, distance<font color="#909090">=100</font>, speed_in_pixels_per_second<font color="#909090">=800</font>)</dt><dd><tt>Perform swipe gesture on the element.<br>
<br>
The element may be selected via selector, text, or element_function.<br>
Only one of these arguments must be specified.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'function() { return foo.element; }'.<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
the element.<br>
direction: The direction of swipe, either 'left', 'right',<br>
'up', or 'down'<br>
distance: The distance to swipe (in pixel).<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-SwipePage"><strong>SwipePage</strong></a>(self, left_start_ratio<font color="#909090">=0.5</font>, top_start_ratio<font color="#909090">=0.5</font>, direction<font color="#909090">='left'</font>, distance<font color="#909090">=100</font>, speed_in_pixels_per_second<font color="#909090">=800</font>)</dt><dd><tt>Perform swipe gesture on the page.<br>
<br>
Args:<br>
left_start_ratio: The horizontal starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
top_start_ratio: The vertical starting coordinate of the<br>
gesture, as a ratio of the visible bounding rectangle for<br>
document.body.<br>
direction: The direction of swipe, either 'left', 'right',<br>
'up', or 'down'<br>
distance: The distance to swipe (in pixel).<br>
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).</tt></dd></dl>
<dl><dt><a name="ActionRunner-TapElement"><strong>TapElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>)</dt><dd><tt>Tap an element.<br>
<br>
The element may be selected via selector, text, or element_function.<br>
Only one of these arguments must be specified.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'(function() { return foo.element; })()'.</tt></dd></dl>
<dl><dt><a name="ActionRunner-Wait"><strong>Wait</strong></a>(self, seconds)</dt><dd><tt>Wait for the number of seconds specified.<br>
<br>
Args:<br>
seconds: The number of seconds to wait.</tt></dd></dl>
<dl><dt><a name="ActionRunner-WaitForElement"><strong>WaitForElement</strong></a>(self, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, timeout_in_seconds<font color="#909090">=60</font>)</dt><dd><tt>Wait for an element to appear in the document.<br>
<br>
The element may be selected via selector, text, or element_function.<br>
Only one of these arguments must be specified.<br>
<br>
Args:<br>
selector: A CSS selector describing the element.<br>
text: The element must contains this exact text.<br>
element_function: A JavaScript function (as string) that is used<br>
to retrieve the element. For example:<br>
'(function() { return foo.element; })()'.<br>
timeout_in_seconds: The timeout in seconds (default to 60).</tt></dd></dl>
<dl><dt><a name="ActionRunner-WaitForJavaScriptCondition"><strong>WaitForJavaScriptCondition</strong></a>(self, condition, timeout_in_seconds<font color="#909090">=60</font>)</dt><dd><tt>Wait for a JavaScript condition to become true.<br>
<br>
Example: runner.<a href="#ActionRunner-WaitForJavaScriptCondition">WaitForJavaScriptCondition</a>('window.foo == 10');<br>
<br>
Args:<br>
condition: The JavaScript condition (as string).<br>
timeout_in_seconds: The timeout in seconds (default to 60).</tt></dd></dl>
<dl><dt><a name="ActionRunner-WaitForNavigate"><strong>WaitForNavigate</strong></a>(self, timeout_in_seconds_seconds<font color="#909090">=60</font>)</dt></dl>
<dl><dt><a name="ActionRunner-__init__"><strong>__init__</strong></a>(self, tab, skip_waits<font color="#909090">=False</font>)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>tab</strong></dt>
<dd><tt>Returns the tab on which actions are performed.</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Interaction">class <strong>Interaction</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Interaction-Begin"><strong>Begin</strong></a>(self)</dt></dl>
<dl><dt><a name="Interaction-End"><strong>End</strong></a>(self)</dt></dl>
<dl><dt><a name="Interaction-__enter__"><strong>__enter__</strong></a>(self)</dt></dl>
<dl><dt><a name="Interaction-__exit__"><strong>__exit__</strong></a>(self, exc_type, exc_value, traceback)</dt></dl>
<dl><dt><a name="Interaction-__init__"><strong>__init__</strong></a>(self, action_runner, label, flags)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>GESTURE_SOURCE_DEFAULT</strong> = 'DEFAULT'<br>
<strong>SUPPORTED_GESTURE_SOURCES</strong> = ('DEFAULT', 'MOUSE', 'TOUCH')</td></tr></table>
</body></html>