java.lang.Object
org.openqa.selenium.devtools.v85.runtime.Runtime

public class Runtime extends Object
Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.
  • Constructor Details

    • Runtime

      public Runtime()
  • Method Details

    • awaitPromise

      public static org.openqa.selenium.devtools.Command<Runtime.AwaitPromiseResponse> awaitPromise(RemoteObjectId promiseObjectId, Optional<Boolean> returnByValue, Optional<Boolean> generatePreview)
      Add handler to promise with given promise object id.
    • callFunctionOn

      public static org.openqa.selenium.devtools.Command<Runtime.CallFunctionOnResponse> callFunctionOn(String functionDeclaration, Optional<RemoteObjectId> objectId, Optional<List<CallArgument>> arguments, Optional<Boolean> silent, Optional<Boolean> returnByValue, Optional<Boolean> generatePreview, Optional<Boolean> userGesture, Optional<Boolean> awaitPromise, Optional<ExecutionContextId> executionContextId, Optional<String> objectGroup)
      Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
    • compileScript

      public static org.openqa.selenium.devtools.Command<Runtime.CompileScriptResponse> compileScript(String expression, String sourceURL, Boolean persistScript, Optional<ExecutionContextId> executionContextId)
      Compiles expression.
    • disable

      public static org.openqa.selenium.devtools.Command<Void> disable()
      Disables reporting of execution contexts creation.
    • discardConsoleEntries

      public static org.openqa.selenium.devtools.Command<Void> discardConsoleEntries()
      Discards collected exceptions and console API calls.
    • enable

      public static org.openqa.selenium.devtools.Command<Void> enable()
      Enables reporting of execution contexts creation by means of `executionContextCreated` event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
    • evaluate

      public static org.openqa.selenium.devtools.Command<Runtime.EvaluateResponse> evaluate(String expression, Optional<String> objectGroup, Optional<Boolean> includeCommandLineAPI, Optional<Boolean> silent, Optional<ExecutionContextId> contextId, Optional<Boolean> returnByValue, Optional<Boolean> generatePreview, Optional<Boolean> userGesture, Optional<Boolean> awaitPromise, Optional<Boolean> throwOnSideEffect, Optional<TimeDelta> timeout, Optional<Boolean> disableBreaks, Optional<Boolean> replMode, Optional<Boolean> allowUnsafeEvalBlockedByCSP)
      Evaluates expression on global object.
    • getIsolateId

      @Beta public static org.openqa.selenium.devtools.Command<String> getIsolateId()
      Returns the isolate id.
    • getHeapUsage

      @Beta public static org.openqa.selenium.devtools.Command<Runtime.GetHeapUsageResponse> getHeapUsage()
      Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.
    • getProperties

      public static org.openqa.selenium.devtools.Command<Runtime.GetPropertiesResponse> getProperties(RemoteObjectId objectId, Optional<Boolean> ownProperties, Optional<Boolean> accessorPropertiesOnly, Optional<Boolean> generatePreview)
      Returns properties of a given object. Object group of the result is inherited from the target object.
    • globalLexicalScopeNames

      public static org.openqa.selenium.devtools.Command<List<String>> globalLexicalScopeNames(Optional<ExecutionContextId> executionContextId)
      Returns all let, const and class variables from global scope.
    • queryObjects

      public static org.openqa.selenium.devtools.Command<RemoteObject> queryObjects(RemoteObjectId prototypeObjectId, Optional<String> objectGroup)
    • releaseObject

      public static org.openqa.selenium.devtools.Command<Void> releaseObject(RemoteObjectId objectId)
      Releases remote object with given id.
    • releaseObjectGroup

      public static org.openqa.selenium.devtools.Command<Void> releaseObjectGroup(String objectGroup)
      Releases all remote objects that belong to a given group.
    • runIfWaitingForDebugger

      public static org.openqa.selenium.devtools.Command<Void> runIfWaitingForDebugger()
      Tells inspected instance to run if it was waiting for debugger to attach.
    • runScript

      public static org.openqa.selenium.devtools.Command<Runtime.RunScriptResponse> runScript(ScriptId scriptId, Optional<ExecutionContextId> executionContextId, Optional<String> objectGroup, Optional<Boolean> silent, Optional<Boolean> includeCommandLineAPI, Optional<Boolean> returnByValue, Optional<Boolean> generatePreview, Optional<Boolean> awaitPromise)
      Runs script with given id in a given context.
    • setAsyncCallStackDepth

      public static org.openqa.selenium.devtools.Command<Void> setAsyncCallStackDepth(Integer maxDepth)
      Enables or disables async call stacks tracking.
    • setCustomObjectFormatterEnabled

      @Beta public static org.openqa.selenium.devtools.Command<Void> setCustomObjectFormatterEnabled(Boolean enabled)
    • setMaxCallStackSizeToCapture

      @Beta public static org.openqa.selenium.devtools.Command<Void> setMaxCallStackSizeToCapture(Integer size)
    • terminateExecution

      @Beta public static org.openqa.selenium.devtools.Command<Void> terminateExecution()
      Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.
    • addBinding

      @Beta public static org.openqa.selenium.devtools.Command<Void> addBinding(String name, Optional<ExecutionContextId> executionContextId)
      If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. If executionContextId is specified, adds binding only on global object of given execution context. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.
    • removeBinding

      @Beta public static org.openqa.selenium.devtools.Command<Void> removeBinding(String name)
      This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.
    • bindingCalled

      public static org.openqa.selenium.devtools.Event<BindingCalled> bindingCalled()
    • consoleAPICalled

      public static org.openqa.selenium.devtools.Event<ConsoleAPICalled> consoleAPICalled()
    • exceptionRevoked

      public static org.openqa.selenium.devtools.Event<ExceptionRevoked> exceptionRevoked()
    • exceptionThrown

      public static org.openqa.selenium.devtools.Event<ExceptionThrown> exceptionThrown()
    • executionContextCreated

      public static org.openqa.selenium.devtools.Event<ExecutionContextDescription> executionContextCreated()
    • executionContextDestroyed

      public static org.openqa.selenium.devtools.Event<ExecutionContextId> executionContextDestroyed()
    • executionContextsCleared

      public static org.openqa.selenium.devtools.Event<Void> executionContextsCleared()
    • inspectRequested

      public static org.openqa.selenium.devtools.Event<InspectRequested> inspectRequested()