Package org.zkoss.test.webdriver.ztl
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Widget$f(java.lang.String id)Returns the fellow of the widget from the given id.Element$n()Returns the element of the widget.Element$n(java.lang.String subname)Returns the sub-element of the widget from the given sub-name.Widget$o()Returns the id-space-owner of the widget.voiddetach()Detaches the widgetbooleanexists()Returns whether the widget exists or not.WidgetfirstChild()Returns the first child of the widget.java.lang.Stringget(java.lang.String name)Returns the value of the evaluated name.WidgetgetChild(java.lang.String name)Returns the child of the widget from the given name.java.lang.Stringid()Returns the id of the widget.booleanis(java.lang.String name)Returns the boolean value of the evaluated name.WidgetlastChild()Returns the last child of the widget.intnChildren()Returns the size of the children.WidgetnextSibling()Returns the next sibling of the widget.WidgetpreviousSibling()Returns the previous sibling of the widget.voidset(java.lang.String name, boolean value)Sets the boolean value to the evaluated name.voidset(java.lang.String name, int value)Sets the number value to the evaluated name.voidset(java.lang.String name, java.lang.String value)Sets the string value to the evaluated name.org.openqa.selenium.BytoBy()Returns the element as By element, if possible.ElementtoElement()Returns the element from this client widget.java.lang.Stringuuid()Returns the uuid of the widget.-
Methods inherited from class org.zkoss.test.webdriver.ztl.ClientWidget
eval, eval, findElements, isBlank, isEmpty, toLocator, toString, toUpperCase
-
-
-
-
Method Detail
-
set
public void set(java.lang.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(java.lang.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(java.lang.String name, java.lang.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 java.lang.String uuid()
Returns the uuid of the widget.
-
id
public java.lang.String id()
Returns the id of the widget.
-
get
public java.lang.String get(java.lang.String name)
Returns the value of the evaluated name.For example,
grid.get("width");
in JavaScriptgrid.getWidth();- Parameters:
name- any allowed property of the widget.
-
is
public boolean is(java.lang.String name)
Returns the boolean value of the evaluated name.For example,
grid.is("vflex");
in JavaScriptgrid.isVflex();- Parameters:
name- any allowed property of the widget.
-
getChild
public Widget getChild(java.lang.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(java.lang.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(java.lang.String subname)
Returns the sub-element of the widget from the given sub-name.
-
toElement
public Element toElement()
Description copied from class:ClientWidgetReturns the element from this client widget.- Specified by:
toElementin classClientWidget
-
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:ClientWidgetReturns the element as By element, if possible.- Specified by:
toByin classClientWidget
-
-