Package org.zkoss.test.webdriver.ztl
Class Element
- java.lang.Object
-
- org.openqa.selenium.By
-
- org.zkoss.test.webdriver.ztl.ClientWidget
-
- org.zkoss.test.webdriver.ztl.Element
-
public class Element extends ClientWidget
A simulator of DOM element object.- 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 booleanexists()Returns whether the element exists or not.ElementfirstChild()Returns the firstChild of the element.java.lang.Stringget(java.lang.String name)Returns the result of the evaluated name.booleanis(java.lang.String name)Returns the boolean value of the evaluated name.ElementnextSibling()Returns the nextSibling of the element.ElementparentNode()Returns the parentNode of the element.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.-
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, java.lang.String value)Sets the string value to the evaluated name.For example,
ele.set("style.display", "none");- Parameters:
name- any attribute of the element.
-
set
public void set(java.lang.String name, boolean value)Sets the boolean value to the evaluated name.For example,
ele.set("checked", false);- Parameters:
name- any attribute of the element.value- true or false.
-
set
public void set(java.lang.String name, int value)Sets the number value to the evaluated name.For example,
ele.set("style.top", 12);- Parameters:
name- any attribute of the element.value- any number.
-
get
public java.lang.String get(java.lang.String name)
Returns the result of the evaluated name.For example,
ele.get("name");if the ele.name is "myname", the result is "myname" being returned.- Parameters:
name- any attribute of the element.
-
is
public boolean is(java.lang.String name)
Returns the boolean value of the evaluated name.For example,
ele.is("name");if the ele.name is "true", the result is true. Otherwise, false is assumed.- Parameters:
name- any attribute of the element.- Returns:
- if true, the return value is the same as "true".
-
parentNode
public Element parentNode()
Returns the parentNode of the element.
-
firstChild
public Element firstChild()
Returns the firstChild of the element.
-
nextSibling
public Element nextSibling()
Returns the nextSibling of the element.- Since:
- 2.0.0
-
exists
public boolean exists()
Returns whether the element exists or not.
-
toElement
public Element toElement()
Description copied from class:ClientWidgetReturns the element from this client widget.- Specified by:
toElementin classClientWidget
-
toBy
public org.openqa.selenium.By toBy()
Description copied from class:ClientWidgetReturns the element as By element, if possible.- Specified by:
toByin classClientWidget
-
-