1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: package telemetry</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>telemetry</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/__init__.py">telemetry/__init__.py</a></font></td></tr></table> 12 <p><tt>A library for cross-platform browser tests.</tt></p> 13 <p> 14 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 15 <tr bgcolor="#aa55cc"> 16 <td colspan=3 valign=bottom> <br> 17 <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> 18 19 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 20 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.html"><strong>core</strong> (package)</a><br> 21 <a href="telemetry.page.html"><strong>page</strong> (package)</a><br> 22 </td><td width="25%" valign=top><a href="telemetry.test.html">test</a><br> 23 <a href="telemetry.test_runner.html">test_runner</a><br> 24 </td><td width="25%" valign=top><a href="telemetry.unittest.html"><strong>unittest</strong> (package)</a><br> 25 </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.core.browser.html#Browser">telemetry.core.browser.Browser</a> 37 </font></dt></dl> 38 </dd> 39 <dt><font face="helvetica, arial"><a href="optparse.html#Values">optparse.Values</a> 40 </font></dt><dd> 41 <dl> 42 <dt><font face="helvetica, arial"><a href="telemetry.core.browser_options.html#BrowserOptions">telemetry.core.browser_options.BrowserOptions</a> 43 </font></dt></dl> 44 </dd> 45 <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>) 46 </font></dt><dd> 47 <dl> 48 <dt><font face="helvetica, arial"><a href="telemetry.core.tab.html#Tab">telemetry.core.tab.Tab</a> 49 </font></dt></dl> 50 </dd> 51 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 52 </font></dt><dd> 53 <dl> 54 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#PageMeasurement">telemetry.page.page_measurement.PageMeasurement</a> 55 </font></dt></dl> 56 </dd> 57 </dl> 58 <p> 59 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 60 <tr bgcolor="#ffc8d8"> 61 <td colspan=3 valign=bottom> <br> 62 <font color="#000000" face="helvetica, arial"><a name="Browser">class <strong>Browser</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 63 64 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 65 <td colspan=2><tt>A running browser instance that can be controlled in a limited way.<br> 66 <br> 67 To create a browser instance, use browser_finder.FindBrowser.<br> 68 <br> 69 Be sure to clean up after yourself by calling <a href="#Browser-Close">Close</a>() when you are done with<br> 70 the browser. Or better yet:<br> 71 browser_to_create = FindBrowser(options)<br> 72 with browser_to_create.Create() as browser:<br> 73 ... do all your operations on browser here<br> </tt></td></tr> 74 <tr><td> </td> 75 <td width="100%">Methods defined here:<br> 76 <dl><dt><a name="Browser-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes this browser.</tt></dd></dl> 77 78 <dl><dt><a name="Browser-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl> 79 80 <dl><dt><a name="Browser-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl> 81 82 <dl><dt><a name="Browser-GetTraceResultAndReset"><strong>GetTraceResultAndReset</strong></a>(self)</dt><dd><tt>Returns the result of the trace, as TraceResult <a href="__builtin__.html#object">object</a>.</tt></dd></dl> 83 84 <dl><dt><a name="Browser-SetHTTPServerDirectories"><strong>SetHTTPServerDirectories</strong></a>(self, paths)</dt><dd><tt>Returns True if the HTTP server was started, False otherwise.</tt></dd></dl> 85 86 <dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</strong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False</font>, make_javascript_deterministic<font color="#909090">=True</font>)</dt></dl> 87 88 <dl><dt><a name="Browser-StartProfiling"><strong>StartProfiling</strong></a>(self, options, base_output_file)</dt><dd><tt>Starts profiling using |options|.profiler_tool. Results are saved to<br> 89 |base_output_file|.<process_name>.</tt></dd></dl> 90 91 <dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=10</font>)</dt></dl> 92 93 <dl><dt><a name="Browser-StopProfiling"><strong>StopProfiling</strong></a>(self)</dt><dd><tt>Stops all active profilers and saves their results.</tt></dd></dl> 94 95 <dl><dt><a name="Browser-StopTracing"><strong>StopTracing</strong></a>(self)</dt></dl> 96 97 <dl><dt><a name="Browser-__enter__"><strong>__enter__</strong></a>(self)</dt></dl> 98 99 <dl><dt><a name="Browser-__exit__"><strong>__exit__</strong></a>(self, *args)</dt></dl> 100 101 <dl><dt><a name="Browser-__init__"><strong>__init__</strong></a>(self, backend, platform_backend)</dt></dl> 102 103 <dl><dt><a name="Browser-is_profiler_active"><strong>is_profiler_active</strong></a>(self, profiler_name)</dt></dl> 104 105 <hr> 106 Data descriptors defined here:<br> 107 <dl><dt><strong>__dict__</strong></dt> 108 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 109 </dl> 110 <dl><dt><strong>__weakref__</strong></dt> 111 <dd><tt>list of weak references to the object (if defined)</tt></dd> 112 </dl> 113 <dl><dt><strong>browser_type</strong></dt> 114 </dl> 115 <dl><dt><strong>extensions</strong></dt> 116 <dd><tt>Returns the extension dictionary if it exists.</tt></dd> 117 </dl> 118 <dl><dt><strong>http_server</strong></dt> 119 </dl> 120 <dl><dt><strong>io_stats</strong></dt> 121 <dd><tt>Returns a dict of IO statistics for the browser:<br> 122 { 'Browser': {<br> 123 'ReadOperationCount': W,<br> 124 'WriteOperationCount': X,<br> 125 'ReadTransferCount': Y,<br> 126 'WriteTransferCount': Z<br> 127 },<br> 128 'Gpu': {<br> 129 'ReadOperationCount': W,<br> 130 'WriteOperationCount': X,<br> 131 'ReadTransferCount': Y,<br> 132 'WriteTransferCount': Z<br> 133 },<br> 134 'Renderer': {<br> 135 'ReadOperationCount': W,<br> 136 'WriteOperationCount': X,<br> 137 'ReadTransferCount': Y,<br> 138 'WriteTransferCount': Z<br> 139 }<br> 140 }</tt></dd> 141 </dl> 142 <dl><dt><strong>is_content_shell</strong></dt> 143 <dd><tt>Returns whether this browser is a content shell, only.</tt></dd> 144 </dl> 145 <dl><dt><strong>memory_stats</strong></dt> 146 <dd><tt>Returns a dict of memory statistics for the browser:<br> 147 { 'Browser': {<br> 148 'VM': S,<br> 149 'VMPeak': T,<br> 150 'WorkingSetSize': U,<br> 151 'WorkingSetSizePeak': V,<br> 152 'ProportionalSetSize': W,<br> 153 'PrivateDirty': X<br> 154 },<br> 155 'Gpu': {<br> 156 'VM': S,<br> 157 'VMPeak': T,<br> 158 'WorkingSetSize': U,<br> 159 'WorkingSetSizePeak': V,<br> 160 'ProportionalSetSize': W,<br> 161 'PrivateDirty': X<br> 162 },<br> 163 'Renderer': {<br> 164 'VM': S,<br> 165 'VMPeak': T,<br> 166 'WorkingSetSize': U,<br> 167 'WorkingSetSizePeak': V,<br> 168 'ProportionalSetSize': W,<br> 169 'PrivateDirty': X<br> 170 },<br> 171 'SystemCommitCharge': Y,<br> 172 'ProcessCount': Z,<br> 173 }<br> 174 Any of the above keys may be missing on a per-platform basis.</tt></dd> 175 </dl> 176 <dl><dt><strong>platform</strong></dt> 177 </dl> 178 <dl><dt><strong>supports_extensions</strong></dt> 179 </dl> 180 <dl><dt><strong>supports_tab_control</strong></dt> 181 </dl> 182 <dl><dt><strong>supports_tracing</strong></dt> 183 </dl> 184 <dl><dt><strong>tabs</strong></dt> 185 </dl> 186 </td></tr></table> <p> 187 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 188 <tr bgcolor="#ffc8d8"> 189 <td colspan=3 valign=bottom> <br> 190 <font color="#000000" face="helvetica, arial"><a name="BrowserOptions">class <strong>BrowserOptions</strong></a>(<a href="optparse.html#Values">optparse.Values</a>)</font></td></tr> 191 192 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 193 <td colspan=2><tt>Options to be used for discovering and launching a browser.<br> </tt></td></tr> 194 <tr><td> </td> 195 <td width="100%">Methods defined here:<br> 196 <dl><dt><a name="BrowserOptions-AppendExtraBrowserArg"><strong>AppendExtraBrowserArg</strong></a>(self, arg)</dt></dl> 197 198 <dl><dt><a name="BrowserOptions-Copy"><strong>Copy</strong></a>(self)</dt></dl> 199 200 <dl><dt><a name="BrowserOptions-CreateParser"><strong>CreateParser</strong></a>(self, *args, **kwargs)</dt></dl> 201 202 <dl><dt><a name="BrowserOptions-__init__"><strong>__init__</strong></a>(self, browser_type<font color="#909090">=None</font>)</dt></dl> 203 204 <hr> 205 Methods inherited from <a href="optparse.html#Values">optparse.Values</a>:<br> 206 <dl><dt><a name="BrowserOptions-__cmp__"><strong>__cmp__</strong></a>(self, other)</dt></dl> 207 208 <dl><dt><a name="BrowserOptions-__repr__"><strong>__repr__</strong></a> = _repr(self)</dt></dl> 209 210 <dl><dt><a name="BrowserOptions-__str__"><strong>__str__</strong></a>(self)</dt></dl> 211 212 <dl><dt><a name="BrowserOptions-ensure_value"><strong>ensure_value</strong></a>(self, attr, value)</dt></dl> 213 214 <dl><dt><a name="BrowserOptions-read_file"><strong>read_file</strong></a>(self, filename, mode<font color="#909090">='careful'</font>)</dt></dl> 215 216 <dl><dt><a name="BrowserOptions-read_module"><strong>read_module</strong></a>(self, modname, mode<font color="#909090">='careful'</font>)</dt></dl> 217 218 </td></tr></table> <p> 219 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 220 <tr bgcolor="#ffc8d8"> 221 <td colspan=3 valign=bottom> <br> 222 <font color="#000000" face="helvetica, arial"><a name="PageMeasurement">class <strong>PageMeasurement</strong></a>(<a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>)</font></td></tr> 223 224 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 225 <td colspan=2><tt>Glue code for running a measurement across a set of pages.<br> 226 <br> 227 To use this, subclass from the measurement and override MeasurePage. For<br> 228 example:<br> 229 <br> 230 class BodyChildElementMeasurement(<a href="#PageMeasurement">PageMeasurement</a>):<br> 231 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self, page, tab, results):<br> 232 body_child_count = tab.EvaluateJavaScript(<br> 233 'document.body.children.length')<br> 234 results.Add('body_children', 'count', body_child_count)<br> 235 <br> 236 if __name__ == '__main__':<br> 237 page_measurement.Main(BodyChildElementMeasurement())<br> 238 <br> 239 To add test-specific options:<br> 240 <br> 241 class BodyChildElementMeasurement(<a href="#PageMeasurement">PageMeasurement</a>):<br> 242 def <a href="#PageMeasurement-AddCommandLineOptions">AddCommandLineOptions</a>(parser):<br> 243 parser.add_option('--element', action='store', default='body')<br> 244 <br> 245 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self, page, tab, results):<br> 246 body_child_count = tab.EvaluateJavaScript(<br> 247 'document.querySelector('%s').children.length')<br> 248 results.Add('children', 'count', child_count)<br> </tt></td></tr> 249 <tr><td> </td> 250 <td width="100%"><dl><dt>Method resolution order:</dt> 251 <dd><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasurement</a></dd> 252 <dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a></dd> 253 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 254 </dl> 255 <hr> 256 Methods defined here:<br> 257 <dl><dt><a name="PageMeasurement-AddOutputOptions"><strong>AddOutputOptions</strong></a>(self, parser)</dt></dl> 258 259 <dl><dt><a name="PageMeasurement-MeasurePage"><strong>MeasurePage</strong></a>(self, page, tab, results)</dt><dd><tt>Override to actually measure the page's performance.<br> 260 <br> 261 page is a page_set.Page<br> 262 tab is an instance of telemetry.core.<a href="#Tab">Tab</a><br> 263 <br> 264 Should call results.Add(name, units, value) for each result, or raise an<br> 265 exception on failure. The name and units of each Add() call must be<br> 266 the same across all iterations. The name 'url' must not be used.<br> 267 <br> 268 Prefer field names that are in accordance with python variable style. E.g.<br> 269 field_name.<br> 270 <br> 271 Put together:<br> 272 <br> 273 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self, page, tab, results):<br> 274 res = tab.EvaluateJavaScript('2+2')<br> 275 if res != 4:<br> 276 raise Exception('Oh, wow.')<br> 277 results.Add('two_plus_two', 'count', res)</tt></dd></dl> 278 279 <dl><dt><a name="PageMeasurement-PrepareResults"><strong>PrepareResults</strong></a>(self, options)</dt></dl> 280 281 <dl><dt><a name="PageMeasurement-__init__"><strong>__init__</strong></a>(self, action_name_to_run<font color="#909090">=''</font>, needs_browser_restart_after_each_run<font color="#909090">=False</font>, discard_first_result<font color="#909090">=False</font>, clear_cache_before_each_run<font color="#909090">=False</font>)</dt></dl> 282 283 <hr> 284 Data descriptors defined here:<br> 285 <dl><dt><strong>output_format_choices</strong></dt> 286 </dl> 287 <dl><dt><strong>results_are_the_same_on_every_page</strong></dt> 288 <dd><tt>By default, measurements are assumed to output the same values for every<br> 289 page. This allows incremental output, for example in CSV. If, however, the<br> 290 measurement discovers what values it can report as it goes, and those values<br> 291 may vary from page to page, you need to override this function and return<br> 292 False. Output will not appear in this mode until the entire pageset has<br> 293 run.</tt></dd> 294 </dl> 295 <hr> 296 Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br> 297 <dl><dt><a name="PageMeasurement-AddCommandLineOptions"><strong>AddCommandLineOptions</strong></a>(self, parser)</dt><dd><tt>Override to expose command-line options for this test.<br> 298 <br> 299 The provided parser is an optparse.OptionParser instance and accepts all<br> 300 normal results. The parsed options are available in Run as<br> 301 self.<strong>options</strong>.</tt></dd></dl> 302 303 <dl><dt><a name="PageMeasurement-CanRunForPage"><strong>CanRunForPage</strong></a>(self, page)</dt><dd><tt>Override to customize if the test can be ran for the given page.</tt></dd></dl> 304 305 <dl><dt><a name="PageMeasurement-CreatePageSet"><strong>CreatePageSet</strong></a>(self, args, options)</dt><dd><tt>Override to make this test generate its own page set instead of<br> 306 allowing arbitrary page sets entered from the command-line.</tt></dd></dl> 307 308 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt><dd><tt>Override to add test-specific options to the <a href="#BrowserOptions">BrowserOptions</a> <a href="__builtin__.html#object">object</a></tt></dd></dl> 309 310 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForPage"><strong>CustomizeBrowserOptionsForPage</strong></a>(self, page, options)</dt><dd><tt>Add options specific to the test and the given page.</tt></dd></dl> 311 312 <dl><dt><a name="PageMeasurement-DidNavigateToPage"><strong>DidNavigateToPage</strong></a>(self, page, tab)</dt><dd><tt>Override to do operations right after the page is navigated, but before<br> 313 any waiting for completion has occurred.</tt></dd></dl> 314 315 <dl><dt><a name="PageMeasurement-DidRunAction"><strong>DidRunAction</strong></a>(self, page, tab, action)</dt><dd><tt>Override to do operations after running the action on the page.</tt></dd></dl> 316 317 <dl><dt><a name="PageMeasurement-DidRunPageSet"><strong>DidRunPageSet</strong></a>(self, tab, results)</dt><dd><tt>Override to do operations after page set is completed, but before browser<br> 318 is torn down.</tt></dd></dl> 319 320 <dl><dt><a name="PageMeasurement-DidStartHTTPServer"><strong>DidStartHTTPServer</strong></a>(self, tab)</dt><dd><tt>Override to do operations after the HTTP server is started.</tt></dd></dl> 321 322 <dl><dt><a name="PageMeasurement-NeedsBrowserRestartAfterEachRun"><strong>NeedsBrowserRestartAfterEachRun</strong></a>(self, tab)</dt><dd><tt>Override to specify browser restart after each run.</tt></dd></dl> 323 324 <dl><dt><a name="PageMeasurement-Run"><strong>Run</strong></a>(self, options, page, tab, results)</dt></dl> 325 326 <dl><dt><a name="PageMeasurement-SetUpBrowser"><strong>SetUpBrowser</strong></a>(self, browser)</dt><dd><tt>Override to customize the browser right after it has launched.</tt></dd></dl> 327 328 <dl><dt><a name="PageMeasurement-WillNavigateToPage"><strong>WillNavigateToPage</strong></a>(self, page, tab)</dt><dd><tt>Override to do operations before the page is navigated.</tt></dd></dl> 329 330 <dl><dt><a name="PageMeasurement-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab, action)</dt><dd><tt>Override to do operations before running the action on the page.</tt></dd></dl> 331 332 <dl><dt><a name="PageMeasurement-WillRunPageSet"><strong>WillRunPageSet</strong></a>(self, tab)</dt><dd><tt>Override to do operations before the page set is navigated.</tt></dd></dl> 333 334 <hr> 335 Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br> 336 <dl><dt><strong>__dict__</strong></dt> 337 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 338 </dl> 339 <dl><dt><strong>__weakref__</strong></dt> 340 <dd><tt>list of weak references to the object (if defined)</tt></dd> 341 </dl> 342 <dl><dt><strong>action_name_to_run</strong></dt> 343 </dl> 344 <dl><dt><strong>clear_cache_before_each_run</strong></dt> 345 <dd><tt>When set to True, the browser's disk and memory cache will be cleared<br> 346 before each run.</tt></dd> 347 </dl> 348 <dl><dt><strong>discard_first_result</strong></dt> 349 <dd><tt>When set to True, the first run of the test is discarded. This is<br> 350 useful for cases where it's desirable to have some test resource cached so<br> 351 the first run of the test can warm things up.</tt></dd> 352 </dl> 353 </td></tr></table> <p> 354 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 355 <tr bgcolor="#ffc8d8"> 356 <td colspan=3 valign=bottom> <br> 357 <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> 358 359 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 360 <td colspan=2><tt>Represents a tab in the browser<br> 361 <br> 362 The important parts of the <a href="#Tab">Tab</a> <a href="__builtin__.html#object">object</a> are in the runtime and page objects.<br> 363 E.g.:<br> 364 # Navigates the tab to a given url.<br> 365 tab.<a href="#Tab-Navigate">Navigate</a>('<a href="http://www.google.com/">http://www.google.com/</a>')<br> 366 <br> 367 # Evaluates 1+1 in the tab's JavaScript context.<br> 368 tab.Evaluate('1+1')<br> </tt></td></tr> 369 <tr><td> </td> 370 <td width="100%"><dl><dt>Method resolution order:</dt> 371 <dd><a href="telemetry.core.tab.html#Tab">Tab</a></dd> 372 <dd><a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a></dd> 373 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 374 </dl> 375 <hr> 376 Methods defined here:<br> 377 <dl><dt><a name="Tab-Activate"><strong>Activate</strong></a>(self)</dt><dd><tt>Brings this tab to the foreground asynchronously.<br> 378 <br> 379 Not all browsers or browser versions support this method.<br> 380 Be sure to check browser.supports_tab_control.<br> 381 <br> 382 Please note: this is asynchronous. There is a delay between this call<br> 383 and the page's documentVisibilityState becoming 'visible', and yet more<br> 384 delay until the actual tab is visible to the user. None of these delays<br> 385 are included in this call.</tt></dd></dl> 386 387 <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> 388 389 <dl><dt><a name="Tab-CollectGarbage"><strong>CollectGarbage</strong></a>(self)</dt></dl> 390 391 <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> 392 393 <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> 394 <br> 395 If |script_to_evaluate_on_commit| is given, the script source string will be<br> 396 evaluated when the navigation is committed. This is after the context of<br> 397 the page exists, but before any script on the page itself has executed.</tt></dd></dl> 398 399 <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> 400 <br> 401 action_function must be a Python function that results in a navigation.<br> 402 This function returns when the navigation is complete or when<br> 403 the timeout has been exceeded.</tt></dd></dl> 404 405 <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> 406 407 <dl><dt><a name="Tab-__del__"><strong>__del__</strong></a>(self)</dt></dl> 408 409 <dl><dt><a name="Tab-__init__"><strong>__init__</strong></a>(self, inspector_backend)</dt></dl> 410 411 <hr> 412 Data descriptors defined here:<br> 413 <dl><dt><strong>browser</strong></dt> 414 <dd><tt>The browser in which this tab resides.</tt></dd> 415 </dl> 416 <dl><dt><strong>dom_stats</strong></dt> 417 <dd><tt>A dictionary populated with measured DOM statistics.<br> 418 <br> 419 Currently this dictionary contains:<br> 420 {<br> 421 'document_count': integer,<br> 422 'node_count': integer,<br> 423 'event_listener_count': integer<br> 424 }</tt></dd> 425 </dl> 426 <dl><dt><strong>screenshot_supported</strong></dt> 427 <dd><tt>True if the browser instance is capable of capturing screenshots</tt></dd> 428 </dl> 429 <dl><dt><strong>url</strong></dt> 430 </dl> 431 <hr> 432 Methods inherited from <a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>:<br> 433 <dl><dt><a name="Tab-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes this page.<br> 434 <br> 435 Not all browsers or browser versions support this method.<br> 436 Be sure to check browser.supports_tab_control.</tt></dd></dl> 437 438 <dl><dt><a name="Tab-Disconnect"><strong>Disconnect</strong></a>(self)</dt></dl> 439 440 <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> 441 <br> 442 Consider using ExecuteJavaScript for cases where the result of the<br> 443 expression is not needed.<br> 444 <br> 445 If evaluation throws in JavaScript, a Python EvaluateException will<br> 446 be raised.<br> 447 <br> 448 If the result of the evaluation cannot be JSONized, then an<br> 449 EvaluationException will be raised.</tt></dd></dl> 450 451 <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> 452 <br> 453 If the expression failed to evaluate, EvaluateException will be raised.</tt></dd></dl> 454 455 <dl><dt><a name="Tab-StartTimelineRecording"><strong>StartTimelineRecording</strong></a>(self)</dt></dl> 456 457 <dl><dt><a name="Tab-StopTimelineRecording"><strong>StopTimelineRecording</strong></a>(self)</dt></dl> 458 459 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeComplete"><strong>WaitForDocumentReadyStateToBeComplete</strong></a>(self, timeout<font color="#909090">=60</font>)</dt></dl> 460 461 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeInteractiveOrBetter"><strong>WaitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, timeout<font color="#909090">=60</font>)</dt></dl> 462 463 <hr> 464 Data descriptors inherited from <a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_contents.WebContents</a>:<br> 465 <dl><dt><strong>__dict__</strong></dt> 466 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 467 </dl> 468 <dl><dt><strong>__weakref__</strong></dt> 469 <dd><tt>list of weak references to the object (if defined)</tt></dd> 470 </dl> 471 <dl><dt><strong>message_output_stream</strong></dt> 472 </dl> 473 <dl><dt><strong>timeline_model</strong></dt> 474 </dl> 475 </td></tr></table></td></tr></table><p> 476 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 477 <tr bgcolor="#eeaa77"> 478 <td colspan=3 valign=bottom> <br> 479 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> 480 481 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> 482 <td width="100%"><dl><dt><a name="-RunPage"><strong>RunPage</strong></a> = Run(test, page_set, options)</dt><dd><tt>Runs a given test against a given page_set with the given options.</tt></dd></dl> 483 </td></tr></table><p> 484 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 485 <tr bgcolor="#55aa55"> 486 <td colspan=3 valign=bottom> <br> 487 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 488 489 <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 490 <td width="100%"><strong>__all__</strong> = ['Browser', 'BrowserOptions', 'PageMeasurement', 'RunPage', 'Tab']</td></tr></table> 491 </body></html>