org.pageobject.core.dsl

ScriptDsl

trait ScriptDsl extends AnyRef

This trait is part of the PageObject DSL.

This trait implements javascript commands.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ScriptDsl
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def executeAsyncScript(script: String, args: AnyRef*)(implicit driver: WebDriver): Any

    Executes an asynchronous piece of JavaScript in the context of the currently selected frame or window.

    Executes an asynchronous piece of JavaScript in the context of the currently selected frame or window.

    Unlike executing synchronous JavaScript, scripts executed with this method must explicitly signal they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument.

    The first argument passed to the callback function will be used as the script's result. This value will be handled as follows:

    • For an HTML element, this method returns a WebElement
    • For a number, a Long is returned
    • For a boolean, a Boolean is returned
    • For all other cases, a String is returned
    • For an array, return a List<Object> with each object following the rules above. We support nested lists
    • Unless the value is null or there is no return value, in which null is returned

    Script arguments must be a number, boolean, String, WebElement, or a List of any combination of these. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" variable. (Note that although this behavior is specified by Selenium's JavascriptExecutor Javadoc, it may still be possible for the underlying JavascriptExecutor implementation to return an objects of other types. For example, HtmlUnit has been observed to return a java.util.Map for a Javascript object.)

    script

    the JavaScript to execute

    args

    the arguments to the script, may be empty

    returns

    One of Boolean, Long, String, List, WebElement, or null (following Selenium's JavascriptExecutor Javadoc)

    Attributes
    protected
  11. def executeScript[T](script: String, args: AnyRef*)(implicit driver: WebDriver): Any

    Executes JavaScript in the context of the currently selected frame or window.

    Executes JavaScript in the context of the currently selected frame or window. The script fragment provided will be executed as the body of an anonymous function.

    Within the script, you can use document to refer to the current document. Local variables will not be available once the script has finished executing, but global variables will.

    To return a value (e.g. if the script contains a return statement), then the following steps will be taken:

    • For an HTML element, this method returns a WebElement
    • For a decimal, a Double is returned
    • For a non-decimal number, a Long is returned
    • For a boolean, a Boolean is returned
    • For all other cases, a String is returned
    • For an array, return a List<Object> with each object following the rules above. We support nested lists
    • Unless the value is null or there is no return value, in which null is returned

    Script arguments must be a number, boolean, String, WebElement, or a List of any combination of these. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" variable. (Note that although this behavior is specified by Selenium's JavascriptExecutor Javadoc, it may still be possible for the underlying JavascriptExecutor implementation to return an objects of other types. For example, HtmlUnit has been observed to return a java.util.Map for a Javascript object.)

    script

    the JavaScript to execute

    args

    the arguments to the script, may be empty

    returns

    One of Boolean, Long, String, List or WebElement. Or null (following Selenium's JavascriptExecutor Javadoc)

    Attributes
    protected
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. def setScriptTimeout(timeout: FiniteDuration)(implicit driver: WebDriver): Unit

    Sets the amount of time to wait for an asynchronous script to finish execution before throwing an exception.

    Sets the amount of time to wait for an asynchronous script to finish execution before throwing an exception.

    timeout

    the amount of time to wait for an asynchronous script to finish execution before throwing exception

    Attributes
    protected
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped