1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.internal.util.webpagereplay</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> <br> 10 <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 11 ><td align=right valign=bottom 12 ><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> 13 <p><tt>Start and stop Web Page Replay.</tt></p> 14 <p> 15 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 16 <tr bgcolor="#aa55cc"> 17 <td colspan=3 valign=bottom> <br> 18 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 19 20 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 21 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="atexit.html">atexit</a><br> 22 <a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> 23 <a href="logging.html">logging</a><br> 24 </td><td width="25%" valign=top><a href="os.html">os</a><br> 25 <a href="re.html">re</a><br> 26 <a href="signal.html">signal</a><br> 27 </td><td width="25%" valign=top><a href="subprocess.html">subprocess</a><br> 28 <a href="sys.html">sys</a><br> 29 <a href="tempfile.html">tempfile</a><br> 30 </td><td width="25%" valign=top><a href="urllib.html">urllib</a><br> 31 <a href="telemetry.core.util.html">telemetry.core.util</a><br> 32 </td></tr></table></td></tr></table><p> 33 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 34 <tr bgcolor="#ee77aa"> 35 <td colspan=3 valign=bottom> <br> 36 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 37 38 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 39 <td width="100%"><dl> 40 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 41 </font></dt><dd> 42 <dl> 43 <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayServer">ReplayServer</a> 44 </font></dt></dl> 45 </dd> 46 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) 47 </font></dt><dd> 48 <dl> 49 <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a> 50 </font></dt><dd> 51 <dl> 52 <dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayNotFoundError">ReplayNotFoundError</a> 53 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.internal.util.webpagereplay.html#ReplayNotStartedError">ReplayNotStartedError</a> 54 </font></dt></dl> 55 </dd> 56 </dl> 57 </dd> 58 </dl> 59 <p> 60 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 61 <tr bgcolor="#ffc8d8"> 62 <td colspan=3 valign=bottom> <br> 63 <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> 64 65 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 66 <td colspan=2><tt>Catch-all exception for the module.<br> </tt></td></tr> 67 <tr><td> </td> 68 <td width="100%"><dl><dt>Method resolution order:</dt> 69 <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> 70 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 71 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 72 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 73 </dl> 74 <hr> 75 Data descriptors defined here:<br> 76 <dl><dt><strong>__weakref__</strong></dt> 77 <dd><tt>list of weak references to the object (if defined)</tt></dd> 78 </dl> 79 <hr> 80 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 81 <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> 82 83 <hr> 84 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 85 <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> 86 87 <hr> 88 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 89 <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> 90 91 <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> 92 93 <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> 94 95 <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> 96 <br> 97 Use of negative indices is not supported.</tt></dd></dl> 98 99 <dl><dt><a name="ReplayError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 100 101 <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> 102 103 <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> 104 105 <dl><dt><a name="ReplayError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 106 107 <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> 108 109 <dl><dt><a name="ReplayError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 110 111 <hr> 112 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 113 <dl><dt><strong>__dict__</strong></dt> 114 </dl> 115 <dl><dt><strong>args</strong></dt> 116 </dl> 117 <dl><dt><strong>message</strong></dt> 118 </dl> 119 </td></tr></table> <p> 120 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 121 <tr bgcolor="#ffc8d8"> 122 <td colspan=3 valign=bottom> <br> 123 <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> 124 125 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 126 <td width="100%"><dl><dt>Method resolution order:</dt> 127 <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayNotFoundError">ReplayNotFoundError</a></dd> 128 <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> 129 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 130 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 131 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 132 </dl> 133 <hr> 134 Methods defined here:<br> 135 <dl><dt><a name="ReplayNotFoundError-__init__"><strong>__init__</strong></a>(self, label, path)</dt></dl> 136 137 <dl><dt><a name="ReplayNotFoundError-__str__"><strong>__str__</strong></a>(self)</dt></dl> 138 139 <hr> 140 Data descriptors inherited from <a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>:<br> 141 <dl><dt><strong>__weakref__</strong></dt> 142 <dd><tt>list of weak references to the object (if defined)</tt></dd> 143 </dl> 144 <hr> 145 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 146 <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> 147 148 <hr> 149 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 150 <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> 151 152 <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> 153 154 <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> 155 156 <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> 157 <br> 158 Use of negative indices is not supported.</tt></dd></dl> 159 160 <dl><dt><a name="ReplayNotFoundError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 161 162 <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> 163 164 <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> 165 166 <dl><dt><a name="ReplayNotFoundError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 167 168 <dl><dt><a name="ReplayNotFoundError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 169 170 <hr> 171 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 172 <dl><dt><strong>__dict__</strong></dt> 173 </dl> 174 <dl><dt><strong>args</strong></dt> 175 </dl> 176 <dl><dt><strong>message</strong></dt> 177 </dl> 178 </td></tr></table> <p> 179 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 180 <tr bgcolor="#ffc8d8"> 181 <td colspan=3 valign=bottom> <br> 182 <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> 183 184 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 185 <td width="100%"><dl><dt>Method resolution order:</dt> 186 <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayNotStartedError">ReplayNotStartedError</a></dd> 187 <dd><a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a></dd> 188 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> 189 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> 190 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 191 </dl> 192 <hr> 193 Data descriptors inherited from <a href="telemetry.internal.util.webpagereplay.html#ReplayError">ReplayError</a>:<br> 194 <dl><dt><strong>__weakref__</strong></dt> 195 <dd><tt>list of weak references to the object (if defined)</tt></dd> 196 </dl> 197 <hr> 198 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 199 <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> 200 201 <hr> 202 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> 203 <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> 204 205 <hr> 206 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 207 <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> 208 209 <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> 210 211 <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> 212 213 <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> 214 <br> 215 Use of negative indices is not supported.</tt></dd></dl> 216 217 <dl><dt><a name="ReplayNotStartedError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> 218 219 <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> 220 221 <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> 222 223 <dl><dt><a name="ReplayNotStartedError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> 224 225 <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> 226 227 <dl><dt><a name="ReplayNotStartedError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> 228 229 <hr> 230 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> 231 <dl><dt><strong>__dict__</strong></dt> 232 </dl> 233 <dl><dt><strong>args</strong></dt> 234 </dl> 235 <dl><dt><strong>message</strong></dt> 236 </dl> 237 </td></tr></table> <p> 238 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 239 <tr bgcolor="#ffc8d8"> 240 <td colspan=3 valign=bottom> <br> 241 <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> 242 243 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 244 <td colspan=2><tt>Start and Stop Web Page Replay.<br> 245 <br> 246 Web Page Replay is a proxy that can record and "replay" web pages with<br> 247 simulated network characteristics -- without having to edit the pages<br> 248 by hand. With WPR, tests can use "real" web content, and catch<br> 249 performance issues that may result from introducing network delays and<br> 250 bandwidth throttling.<br> 251 <br> 252 Example:<br> 253 with <a href="#ReplayServer">ReplayServer</a>(archive_path):<br> 254 NavigateToURL(start_url)<br> 255 WaitUntil(...)<br> </tt></td></tr> 256 <tr><td> </td> 257 <td width="100%">Methods defined here:<br> 258 <dl><dt><a name="ReplayServer-StartServer"><strong>StartServer</strong></a>(self)</dt><dd><tt>Start Web Page Replay and verify that it started.<br> 259 <br> 260 Returns:<br> 261 (HTTP_PORT, HTTPS_PORT, DNS_PORT) # DNS_PORT is None if unused.<br> 262 Raises:<br> 263 <a href="#ReplayNotStartedError">ReplayNotStartedError</a>: if Replay start-up fails.</tt></dd></dl> 264 265 <dl><dt><a name="ReplayServer-StopServer"><strong>StopServer</strong></a>(self)</dt><dd><tt>Stop Web Page Replay.</tt></dd></dl> 266 267 <dl><dt><a name="ReplayServer-__enter__"><strong>__enter__</strong></a>(self)</dt><dd><tt>Add support for with-statement.</tt></dd></dl> 268 269 <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> 270 271 <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> 272 <br> 273 Args:<br> 274 archive_path: a path to a specific WPR archive (required).<br> 275 replay_host: the hostname to serve traffic.<br> 276 http_port: an integer port on which to serve HTTP traffic. May be zero<br> 277 to let the OS choose an available port.<br> 278 https_port: an integer port on which to serve HTTPS traffic. May be zero<br> 279 to let the OS choose an available port.<br> 280 dns_port: an integer port on which to serve DNS traffic. May be zero<br> 281 to let the OS choose an available port. If None DNS forwarding is<br> 282 disabled.<br> 283 replay_options: an iterable of options strings to forward to replay.py.</tt></dd></dl> 284 285 <hr> 286 Data descriptors defined here:<br> 287 <dl><dt><strong>__dict__</strong></dt> 288 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 289 </dl> 290 <dl><dt><strong>__weakref__</strong></dt> 291 <dd><tt>list of weak references to the object (if defined)</tt></dd> 292 </dl> 293 </td></tr></table></td></tr></table> 294 </body></html>