org.openqa.selenium
Interface RenderedWebElement

All Superinterfaces:
SearchContext, WebElement

public interface RenderedWebElement
extends WebElement


Method Summary
 void dragAndDropBy(int moveRightBy, int moveDownBy)
          Drag and drop
 void dragAndDropOn(RenderedWebElement element)
          Drag and drop this element on top of the specified element
 java.awt.Point getLocation()
          Where on the page is the top left-hand corner of the rendered element?
 java.awt.Dimension getSize()
          What is the width and height of the rendered element?
 java.lang.String getValueOfCssProperty(java.lang.String propertyName)
          Get the value of a given CSS property.
 void hover()
          Simulate hovering the mouse over an element.
 boolean isDisplayed()
          Is this element displayed or not?
 
Methods inherited from interface org.openqa.selenium.WebElement
clear, click, findElement, findElements, getAttribute, getTagName, getText, getValue, isEnabled, isSelected, sendKeys, setSelected, submit, toggle
 

Method Detail

isDisplayed

boolean isDisplayed()
Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute.

Returns:
Whether or not the element is displayed

getLocation

java.awt.Point getLocation()
Where on the page is the top left-hand corner of the rendered element?

Returns:
A point, containing the location of the top left-hand corner of the element

getSize

java.awt.Dimension getSize()
What is the width and height of the rendered element?

Returns:
The size of the element on the page.

hover

void hover()
Simulate hovering the mouse over an element. Note that this method needs native events in order to work as expected.


dragAndDropBy

void dragAndDropBy(int moveRightBy,
                   int moveDownBy)
Drag and drop

Parameters:
moveRightBy - how much to move to the right (negative for moving left)
moveDownBy - how much to move to the bottom (negative for moving up)

dragAndDropOn

void dragAndDropOn(RenderedWebElement element)
Drag and drop this element on top of the specified element

Parameters:
element - element to be dropped on. Only RenderedElement is supported

getValueOfCssProperty

java.lang.String getValueOfCssProperty(java.lang.String propertyName)
Get the value of a given CSS property. This is probably not going to return what you expect it to unless you've already had a look at the element using something like firebug. Seriously, even then you'll be lucky for this to work cross-browser. Colour values should be returned as hex strings, so, for example if the "background-color" property is set as "green" in the HTML source, the returned value will be "#008000"

Parameters:
propertyName -
Returns:
The current, computed value of the property.


Copyright © 2009. All Rights Reserved.