1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.core.tab</title> 4 </head><body bgcolor="#f0f0f8"> 5 6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 7 <tr bgcolor="#7799ee"> 8 <td valign=bottom> <br> 9 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.tab</strong></big></big></font></td 10 ><td align=right valign=bottom 11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/tab.py">telemetry/core/tab.py</a></font></td></tr></table> 12 <p><tt># Copyright (c) 2012 The Chromium Authors. All rights reserved.<br> 13 # Use of this source code is governed by a BSD-style license that can be<br> 14 # found in the LICENSE file.</tt></p> 15 <p> 16 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 17 <tr bgcolor="#aa55cc"> 18 <td colspan=3 valign=bottom> <br> 19 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 20 21 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 22 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.web_contents.html">telemetry.core.web_contents</a><br> 23 </td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 24 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 25 <tr bgcolor="#ee77aa"> 26 <td colspan=3 valign=bottom> <br> 27 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 28 29 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 30 <td width="100%"><dl> 31 <dt><font face="helvetica, arial"><a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 32 </font></dt><dd> 33 <dl> 34 <dt><font face="helvetica, arial"><a href="telemetry.core.tab.html#Tab">Tab</a> 35 </font></dt></dl> 36 </dd> 37 </dl> 38 <p> 39 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 40 <tr bgcolor="#ffc8d8"> 41 <td colspan=3 valign=bottom> <br> 42 <font color="#000000" face="helvetica, arial"><a name="Tab">class <strong>Tab</strong></a>(<a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>)</font></td></tr> 43 44 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 45 <td colspan=2><tt>Represents a tab in the browser<br> 46 <br> 47 The important parts of the <a href="#Tab">Tab</a> object are in the runtime and page objects.<br> 48 E.g.:<br> 49 # Navigates the tab to a given url.<br> 50 tab.<a href="#Tab-Navigate">Navigate</a>('<a href="http://www.google.com/">http://www.google.com/</a>')<br> 51 <br> 52 # Evaluates 1+1 in the tab's JavaScript context.<br> 53 tab.Evaluate('1+1')<br> </tt></td></tr> 54 <tr><td> </td> 55 <td width="100%"><dl><dt>Method resolution order:</dt> 56 <dd><a href="telemetry.core.tab.html#Tab">Tab</a></dd> 57 <dd><a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a></dd> 58 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 59 </dl> 60 <hr> 61 Methods defined here:<br> 62 <dl><dt><a name="Tab-Activate"><strong>Activate</strong></a>(self)</dt><dd><tt>Brings this tab to the foreground asynchronously.<br> 63 <br> 64 Not all browsers or browser versions support this method.<br> 65 Be sure to check browser.supports_tab_control.<br> 66 <br> 67 Please note: this is asynchronous. There is a delay between this call<br> 68 and the page's documentVisibilityState becoming 'visible', and yet more<br> 69 delay until the actual tab is visible to the user. None of these delays<br> 70 are included in this call.</tt></dd></dl> 71 72 <dl><dt><a name="Tab-ClearCache"><strong>ClearCache</strong></a>(self)</dt><dd><tt>Clears the browser's HTTP disk cache and the tab's HTTP memory cache.</tt></dd></dl> 73 74 <dl><dt><a name="Tab-CollectGarbage"><strong>CollectGarbage</strong></a>(self)</dt></dl> 75 76 <dl><dt><a name="Tab-GetCookieByName"><strong>GetCookieByName</strong></a>(self, name, timeout<font color="#909090">=60</font>)</dt><dd><tt>Returns the value of the cookie by the given |name|.</tt></dd></dl> 77 78 <dl><dt><a name="Tab-Navigate"><strong>Navigate</strong></a>(self, url, script_to_evaluate_on_commit<font color="#909090">=None</font>, timeout<font color="#909090">=60</font>)</dt><dd><tt>Navigates to url.<br> 79 <br> 80 If |script_to_evaluate_on_commit| is given, the script source string will be<br> 81 evaluated when the navigation is committed. This is after the context of<br> 82 the page exists, but before any script on the page itself has executed.</tt></dd></dl> 83 84 <dl><dt><a name="Tab-PerformActionAndWaitForNavigate"><strong>PerformActionAndWaitForNavigate</strong></a>(self, action_function, timeout<font color="#909090">=60</font>)</dt><dd><tt>Executes action_function, and waits for the navigation to complete.<br> 85 <br> 86 action_function must be a Python function that results in a navigation.<br> 87 This function returns when the navigation is complete or when<br> 88 the timeout has been exceeded.</tt></dd></dl> 89 90 <dl><dt><a name="Tab-Screenshot"><strong>Screenshot</strong></a>(self, timeout<font color="#909090">=60</font>)</dt><dd><tt>Capture a screenshot of the window for rendering validation</tt></dd></dl> 91 92 <dl><dt><a name="Tab-__del__"><strong>__del__</strong></a>(self)</dt></dl> 93 94 <dl><dt><a name="Tab-__init__"><strong>__init__</strong></a>(self, inspector_backend)</dt></dl> 95 96 <hr> 97 Data descriptors defined here:<br> 98 <dl><dt><strong>browser</strong></dt> 99 <dd><tt>The browser in which this tab resides.</tt></dd> 100 </dl> 101 <dl><dt><strong>dom_stats</strong></dt> 102 <dd><tt>A dictionary populated with measured DOM statistics.<br> 103 <br> 104 Currently this dictionary contains:<br> 105 {<br> 106 'document_count': integer,<br> 107 'node_count': integer,<br> 108 'event_listener_count': integer<br> 109 }</tt></dd> 110 </dl> 111 <dl><dt><strong>screenshot_supported</strong></dt> 112 <dd><tt>True if the browser instance is capable of capturing screenshots</tt></dd> 113 </dl> 114 <dl><dt><strong>url</strong></dt> 115 </dl> 116 <hr> 117 Methods inherited from <a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>:<br> 118 <dl><dt><a name="Tab-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes this page.<br> 119 <br> 120 Not all browsers or browser versions support this method.<br> 121 Be sure to check browser.supports_tab_control.</tt></dd></dl> 122 123 <dl><dt><a name="Tab-Disconnect"><strong>Disconnect</strong></a>(self)</dt></dl> 124 125 <dl><dt><a name="Tab-EvaluateJavaScript"><strong>EvaluateJavaScript</strong></a>(self, expr, timeout<font color="#909090">=60</font>)</dt><dd><tt>Evalutes expr in JavaScript and returns the JSONized result.<br> 126 <br> 127 Consider using ExecuteJavaScript for cases where the result of the<br> 128 expression is not needed.<br> 129 <br> 130 If evaluation throws in JavaScript, a Python EvaluateException will<br> 131 be raised.<br> 132 <br> 133 If the result of the evaluation cannot be JSONized, then an<br> 134 EvaluationException will be raised.</tt></dd></dl> 135 136 <dl><dt><a name="Tab-ExecuteJavaScript"><strong>ExecuteJavaScript</strong></a>(self, expr, timeout<font color="#909090">=60</font>)</dt><dd><tt>Executes expr in JavaScript. Does not return the result.<br> 137 <br> 138 If the expression failed to evaluate, EvaluateException will be raised.</tt></dd></dl> 139 140 <dl><dt><a name="Tab-StartTimelineRecording"><strong>StartTimelineRecording</strong></a>(self)</dt></dl> 141 142 <dl><dt><a name="Tab-StopTimelineRecording"><strong>StopTimelineRecording</strong></a>(self)</dt></dl> 143 144 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeComplete"><strong>WaitForDocumentReadyStateToBeComplete</strong></a>(self, timeout<font color="#909090">=60</font>)</dt></dl> 145 146 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeInteractiveOrBetter"><strong>WaitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, timeout<font color="#909090">=60</font>)</dt></dl> 147 148 <hr> 149 Data descriptors inherited from <a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>:<br> 150 <dl><dt><strong>__dict__</strong></dt> 151 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 152 </dl> 153 <dl><dt><strong>__weakref__</strong></dt> 154 <dd><tt>list of weak references to the object (if defined)</tt></dd> 155 </dl> 156 <dl><dt><strong>message_output_stream</strong></dt> 157 </dl> 158 <dl><dt><strong>timeline_model</strong></dt> 159 </dl> 160 </td></tr></table></td></tr></table><p> 161 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 162 <tr bgcolor="#55aa55"> 163 <td colspan=3 valign=bottom> <br> 164 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 165 166 <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 167 <td width="100%"><strong>DEFAULT_TAB_TIMEOUT</strong> = 60</td></tr></table> 168 </body></html>