1a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
2a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<html><head><title>Python: module telemetry.page.actions.play</title>
4a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</head><body bgcolor="#f0f0f8">
5a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
6a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr bgcolor="#7799ee">
8a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td valign=bottom>&nbsp;<br>
9a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<font color="#ffffff" face="helvetica, arial">&nbsp;<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>.<a href="telemetry.page.actions.html"><font color="#ffffff">actions</font></a>.play</strong></big></big></font></td
10a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch><td align=right valign=bottom
11a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="/telemetry/page/actions/play.py">telemetry/page/actions/play.py</a></font></td></tr></table>
12a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch    <p><tt>A&nbsp;Telemetry&nbsp;page_action&nbsp;that&nbsp;performs&nbsp;the&nbsp;"play"&nbsp;action&nbsp;on&nbsp;media&nbsp;elements.<br>
13a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;<br>
14a3f7b4e666c476898878fa745f637129375cd889Ben MurdochMedia&nbsp;elements&nbsp;can&nbsp;be&nbsp;specified&nbsp;by&nbsp;a&nbsp;selector&nbsp;attribute.&nbsp;If&nbsp;no&nbsp;selector&nbsp;is<br>
15a3f7b4e666c476898878fa745f637129375cd889Ben Murdochdefined&nbsp;then&nbsp;then&nbsp;the&nbsp;action&nbsp;attempts&nbsp;to&nbsp;play&nbsp;the&nbsp;first&nbsp;video&nbsp;element&nbsp;or&nbsp;audio<br>
16a3f7b4e666c476898878fa745f637129375cd889Ben Murdochelement&nbsp;on&nbsp;the&nbsp;page.&nbsp;A&nbsp;selector&nbsp;can&nbsp;also&nbsp;be&nbsp;'all'&nbsp;to&nbsp;play&nbsp;all&nbsp;media&nbsp;elements.<br>
17a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;<br>
18a3f7b4e666c476898878fa745f637129375cd889Ben MurdochOther&nbsp;attributes&nbsp;to&nbsp;use&nbsp;are:&nbsp;wait_for_playing&nbsp;and&nbsp;wait_for_ended,&nbsp;which&nbsp;forces<br>
19a3f7b4e666c476898878fa745f637129375cd889Ben Murdochthe&nbsp;action&nbsp;to&nbsp;wait&nbsp;until&nbsp;playing&nbsp;and&nbsp;ended&nbsp;events&nbsp;get&nbsp;fired&nbsp;respectively.</tt></p>
20a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<p>
21a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
22a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr bgcolor="#aa55cc">
23a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td colspan=3 valign=bottom>&nbsp;<br>
24a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
25a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch    
26a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
27a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
28a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</td><td width="25%" valign=top><a href="os.html">os</a><br>
29a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</td><td width="25%" valign=top><a href="telemetry.page.actions.page_action.html">telemetry.page.actions.page_action</a><br>
30a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br>
31a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</td></tr></table></td></tr></table><p>
32a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
33a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr bgcolor="#ee77aa">
34a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td colspan=3 valign=bottom>&nbsp;<br>
35a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
36a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch    
37a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
38a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td width="100%"><dl>
39a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
40a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</font></dt><dd>
41a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl>
42a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dt><font face="helvetica, arial"><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a>
43a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</font></dt></dl>
44a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</dd>
45a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</dl>
46a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch <p>
47a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
48a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr bgcolor="#ffc8d8">
49a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td colspan=3 valign=bottom>&nbsp;<br>
50a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<font color="#000000" face="helvetica, arial"><a name="PlayAction">class <strong>PlayAction</strong></a>(<a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>)</font></td></tr>
51a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch    
52a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
53a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<td width="100%"><dl><dt>Method resolution order:</dt>
54a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dd><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a></dd>
55a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dd><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a></dd>
56a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
57a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</dl>
58a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<hr>
59a3f7b4e666c476898878fa745f637129375cd889Ben MurdochMethods defined here:<br>
60a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-HasEventCompleted"><strong>HasEventCompleted</strong></a>(self, tab, selector, event_name)</dt></dl>
61a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
62a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-RunAction"><strong>RunAction</strong></a>(self, page, tab, previous_action)</dt></dl>
63a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
64a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-WaitForEvent"><strong>WaitForEvent</strong></a>(self, tab, selector, event_name, timeout)</dt><dd><tt>Halts&nbsp;play&nbsp;action&nbsp;until&nbsp;the&nbsp;selector's&nbsp;event&nbsp;is&nbsp;fired.</tt></dd></dl>
65a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
66a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab)</dt><dd><tt>Load&nbsp;the&nbsp;media&nbsp;metrics&nbsp;JS&nbsp;code&nbsp;prior&nbsp;to&nbsp;running&nbsp;the&nbsp;action.</tt></dd></dl>
67a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
68a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-__init__"><strong>__init__</strong></a>(self, attributes<font color="#909090">=None</font>)</dt></dl>
69a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
70a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<hr>
71a3f7b4e666c476898878fa745f637129375cd889Ben MurdochMethods inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br>
72a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-BindMeasurementJavaScript"><strong>BindMeasurementJavaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let&nbsp;this&nbsp;action&nbsp;determine&nbsp;when&nbsp;measurements&nbsp;should&nbsp;start&nbsp;and&nbsp;stop.<br>
73a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;<br>
74a3f7b4e666c476898878fa745f637129375cd889Ben MurdochA&nbsp;measurement&nbsp;can&nbsp;call&nbsp;this&nbsp;method&nbsp;to&nbsp;provide&nbsp;the&nbsp;action<br>
75a3f7b4e666c476898878fa745f637129375cd889Ben Murdochwith&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;and&nbsp;stops&nbsp;measurements.&nbsp;The&nbsp;action<br>
76a3f7b4e666c476898878fa745f637129375cd889Ben Murdochdetermines&nbsp;when&nbsp;to&nbsp;execute&nbsp;the&nbsp;provided&nbsp;JavaScript&nbsp;code,&nbsp;for&nbsp;more&nbsp;accurate<br>
77a3f7b4e666c476898878fa745f637129375cd889Ben Murdochtimings.<br>
78a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;<br>
79a3f7b4e666c476898878fa745f637129375cd889Ben MurdochArgs:<br>
80a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;&nbsp;tab:&nbsp;The&nbsp;tab&nbsp;to&nbsp;do&nbsp;everything&nbsp;on.<br>
81a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;&nbsp;start_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;measurements.<br>
82a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch&nbsp;&nbsp;stop_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;stops&nbsp;measurements.</tt></dd></dl>
83a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
84a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</dt><dd><tt>If&nbsp;this&nbsp;class&nbsp;implements&nbsp;BindMeasurementJavaScript,&nbsp;override&nbsp;CanBeBound<br>
85a3f7b4e666c476898878fa745f637129375cd889Ben Murdochto&nbsp;return&nbsp;True&nbsp;so&nbsp;that&nbsp;a&nbsp;test&nbsp;knows&nbsp;it&nbsp;can&nbsp;bind&nbsp;measurements.</tt></dd></dl>
86a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
87a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-CleanUp"><strong>CleanUp</strong></a>(self, page, tab)</dt></dl>
88a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
89a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt><dd><tt>Override&nbsp;to&nbsp;add&nbsp;action-specific&nbsp;options&nbsp;to&nbsp;the&nbsp;BrowserOptions<br>
90a3f7b4e666c476898878fa745f637129375cd889Ben Murdochobject.</tt></dd></dl>
91a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
92a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><a name="PlayAction-RunsPreviousAction"><strong>RunsPreviousAction</strong></a>(self)</dt><dd><tt>Some&nbsp;actions&nbsp;require&nbsp;some&nbsp;initialization&nbsp;to&nbsp;be&nbsp;performed&nbsp;before&nbsp;the<br>
93a3f7b4e666c476898878fa745f637129375cd889Ben Murdochprevious&nbsp;action.&nbsp;For&nbsp;example,&nbsp;wait&nbsp;for&nbsp;href&nbsp;change&nbsp;needs&nbsp;to&nbsp;record&nbsp;the&nbsp;old<br>
94a3f7b4e666c476898878fa745f637129375cd889Ben Murdochhref&nbsp;before&nbsp;the&nbsp;previous&nbsp;action&nbsp;changes&nbsp;it.&nbsp;Therefore,&nbsp;we&nbsp;allow&nbsp;actions&nbsp;to<br>
95a3f7b4e666c476898878fa745f637129375cd889Ben Murdochrun&nbsp;the&nbsp;previous&nbsp;action.&nbsp;An&nbsp;action&nbsp;that&nbsp;does&nbsp;this&nbsp;should&nbsp;override&nbsp;this&nbsp;to<br>
96a3f7b4e666c476898878fa745f637129375cd889Ben Murdochreturn&nbsp;True&nbsp;in&nbsp;order&nbsp;to&nbsp;prevent&nbsp;the&nbsp;previous&nbsp;action&nbsp;from&nbsp;being&nbsp;run&nbsp;twice.</tt></dd></dl>
97a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch
98a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<hr>
99a3f7b4e666c476898878fa745f637129375cd889Ben MurdochData descriptors inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br>
100a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><strong>__dict__</strong></dt>
101a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
102a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</dl>
103a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dl><dt><strong>__weakref__</strong></dt>
104a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
105a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</dl>
106a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</td></tr></table></td></tr></table>
107a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch</body></html>