1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.internal.actions.page_action</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.actions.html"><font color="#ffffff">actions</font></a>.page_action</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/actions/page_action.py">telemetry/internal/actions/page_action.py</a></font></td></tr></table> 13 <p><tt># Copyright 2012 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.decorators.html">telemetry.decorators</a><br> 24</td><td width="25%" valign=top><a href="re.html">re</a><br> 25</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 26<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 27<tr bgcolor="#ee77aa"> 28<td colspan=3 valign=bottom> <br> 29<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 30 31<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 32<td width="100%"><dl> 33<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 34</font></dt><dd> 35<dl> 36<dt><font face="helvetica, arial"><a href="telemetry.internal.actions.page_action.html#PageAction">PageAction</a> 37</font></dt></dl> 38</dd> 39<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) 40</font></dt><dd> 41<dl> 42<dt><font face="helvetica, arial"><a href="telemetry.internal.actions.page_action.html#PageActionFailed">PageActionFailed</a> 43</font></dt><dt><font face="helvetica, arial"><a href="telemetry.internal.actions.page_action.html#PageActionNotSupported">PageActionNotSupported</a> 44</font></dt></dl> 45</dd> 46</dl> 47 <p> 48<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 49<tr bgcolor="#ffc8d8"> 50<td colspan=3 valign=bottom> <br> 51<font color="#000000" face="helvetica, arial"><a name="PageAction">class <strong>PageAction</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 52 53<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 54<td colspan=2><tt>Represents an action that a user might try to perform to a page.<br> </tt></td></tr> 55<tr><td> </td> 56<td width="100%">Methods defined here:<br> 57<dl><dt><a name="PageAction-CleanUp"><strong>CleanUp</strong></a>(self, tab)</dt></dl> 58 59<dl><dt><a name="PageAction-RunAction"><strong>RunAction</strong></a>(self, tab)</dt></dl> 60 61<dl><dt><a name="PageAction-WillRunAction"><strong>WillRunAction</strong></a>(self, tab)</dt><dd><tt>Override to do action-specific setup before<br> 62Test.WillRunAction is called.</tt></dd></dl> 63 64<hr> 65Data descriptors defined here:<br> 66<dl><dt><strong>__dict__</strong></dt> 67<dd><tt>dictionary for instance variables (if defined)</tt></dd> 68</dl> 69<dl><dt><strong>__weakref__</strong></dt> 70<dd><tt>list of weak references to the object (if defined)</tt></dd> 71</dl> 72</td></tr></table> <p> 73<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 74<tr bgcolor="#ffc8d8"> 75<td colspan=3 valign=bottom> <br> 76<font color="#000000" face="helvetica, arial"><a name="PageActionFailed">class <strong>PageActionFailed</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> 77 78<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 79<td width="100%"><dl><dt>Method resolution order:</dt> 80<dd><a href="telemetry.internal.actions.page_action.html#PageActionFailed">PageActionFailed</a></dd> 81<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 82<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 83<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 84</dl> 85<hr> 86Data descriptors defined here:<br> 87<dl><dt><strong>__weakref__</strong></dt> 88<dd><tt>list of weak references to the object (if defined)</tt></dd> 89</dl> 90<hr> 91Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 92<dl><dt><a name="PageActionFailed-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> 93 94<hr> 95Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 96<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#PageActionFailed-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> 97 98<hr> 99Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 100<dl><dt><a name="PageActionFailed-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> 101 102<dl><dt><a name="PageActionFailed-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 103 104<dl><dt><a name="PageActionFailed-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 105 106<dl><dt><a name="PageActionFailed-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 107 <br> 108Use of negative indices is not supported.</tt></dd></dl> 109 110<dl><dt><a name="PageActionFailed-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 111 112<dl><dt><a name="PageActionFailed-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> 113 114<dl><dt><a name="PageActionFailed-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> 115 116<dl><dt><a name="PageActionFailed-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 117 118<dl><dt><a name="PageActionFailed-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__str__">__str__</a>() <==> str(x)</tt></dd></dl> 119 120<dl><dt><a name="PageActionFailed-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 121 122<hr> 123Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 124<dl><dt><strong>__dict__</strong></dt> 125</dl> 126<dl><dt><strong>args</strong></dt> 127</dl> 128<dl><dt><strong>message</strong></dt> 129</dl> 130</td></tr></table> <p> 131<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 132<tr bgcolor="#ffc8d8"> 133<td colspan=3 valign=bottom> <br> 134<font color="#000000" face="helvetica, arial"><a name="PageActionNotSupported">class <strong>PageActionNotSupported</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> 135 136<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 137<td width="100%"><dl><dt>Method resolution order:</dt> 138<dd><a href="telemetry.internal.actions.page_action.html#PageActionNotSupported">PageActionNotSupported</a></dd> 139<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 140<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 141<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 142</dl> 143<hr> 144Data descriptors defined here:<br> 145<dl><dt><strong>__weakref__</strong></dt> 146<dd><tt>list of weak references to the object (if defined)</tt></dd> 147</dl> 148<hr> 149Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 150<dl><dt><a name="PageActionNotSupported-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> 151 152<hr> 153Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 154<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#PageActionNotSupported-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> 155 156<hr> 157Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 158<dl><dt><a name="PageActionNotSupported-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> 159 160<dl><dt><a name="PageActionNotSupported-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 161 162<dl><dt><a name="PageActionNotSupported-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 163 164<dl><dt><a name="PageActionNotSupported-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 165 <br> 166Use of negative indices is not supported.</tt></dd></dl> 167 168<dl><dt><a name="PageActionNotSupported-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 169 170<dl><dt><a name="PageActionNotSupported-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> 171 172<dl><dt><a name="PageActionNotSupported-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> 173 174<dl><dt><a name="PageActionNotSupported-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 175 176<dl><dt><a name="PageActionNotSupported-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__str__">__str__</a>() <==> str(x)</tt></dd></dl> 177 178<dl><dt><a name="PageActionNotSupported-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 179 180<hr> 181Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 182<dl><dt><strong>__dict__</strong></dt> 183</dl> 184<dl><dt><strong>args</strong></dt> 185</dl> 186<dl><dt><strong>message</strong></dt> 187</dl> 188</td></tr></table></td></tr></table><p> 189<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 190<tr bgcolor="#eeaa77"> 191<td colspan=3 valign=bottom> <br> 192<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> 193 194<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> 195<td width="100%"><dl><dt><a name="-EvaluateCallbackWithElement"><strong>EvaluateCallbackWithElement</strong></a>(tab, callback_js, selector<font color="#909090">=None</font>, text<font color="#909090">=None</font>, element_function<font color="#909090">=None</font>, wait<font color="#909090">=False</font>, timeout_in_seconds<font color="#909090">=60</font>)</dt><dd><tt>Evaluates the JavaScript callback with the given element.<br> 196 <br> 197The element may be selected via selector, text, or element_function.<br> 198Only one of these arguments must be specified.<br> 199 <br> 200Returns:<br> 201 The callback's return value, if any. The return value must be<br> 202 convertible to JSON.<br> 203 <br> 204Args:<br> 205 tab: A telemetry.core.Tab <a href="__builtin__.html#object">object</a>.<br> 206 callback_js: The JavaScript callback to call (as string).<br> 207 The callback receive 2 parameters: the element, and information<br> 208 string about what method was used to retrieve the element.<br> 209 Example: '''<br> 210 function(element, info) {<br> 211 if (!element) {<br> 212 throw Error('Can not find element: ' + info);<br> 213 }<br> 214 element.click()<br> 215 }'''<br> 216 selector: A CSS selector describing the element.<br> 217 text: The element must contains this exact text.<br> 218 element_function: A JavaScript function (as string) that is used<br> 219 to retrieve the element. For example:<br> 220 '(function() { return foo.element; })()'.<br> 221 wait: Whether to wait for the return value to be true.<br> 222 timeout_in_seconds: The timeout for wait (if waiting).</tt></dd></dl> 223 <dl><dt><a name="-IsGestureSourceTypeSupported"><strong>IsGestureSourceTypeSupported</strong></a>(*args, **kwargs)</dt></dl> 224</td></tr></table><p> 225<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 226<tr bgcolor="#55aa55"> 227<td colspan=3 valign=bottom> <br> 228<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 229 230<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 231<td width="100%"><strong>GESTURE_SOURCE_DEFAULT</strong> = 'DEFAULT'<br> 232<strong>GESTURE_SOURCE_MOUSE</strong> = 'MOUSE'<br> 233<strong>GESTURE_SOURCE_TOUCH</strong> = 'TOUCH'<br> 234<strong>SUPPORTED_GESTURE_SOURCES</strong> = ('DEFAULT', 'MOUSE', 'TOUCH')</td></tr></table> 235</body></html>