Class Widget

java.lang.Object
org.openqa.selenium.By
org.zkoss.test.webdriver.ztl.ClientWidget
org.zkoss.test.webdriver.ztl.Widget

public class Widget extends ClientWidget
A simulator of the ZK client widget.
Author:
jumperchen
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.openqa.selenium.By

    org.openqa.selenium.By.ByClassName, org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ById, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByName, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath, org.openqa.selenium.By.Remotable
  • Field Summary

    Fields inherited from class org.zkoss.test.webdriver.ztl.ClientWidget

    _out
  • Constructor Summary

    Constructors
    Constructor
    Description
    Widget(String uuid)
     
     
    Widget(StringBuffer out, String script)
     
    Widget(Element element)
     
    Widget(JQuery jquery)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    $f(String id)
    Returns the fellow of the widget from the given id.
    $n()
    Returns the element of the widget.
    $n(String subname)
    Returns the sub-element of the widget from the given sub-name.
    $o()
    Returns the id-space-owner of the widget.
    void
    Detaches the widget
    boolean
    Returns whether the widget exists or not.
    Returns the first child of the widget.
    get(String name)
    Returns the value of the evaluated name.
    Returns the child of the widget from the given name.
    id()
    Returns the id of the widget.
    boolean
    is(String name)
    Returns the boolean value of the evaluated name.
    Returns the last child of the widget.
    int
    Returns the size of the children.
    Returns the next sibling of the widget.
    Returns the previous sibling of the widget.
    void
    set(String name, boolean value)
    Sets the boolean value to the evaluated name.
    void
    set(String name, int value)
    Sets the number value to the evaluated name.
    void
    set(String name, String value)
    Sets the string value to the evaluated name.
    org.openqa.selenium.By
    Returns the element as By element, if possible.
    Returns the element from this client widget.
    Returns the uuid of the widget.

    Methods inherited from class org.zkoss.test.webdriver.ztl.ClientWidget

    eval, eval, findElements, isBlank, isEmpty, toLocator, toString, toUpperCase

    Methods inherited from class org.openqa.selenium.By

    className, cssSelector, equals, findElement, getJavascriptExecutor, getWebDriver, hashCode, id, linkText, name, partialLinkText, tagName, xpath

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • set

      public void set(String name, boolean value)
      Sets the boolean value to the evaluated name.

      For example,

      listitem.set("selected", true);

      Parameters:
      name - any allowed property of the widget.
      value - true or false.
    • set

      public void set(String name, int value)
      Sets the number value to the evaluated name.

      For example,

      listbox.set("rows", 12);

      Parameters:
      name - any allowed property of the widget.
      value - any number.
    • set

      public void set(String name, String value)
      Sets the string value to the evaluated name.

      For example,

      grid.set("width", "100px");

      Parameters:
      name - any allowed property of the widget.
    • uuid

      public String uuid()
      Returns the uuid of the widget.
    • id

      public String id()
      Returns the id of the widget.
    • get

      public String get(String name)
      Returns the value of the evaluated name.

      For example,
      grid.get("width");
      in JavaScript
      grid.getWidth();

      Parameters:
      name - any allowed property of the widget.
    • is

      public boolean is(String name)
      Returns the boolean value of the evaluated name.

      For example,
      grid.is("vflex");
      in JavaScript
      grid.isVflex();

      Parameters:
      name - any allowed property of the widget.
    • getChild

      public Widget getChild(String name)
      Returns the child of the widget from the given name.

      For example,

      Widget rows = grid.getChild("rows");

    • nChildren

      public int nChildren()
      Returns the size of the children.
    • lastChild

      public Widget lastChild()
      Returns the last child of the widget.
    • firstChild

      public Widget firstChild()
      Returns the first child of the widget.
    • nextSibling

      public Widget nextSibling()
      Returns the next sibling of the widget.
    • previousSibling

      public Widget previousSibling()
      Returns the previous sibling of the widget.
    • $f

      public Widget $f(String id)
      Returns the fellow of the widget from the given id.
    • $o

      public Widget $o()
      Returns the id-space-owner of the widget.
    • $n

      public Element $n()
      Returns the element of the widget.
    • $n

      public Element $n(String subname)
      Returns the sub-element of the widget from the given sub-name.
    • toElement

      public Element toElement()
      Description copied from class: ClientWidget
      Returns the element from this client widget.
      Specified by:
      toElement in class ClientWidget
    • detach

      public void detach()
      Detaches the widget
    • exists

      public boolean exists()
      Returns whether the widget exists or not.
    • toBy

      public org.openqa.selenium.By toBy()
      Description copied from class: ClientWidget
      Returns the element as By element, if possible.
      Specified by:
      toBy in class ClientWidget