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
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Returns whether the element exists or not.Returns the firstChild of the element.Returns the result of the evaluated name.booleanReturns the boolean value of the evaluated name.Returns the nextSibling of the element.Returns the parentNode of the element.voidSets the boolean value to the evaluated name.voidSets the number value to the evaluated name.voidSets the string value to the evaluated name.org.openqa.selenium.BytoBy()Returns the element as By element, if possible.Returns the element from this client widget.Methods inherited from class org.zkoss.test.webdriver.ztl.ClientWidget
eval, eval, findElements, isBlank, isEmpty, toLocator, toString, toUpperCaseMethods inherited from class org.openqa.selenium.By
className, cssSelector, equals, findElement, getJavascriptExecutor, getWebDriver, hashCode, id, linkText, name, partialLinkText, tagName, xpath
-
Constructor Details
-
Element
-
Element
-
-
Method Details
-
set
Sets the string value to the evaluated name.For example,
ele.set("style.display", "none");- Parameters:
name- any attribute of the element.
-
set
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
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
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
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
Returns the parentNode of the element. -
firstChild
Returns the firstChild of the element. -
nextSibling
Returns the nextSibling of the element.- Since:
- 2.0.0
-
exists
public boolean exists()Returns whether the element exists or not. -
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
-