<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: module telemetry.internal.util.webpagereplay</title> <meta charset="utf-8"> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <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.util.html"><font color="#ffffff">util</font></a>.webpagereplay</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/util/webpagereplay.py">telemetry/internal/util/webpagereplay.py</a></font></td></tr></table> <p><tt>Start and stop Web Page Replay.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="atexit.html">atexit</a><br> <a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> <a href="logging.html">logging</a><br> </td><td width="25%" valign=top><a href="os.html">os</a><br> <a href="re.html">re</a><br> <a href="signal.html">signal</a><br> </td><td width="25%" valign=top><a href="subprocess.html">subprocess</a><br> <a href="sys.html">sys</a><br> <a href="tempfile.html">tempfile</a><br> </td><td width="25%" valign=top><a href="urllib.html">urllib</a><br> <a href="telemetry.core.util.html">telemetry.core.util</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayServer">ReplayServer</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayNotFoundError">ReplayNotFoundError</a> </font></dt><dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayNotStartedError">ReplayNotStartedError</a> </font></dt></dl> </dd> </dl> </dd> </dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ReplayError">class <strong>ReplayError</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Catch-all exception for the module.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="ReplayError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#ReplayError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="ReplayError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="ReplayError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="ReplayError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="ReplayError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="ReplayError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="ReplayError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="ReplayError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> <dl><dt><a name="ReplayError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ReplayNotFoundError">class <strong>ReplayNotFoundError</strong></a>(<a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>)</font></td></tr> <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayNotFoundError">ReplayNotFoundError</a></dd> <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="ReplayNotFoundError-__init__"><strong>__init__</strong></a>(self, label, path)</dt></dl> <dl><dt><a name="ReplayNotFoundError-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Data descriptors inherited from <a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#ReplayNotFoundError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="ReplayNotFoundError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayNotFoundError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotFoundError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="ReplayNotFoundError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayNotFoundError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ReplayNotStartedError">class <strong>ReplayNotStartedError</strong></a>(<a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>)</font></td></tr> <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayNotStartedError">ReplayNotStartedError</a></dd> <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Data descriptors inherited from <a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="ReplayNotStartedError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#ReplayNotStartedError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="ReplayNotStartedError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayNotStartedError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="ReplayNotStartedError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#ReplayNotStartedError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> <dl><dt><a name="ReplayNotStartedError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ReplayServer">class <strong>ReplayServer</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Start and Stop Web Page Replay.<br> <br> Web Page Replay is a proxy that can record and "replay" web pages with<br> simulated network characteristics -- without having to edit the pages<br> by hand. With WPR, tests can use "real" web content, and catch<br> performance issues that may result from introducing network delays and<br> bandwidth throttling.<br> <br> Example:<br> with <a href="#ReplayServer">ReplayServer</a>(archive_path):<br> NavigateToURL(start_url)<br> WaitUntil(...)<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="ReplayServer-StartServer"><strong>StartServer</strong></a>(self)</dt><dd><tt>Start Web Page Replay and verify that it started.<br> <br> Returns:<br> (HTTP_PORT, HTTPS_PORT, DNS_PORT) # DNS_PORT is None if unused.<br> Raises:<br> <a href="#ReplayNotStartedError">ReplayNotStartedError</a>: if Replay start-up fails.</tt></dd></dl> <dl><dt><a name="ReplayServer-StopServer"><strong>StopServer</strong></a>(self)</dt><dd><tt>Stop Web Page Replay.</tt></dd></dl> <dl><dt><a name="ReplayServer-__enter__"><strong>__enter__</strong></a>(self)</dt><dd><tt>Add support for with-statement.</tt></dd></dl> <dl><dt><a name="ReplayServer-__exit__"><strong>__exit__</strong></a>(self, unused_exc_type, unused_exc_val, unused_exc_tb)</dt><dd><tt>Add support for with-statement.</tt></dd></dl> <dl><dt><a name="ReplayServer-__init__"><strong>__init__</strong></a>(self, archive_path, replay_host, http_port, https_port, dns_port, replay_options)</dt><dd><tt>Initialize <a href="#ReplayServer">ReplayServer</a>.<br> <br> Args:<br> archive_path: a path to a specific WPR archive (required).<br> replay_host: the hostname to serve traffic.<br> http_port: an integer port on which to serve HTTP traffic. May be zero<br> to let the OS choose an available port.<br> https_port: an integer port on which to serve HTTPS traffic. May be zero<br> to let the OS choose an available port.<br> dns_port: an integer port on which to serve DNS traffic. May be zero<br> to let the OS choose an available port. If None DNS forwarding is<br> disabled.<br> replay_options: an iterable of options strings to forward to replay.py.</tt></dd></dl> <hr> Data descriptors defined here:<br> <dl><dt><strong>__dict__</strong></dt> <dd><tt>dictionary for instance variables (if defined)</tt></dd> </dl> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> </td></tr></table></td></tr></table> </body></html>