telemetry.core.web_contents
index
telemetry/core/web_contents.py

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

 
Modules
       
os
telemetry.core.util

 
Classes
       
__builtin__.object
WebContents

 
class WebContents(__builtin__.object)
    Represents web contents in the browser
 
  Methods defined here:
Close(self)
Closes this page.
 
Not all browsers or browser versions support this method.
Be sure to check browser.supports_tab_control.
EvaluateJavaScript(self, expr, timeout=90)
Evalutes expr in JavaScript and returns the JSONized result.
 
Consider using ExecuteJavaScript for cases where the result of the
expression is not needed.
 
If evaluation throws in JavaScript, a Python EvaluateException will
be raised.
 
If the result of the evaluation cannot be JSONized, then an
EvaluationException will be raised.
EvaluateJavaScriptInContext(self, expr, context_id, timeout=90)
Similar to ExecuteJavaScript, except context_id can refer to an iframe.
The main page has context_id=1, the first iframe context_id=2, etc.
ExecuteJavaScript(self, expr, timeout=90)
Executes expr in JavaScript. Does not return the result.
 
If the expression failed to evaluate, EvaluateException will be raised.
ExecuteJavaScriptInContext(self, expr, context_id, timeout=90)
Similar to ExecuteJavaScript, except context_id can refer to an iframe.
The main page has context_id=1, the first iframe context_id=2, etc.
HasReachedQuiescence(self)
Determine whether the page has reached quiescence after loading.
 
Returns:
  True if 2 seconds have passed since last resource received, false
  otherwise.
StartTimelineRecording(self, options=None)
StopTimelineRecording(self)
TakeJSHeapSnapshot(self, timeout=120)
WaitForDocumentReadyStateToBeComplete(self, timeout=90)
WaitForDocumentReadyStateToBeInteractiveOrBetter(self, timeout=90)
WaitForJavaScriptExpression(self, expr, timeout)
Waits for the given JavaScript expression to be True.
 
This method is robust against any given Evaluation timing out.
__init__(self, inspector_backend)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
is_timeline_recording_running
message_output_stream
timeline_model

 
Data
        DEFAULT_WEB_CONTENTS_TIMEOUT = 90