c

gwen.web

WebContext

class WebContext extends WebElementLocator with LazyLogging

The web context. All web driver interactions happen here (and will do nothing when --dry-run is enabled).

Linear Supertypes
WebElementLocator, LazyLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebContext
  2. WebElementLocator
  3. LazyLogging
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebContext(env: WebEnvContext, driverManager: DriverManager)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asertVisuals(): Unit

    Performs a visual check of all checkpoints in current eyes session.

  6. def captureCurrentUrl(asName: Option[String]): Unit
  7. def captureScreenshot(unconditional: Boolean): Unit

    Captures and the current screenshot and adds it to the attachments list.

  8. def checkElementState(elementBinding: LocatorBinding, state: String, negate: Boolean): Unit

    Checks the current state of an element.

    Checks the current state of an element.

    elementBinding

    the locator binding of the element

    state

    the state to check

    negate

    whether or not to negate the check

  9. def checkVisual(checkpoint: String, fullPage: Boolean, matchLevel: Option[MatchLevel]): Unit

    Performs a visual checkpoint of the contents in the current browser window.

    Performs a visual checkpoint of the contents in the current browser window.

    checkpoint

    the checkpoint name

    fullPage

    true to capture full page, false otherwise

    matchLevel

    optional match Level

  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def close(name: String): Unit

    Closes a named browser and associated web driver.

  12. def close(): Unit

    Closes all browsers and associated web drivers (if any have loaded).

  13. def closeChild(): Unit

    Closes the child window.

  14. def deselectByIndex(elementBinding: LocatorBinding, index: Int): Unit

    Deselects a value in a dropdown (select control) by index.

    Deselects a value in a dropdown (select control) by index.

    elementBinding

    the web element locator binding

    index

    the index to select (first index is 0)

  15. def deselectByValue(elementBinding: LocatorBinding, value: String): Unit

    Deselects a value in a dropdown (select control) by value.

    Deselects a value in a dropdown (select control) by value.

    elementBinding

    the web element locator binding

    value

    the value to select

  16. def deselectByVisibleText(elementBinding: LocatorBinding, value: String): Unit

    Deselects a value in a dropdown (select control) by visible text.

    Deselects a value in a dropdown (select control) by visible text.

    elementBinding

    the web element locator binding

    value

    the value to select

  17. def dragAndDrop(sourceBinding: LocatorBinding, targetBinding: LocatorBinding): Unit
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def executeJS(javascript: String, params: Any*)(implicit takeScreenShot: Boolean = false): Any

    Injects and executes a javascript on the current page through web driver.

    Injects and executes a javascript on the current page through web driver.

    javascript

    the script expression to execute

    params

    optional parameters to the script

    takeScreenShot

    true to take screenshot after performing the function

  21. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def getCachedWebElement(element: String): Option[WebElement]

    Gets a cached web element.

    Gets a cached web element.

    element

    the name of the web element

    returns

    the cached web element

  23. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. def getElementSelection(name: String, selection: String): Option[String]

    Gets an element's selected value(s).

    Gets an element's selected value(s).

    name

    the name of the element

    selection

    text to get selected option text, value to get selected option value

    returns

    the selected value or a comma seprated string containing all the selected values if multiple values are selected.

  25. def getElementText(elementBinding: LocatorBinding): Option[String]

    Gets the text value of a web element on the current page.

    Gets the text value of a web element on the current page. A search for the text is made in the following order and the first value found is returned:

    • Web element text
    • Web element text attribute
    • Web element value attribute If a value is found, its value is bound to the current page scope as name/text.
    elementBinding

    the web element locator binding

  26. def getLocatorBinding(element: String): LocatorBinding

    Gets a web element binding.

    Gets a web element binding.

    element

    the name of the web element

  27. def getPopupMessage: String

    Gets the message of an alert of confirmation popup.

    Gets the message of an alert of confirmation popup.

    returns

    the alert or confirmation message

  28. def getTitle: String

    Gets the title of the current page in the browser.

  29. def handleAlert(accept: Boolean): Unit

    Handles an alert (pop-up)

    Handles an alert (pop-up)

    accept

    true to accept; false to dismiss

  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def highlightElement(element: WebElement): Unit

    Highlights and then un-highlights a browser element.

    Highlights and then un-highlights a browser element. Uses pure javascript, as suggested by https://github.com/alp82. The duration of the highlight lasts for gwen.web.throttle.msecs. The look and feel of the highlight is controlled by the gwen.web.highlight.style setting.

    element

    the element to highlight

  32. def holdAndClick(modifierKeys: Array[String], clickAction: String, elementBinding: LocatorBinding): Unit
  33. def isDisplayed(webElement: WebElement): Boolean

    Checks if an element is displayed.

  34. def isInViewport(webElement: WebElement): Boolean

    Checks if an element is not in the view port.

  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. def locateAndHighlight(elementBinding: LocatorBinding): Unit

    Locates a web element and highlights it.

    Locates a web element and highlights it.

    elementBinding

    the web element locator binding

  37. lazy val logger: Logger
    Attributes
    protected
    Definition Classes
    LazyLogging
    Annotations
    @transient()
  38. def maximizeWindow(): Unit

    Maximizes the browser window.

  39. def moveToAndCapture(driver: WebDriver, webElement: WebElement): Unit
  40. def navigateTo(url: String): Unit

    Navigates the browser the given URL

    Navigates the browser the given URL

    url

    the URL to navigate to

  41. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  42. def newOrCurrentSession(): Unit

    Starts a new session if there isn't one or stays in the current one.

  43. def noOfSessions(): Int

    Gets the number of open sesions.

  44. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  45. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  46. def performAction(action: String, elementBinding: LocatorBinding): Unit
  47. def performActionInContext(action: String, element: String, context: String): Unit

    Performs and action on a web element in the context of another element.

    Performs and action on a web element in the context of another element.

    action

    description of the action

    element

    the name of the element to perform the action on

    context

    the name of the context element binding to find the element in

  48. def refreshPage(): Unit

    Refreshes the current page.

  49. def reset(): Unit

    Resets the driver context.

  50. def resizeWindow(width: Int, height: Int): Unit

    Resizes the browser window to the given dimensions.

    Resizes the browser window to the given dimensions.

    width

    the width

    height

    the height

  51. def scrollIntoView(webElement: WebElement, scrollTo: ScrollTo.Value): Unit

    Scrolls the given web element into view.

    Scrolls the given web element into view.

    webElement

    the web element to scroll to

    scrollTo

    scroll element into view, options are: top or bottom

  52. def scrollIntoView(elementBinding: LocatorBinding, scrollTo: ScrollTo.Value): Unit

    Scrolls an element into view.

    Scrolls an element into view.

    elementBinding

    the web element locator binding

    scrollTo

    scroll element into view, options are: top or bottom

  53. def selectByIndex(elementBinding: LocatorBinding, index: Int): Unit

    Selects a value in a dropdown (select control) by index.

    Selects a value in a dropdown (select control) by index.

    elementBinding

    the web element locator binding

    index

    the index to select (first index is 0)

  54. def selectByValue(elementBinding: LocatorBinding, value: String): Unit

    Selects a value in a dropdown (select control) by value.

    Selects a value in a dropdown (select control) by value.

    elementBinding

    the web element locator binding

    value

    the value to select

  55. def selectByVisibleText(elementBinding: LocatorBinding, value: String): Unit

    Selects a value in a dropdown (select control) by visible text.

    Selects a value in a dropdown (select control) by visible text.

    elementBinding

    the web element locator binding

    value

    the value to select

  56. def sendKeys(elementBinding: LocatorBinding, keysToSend: Array[String]): Unit
  57. def sendValue(elementBinding: LocatorBinding, value: String, clearFirst: Boolean, sendEnterKey: Boolean): Unit

    Sends a value to a web element (one character at a time).

    Sends a value to a web element (one character at a time).

    elementBinding

    the web element locator binding

    value

    the value to send

    clearFirst

    true to clear field first (if element is a text field)

    sendEnterKey

    true to send the Enter key after sending the value

  58. def startVisualTest(testName: String, viewportSize: Option[RectangleSize]): Unit

    Starts a visual text.

    Starts a visual text.

    testName

    the name of the visual test

    viewportSize

    optional viewport size

  59. def switchToChild(): Unit

    Switches to the child window if one was just opened.

  60. def switchToDefaultContent(): Unit

    Switches to the top window / first frame

  61. def switchToParent(childClosed: Boolean): Unit

    Switches to the parent window.

  62. def switchToSession(session: String): Unit

    Switches the web driver session

    Switches the web driver session

    session

    the name of the session to switch to

  63. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  64. def toString(): String
    Definition Classes
    AnyRef → Any
  65. def tryMoveTo(webElement: WebElement): Unit
  66. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  69. def waitForElementState(elementBinding: LocatorBinding, state: String, negate: Boolean): Unit

    Waits the state of an element.

    Waits the state of an element.

    elementBinding

    the locator binding of the element

    state

    the state to wait for

    negate

    whether or not to negate the check

  70. def waitForText(elementBinding: LocatorBinding): Boolean

    Waits for text to appear in the given web element.

    Waits for text to appear in the given web element.

    elementBinding

    the web element locator binding

  71. def waitUntil(timeoutSecs: Long)(condition: ⇒ Boolean): Unit

    Waits until a given condition is ready for a given number of seconds.

    Waits until a given condition is ready for a given number of seconds. Errors on given timeout out seconds.

    timeoutSecs

    the number of seconds to wait before timing out

    condition

    the boolean condition to wait for (until true)

  72. def waitUntil(condition: ⇒ Boolean): Unit

    Waits for a given condition to be true.

    Waits for a given condition to be true. Errors on time out after "gwen.web.wait.seconds" (default is 10 seconds)

    condition

    the boolean condition to wait for (until true)

  73. def withWebDriver[T](function: (WebDriver) ⇒ T)(implicit takeScreenShot: Boolean = false): Option[T]

    Invokes a function that performs an operation on the current web driver session and conditionally captures the current screenshot if the specified takeScreenShot is true.

    Invokes a function that performs an operation on the current web driver session and conditionally captures the current screenshot if the specified takeScreenShot is true.

    function

    the function to perform

    takeScreenShot

    true to take screenshot after performing the function

Inherited from WebElementLocator

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped