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>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<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>#&nbsp;Copyright&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;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>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<br>
29<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
30
31<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
54<td colspan=2><tt>Represents&nbsp;an&nbsp;action&nbsp;that&nbsp;a&nbsp;user&nbsp;might&nbsp;try&nbsp;to&nbsp;perform&nbsp;to&nbsp;a&nbsp;page.<br>&nbsp;</tt></td></tr>
55<tr><td>&nbsp;</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&nbsp;to&nbsp;do&nbsp;action-specific&nbsp;setup&nbsp;before<br>
62Test.WillRunAction&nbsp;is&nbsp;called.</tt></dd></dl>
63
64<hr>
65Data descriptors defined here:<br>
66<dl><dt><strong>__dict__</strong></dt>
67<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
68</dl>
69<dl><dt><strong>__weakref__</strong></dt>
70<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;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> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#PageActionFailed-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;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')&nbsp;&lt;==&gt;&nbsp;del&nbsp;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')&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
107&nbsp;<br>
108Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;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>()&nbsp;&lt;==&gt;&nbsp;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',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;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>()&nbsp;&lt;==&gt;&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;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> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#PageActionNotSupported-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;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')&nbsp;&lt;==&gt;&nbsp;del&nbsp;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')&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
165&nbsp;<br>
166Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;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>()&nbsp;&lt;==&gt;&nbsp;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',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;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>()&nbsp;&lt;==&gt;&nbsp;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>&nbsp;<br>
192<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
193
194<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;the&nbsp;JavaScript&nbsp;callback&nbsp;with&nbsp;the&nbsp;given&nbsp;element.<br>
196&nbsp;<br>
197The&nbsp;element&nbsp;may&nbsp;be&nbsp;selected&nbsp;via&nbsp;selector,&nbsp;text,&nbsp;or&nbsp;element_function.<br>
198Only&nbsp;one&nbsp;of&nbsp;these&nbsp;arguments&nbsp;must&nbsp;be&nbsp;specified.<br>
199&nbsp;<br>
200Returns:<br>
201&nbsp;&nbsp;The&nbsp;callback's&nbsp;return&nbsp;value,&nbsp;if&nbsp;any.&nbsp;The&nbsp;return&nbsp;value&nbsp;must&nbsp;be<br>
202&nbsp;&nbsp;convertible&nbsp;to&nbsp;JSON.<br>
203&nbsp;<br>
204Args:<br>
205&nbsp;&nbsp;tab:&nbsp;A&nbsp;telemetry.core.Tab&nbsp;<a href="__builtin__.html#object">object</a>.<br>
206&nbsp;&nbsp;callback_js:&nbsp;The&nbsp;JavaScript&nbsp;callback&nbsp;to&nbsp;call&nbsp;(as&nbsp;string).<br>
207&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;callback&nbsp;receive&nbsp;2&nbsp;parameters:&nbsp;the&nbsp;element,&nbsp;and&nbsp;information<br>
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;about&nbsp;what&nbsp;method&nbsp;was&nbsp;used&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;element.<br>
209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example:&nbsp;'''<br>
210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(element,&nbsp;info)&nbsp;{<br>
211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!element)&nbsp;{<br>
212&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;Error('Can&nbsp;not&nbsp;find&nbsp;element:&nbsp;'&nbsp;+&nbsp;info);<br>
213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.click()<br>
215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}'''<br>
216&nbsp;&nbsp;selector:&nbsp;A&nbsp;CSS&nbsp;selector&nbsp;describing&nbsp;the&nbsp;element.<br>
217&nbsp;&nbsp;text:&nbsp;The&nbsp;element&nbsp;must&nbsp;contains&nbsp;this&nbsp;exact&nbsp;text.<br>
218&nbsp;&nbsp;element_function:&nbsp;A&nbsp;JavaScript&nbsp;function&nbsp;(as&nbsp;string)&nbsp;that&nbsp;is&nbsp;used<br>
219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;element.&nbsp;For&nbsp;example:<br>
220&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'(function()&nbsp;{&nbsp;return&nbsp;foo.element;&nbsp;})()'.<br>
221&nbsp;&nbsp;wait:&nbsp;Whether&nbsp;to&nbsp;wait&nbsp;for&nbsp;the&nbsp;return&nbsp;value&nbsp;to&nbsp;be&nbsp;true.<br>
222&nbsp;&nbsp;timeout_in_seconds:&nbsp;The&nbsp;timeout&nbsp;for&nbsp;wait&nbsp;(if&nbsp;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>&nbsp;<br>
228<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
229
230<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>