org.openqa.selenium.htmlunit
Class HtmlUnitWebElement

java.lang.Object
  extended by org.openqa.selenium.htmlunit.HtmlUnitWebElement
All Implemented Interfaces:
FindsByCssSelector, FindsById, FindsByLinkText, FindsByTagName, FindsByXPath, Locatable, WrapsDriver, SearchContext, WebElement

public class HtmlUnitWebElement
extends Object
implements WrapsDriver, FindsById, FindsByLinkText, FindsByXPath, FindsByTagName, FindsByCssSelector, Locatable, WebElement


Field Summary
protected  com.gargoylesoftware.htmlunit.html.HtmlElement element
           
protected  HtmlUnitDriver parent
           
 
Constructor Summary
HtmlUnitWebElement(HtmlUnitDriver parent, com.gargoylesoftware.htmlunit.html.HtmlElement element)
           
 
Method Summary
protected  void assertElementNotStale()
           
 void clear()
           
 void click()
           
 boolean equals(Object obj)
           
 WebElement findElement(By by)
           
 WebElement findElementByCssSelector(String using)
           
 WebElement findElementById(String id)
           
 WebElement findElementByLinkText(String linkText)
           
 WebElement findElementByPartialLinkText(String linkText)
           
 WebElement findElementByTagName(String name)
           
 WebElement findElementByXPath(String xpathExpr)
           
 List<WebElement> findElements(By by)
           
 List<WebElement> findElementsByCssSelector(String using)
           
 List<WebElement> findElementsById(String id)
           
 List<WebElement> findElementsByLinkText(String linkText)
           
 List<WebElement> findElementsByPartialLinkText(String linkText)
           
 List<WebElement> findElementsByTagName(String name)
           
 List<WebElement> findElementsByXPath(String xpathExpr)
           
 String getAttribute(String name)
           
 Coordinates getCoordinates()
           
 String getCssValue(String propertyName)
           
protected  com.gargoylesoftware.htmlunit.html.HtmlElement getElement()
           
 List<WebElement> getElementsByTagName(String tagName)
           
 Point getLocation()
           
 Point getLocationOnScreenOnceScrolledIntoView()
          Deprecated. To be removed in 2.31. Use getCoordinates() instead
protected  HtmlUnitDriver getParent()
           
 Dimension getSize()
           
 String getTagName()
           
 String getText()
           
 WebDriver getWrappedDriver()
           
 int hashCode()
           
 boolean isDisplayed()
           
 boolean isEnabled()
           
 boolean isSelected()
           
 void sendKeyDownEvent(Keys modifierKey)
           
 void sendKeys(CharSequence... value)
           
 void sendKeyUpEvent(Keys modifierKey)
           
 void submit()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected final HtmlUnitDriver parent

element

protected final com.gargoylesoftware.htmlunit.html.HtmlElement element
Constructor Detail

HtmlUnitWebElement

public HtmlUnitWebElement(HtmlUnitDriver parent,
                          com.gargoylesoftware.htmlunit.html.HtmlElement element)
Method Detail

click

public void click()
Specified by:
click in interface WebElement

submit

public void submit()
Specified by:
submit in interface WebElement

clear

public void clear()
Specified by:
clear in interface WebElement

sendKeyDownEvent

public void sendKeyDownEvent(Keys modifierKey)

sendKeyUpEvent

public void sendKeyUpEvent(Keys modifierKey)

sendKeys

public void sendKeys(CharSequence... value)
Specified by:
sendKeys in interface WebElement

getTagName

public String getTagName()
Specified by:
getTagName in interface WebElement

getAttribute

public String getAttribute(String name)
Specified by:
getAttribute in interface WebElement

isSelected

public boolean isSelected()
Specified by:
isSelected in interface WebElement

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface WebElement

isDisplayed

public boolean isDisplayed()
Specified by:
isDisplayed in interface WebElement

getLocation

public Point getLocation()
Specified by:
getLocation in interface WebElement

getSize

public Dimension getSize()
Specified by:
getSize in interface WebElement

getText

public String getText()
Specified by:
getText in interface WebElement

getParent

protected HtmlUnitDriver getParent()

getElement

protected com.gargoylesoftware.htmlunit.html.HtmlElement getElement()

getElementsByTagName

public List<WebElement> getElementsByTagName(String tagName)

findElement

public WebElement findElement(By by)
Specified by:
findElement in interface SearchContext
Specified by:
findElement in interface WebElement

findElements

public List<WebElement> findElements(By by)
Specified by:
findElements in interface SearchContext
Specified by:
findElements in interface WebElement

findElementById

public WebElement findElementById(String id)
Specified by:
findElementById in interface FindsById

findElementsById

public List<WebElement> findElementsById(String id)
Specified by:
findElementsById in interface FindsById

findElementsByCssSelector

public List<WebElement> findElementsByCssSelector(String using)
Specified by:
findElementsByCssSelector in interface FindsByCssSelector

findElementByCssSelector

public WebElement findElementByCssSelector(String using)
Specified by:
findElementByCssSelector in interface FindsByCssSelector

findElementByXPath

public WebElement findElementByXPath(String xpathExpr)
Specified by:
findElementByXPath in interface FindsByXPath

findElementsByXPath

public List<WebElement> findElementsByXPath(String xpathExpr)
Specified by:
findElementsByXPath in interface FindsByXPath

findElementByLinkText

public WebElement findElementByLinkText(String linkText)
Specified by:
findElementByLinkText in interface FindsByLinkText

findElementsByLinkText

public List<WebElement> findElementsByLinkText(String linkText)
Specified by:
findElementsByLinkText in interface FindsByLinkText

findElementByPartialLinkText

public WebElement findElementByPartialLinkText(String linkText)
Specified by:
findElementByPartialLinkText in interface FindsByLinkText

findElementsByPartialLinkText

public List<WebElement> findElementsByPartialLinkText(String linkText)
Specified by:
findElementsByPartialLinkText in interface FindsByLinkText

findElementByTagName

public WebElement findElementByTagName(String name)
Specified by:
findElementByTagName in interface FindsByTagName

findElementsByTagName

public List<WebElement> findElementsByTagName(String name)
Specified by:
findElementsByTagName in interface FindsByTagName

toString

public String toString()
Overrides:
toString in class Object

assertElementNotStale

protected void assertElementNotStale()

getCssValue

public String getCssValue(String propertyName)
Specified by:
getCssValue in interface WebElement

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getWrappedDriver

public WebDriver getWrappedDriver()
Specified by:
getWrappedDriver in interface WrapsDriver

getLocationOnScreenOnceScrolledIntoView

@Deprecated
public Point getLocationOnScreenOnceScrolledIntoView()
Deprecated. To be removed in 2.31. Use getCoordinates() instead

Specified by:
getLocationOnScreenOnceScrolledIntoView in interface Locatable

getCoordinates

public Coordinates getCoordinates()
Specified by:
getCoordinates in interface Locatable


Copyright © 2013. All Rights Reserved.