org.fluentlenium.core.domain
Class FluentWebElement

java.lang.Object
  extended by org.fluentlenium.core.domain.FluentWebElement
All Implemented Interfaces:
FluentDefaultActions<FluentWebElement>, SearchActions

public class FluentWebElement
extends Object
implements FluentDefaultActions<FluentWebElement>, SearchActions

WebElementCustom include a Selenium WebElement. It provides a lot of shortcuts to make selenium more fluent


Constructor Summary
FluentWebElement(org.openqa.selenium.WebElement webElement)
           
 
Method Summary
 FluentWebElement clear()
          Clear the element
 FluentWebElement click()
          Click on the element
 FluentWebElement doubleClick()
          Double Click on the element
 FluentList find(String name, Filter... filters)
          find elements into the childs with the corresponding filters
 FluentWebElement find(String name, Integer number, Filter... filters)
          find elements into the childs with the corresponding filters at the given positiokn
 FluentWebElement findFirst(String name, Filter... filters)
          find elements into the childs with the corresponding filters at the first position
 String getAttribute(String attribute)
          return any value of custom attribute (generated=true will return "true" if getAttribute("generated") is called.
 org.openqa.selenium.WebElement getElement()
          return the webElement
 String getId()
          return the id of the elements
 String getName()
          return the name of the element
 org.openqa.selenium.Dimension getSize()
          return the size of the elements
 String getTagName()
          return the tag name
 String getText()
          return the text of the element
 String getValue()
          return the value of the elements
 String html()
          return the innerHTML content of the web element does not work with HTMLUnit
 boolean isDisplayed()
          return true if the element is displayed, otherway return false
 boolean isEnabled()
          return true if the element is enabled, otherway return false
 boolean isSelected()
          return true if the element is selected, otherway false
 FluentWebElement submit()
          Submit the element
 FluentWebElement text(String... text)
          Set the text elelent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FluentWebElement

public FluentWebElement(org.openqa.selenium.WebElement webElement)
Method Detail

click

public FluentWebElement click()
Click on the element

Specified by:
click in interface FluentDefaultActions<FluentWebElement>

doubleClick

public FluentWebElement doubleClick()
Double Click on the element


clear

public FluentWebElement clear()
Clear the element


submit

public FluentWebElement submit()
Submit the element

Specified by:
submit in interface FluentDefaultActions<FluentWebElement>

text

public FluentWebElement text(String... text)
Set the text elelent

Specified by:
text in interface FluentDefaultActions<FluentWebElement>
Parameters:
text -

getName

public String getName()
return the name of the element

Returns:

getAttribute

public String getAttribute(String attribute)
return any value of custom attribute (generated=true will return "true" if getAttribute("generated") is called.

Parameters:
attribute -
Returns:

getId

public String getId()
return the id of the elements

Returns:

getText

public String getText()
return the text of the element

Returns:

getValue

public String getValue()
return the value of the elements

Returns:

isDisplayed

public boolean isDisplayed()
return true if the element is displayed, otherway return false

Returns:

isEnabled

public boolean isEnabled()
return true if the element is enabled, otherway return false

Returns:

isSelected

public boolean isSelected()
return true if the element is selected, otherway false

Returns:

getTagName

public String getTagName()
return the tag name

Returns:

getElement

public org.openqa.selenium.WebElement getElement()
return the webElement

Returns:

getSize

public org.openqa.selenium.Dimension getSize()
return the size of the elements

Returns:

find

public FluentList find(String name,
                       Filter... filters)
find elements into the childs with the corresponding filters

Specified by:
find in interface SearchActions
Parameters:
name -
filters -
Returns:

find

public FluentWebElement find(String name,
                             Integer number,
                             Filter... filters)
find elements into the childs with the corresponding filters at the given positiokn

Specified by:
find in interface SearchActions
Parameters:
name -
filters -
Returns:

findFirst

public FluentWebElement findFirst(String name,
                                  Filter... filters)
find elements into the childs with the corresponding filters at the first position

Specified by:
findFirst in interface SearchActions
Parameters:
name -
filters -
Returns:

html

public String html()
return the innerHTML content of the web element does not work with HTMLUnit

Returns:
the underlying html content


Copyright © 2012 AConsulting. All Rights Reserved.