HumHub Documentation (unofficial)

WebDriverElement extends WebDriverSearchContext

Interface for an HTML element in the WebDriver framework.

Table of Contents

Methods

clear()  : WebDriverElement
If this element is a TEXTAREA or text INPUT element, this will clear the value.
click()  : WebDriverElement
Click this element.
findElement()  : WebDriverElement
Find the first WebDriverElement within this element using the given mechanism.
findElements()  : array<string|int, WebDriverElement>
Find all WebDriverElements within this element using the given mechanism.
getAttribute()  : string|null
Get the value of the given attribute of the element.
getCSSValue()  : string
Get the value of a given CSS property.
getID()  : string
Get the opaque ID of the element.
getLocation()  : WebDriverPoint
Get the location of element relative to the top-left corner of the page.
getLocationOnScreenOnceScrolledIntoView()  : WebDriverPoint
Try scrolling the element into the view port and return the location of element relative to the top-left corner of the page afterwards.
getSize()  : WebDriverDimension
Get the size of element.
getTagName()  : string
Get the tag name of this element.
getText()  : string
Get the visible (i.e. not hidden by CSS) innerText of this element, including sub-elements, without any leading or trailing whitespace.
isDisplayed()  : bool
Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute.
isEnabled()  : bool
Is the element currently enabled or not? This will generally return true for everything but disabled input elements.
isSelected()  : bool
Determine whether or not this element is selected or not.
sendKeys()  : WebDriverElement
Simulate typing into an element, which may set its value.
submit()  : WebDriverElement
If this current element is a form, or an element within a form, then this will be submitted to the remote server.

Methods

getAttribute()

Get the value of the given attribute of the element.

public getAttribute(string $attribute_name) : string|null

Attribute is meant what is declared in the HTML markup of the element. To read a value of a IDL "JavaScript" property (like innerHTML), use getDomProperty() method.

Parameters
$attribute_name : string

The name of the attribute.

Return values
string|null

The value of the attribute.

getCSSValue()

Get the value of a given CSS property.

public getCSSValue(string $css_property_name) : string
Parameters
$css_property_name : string

The name of the CSS property.

Return values
string

The value of the CSS property.

getID()

Get the opaque ID of the element.

public getID() : string
Return values
string

The opaque ID.

getLocationOnScreenOnceScrolledIntoView()

Try scrolling the element into the view port and return the location of element relative to the top-left corner of the page afterwards.

public getLocationOnScreenOnceScrolledIntoView() : WebDriverPoint
Return values
WebDriverPoint

The location of the element.

getTagName()

Get the tag name of this element.

public getTagName() : string
Return values
string

The tag name.

getText()

Get the visible (i.e. not hidden by CSS) innerText of this element, including sub-elements, without any leading or trailing whitespace.

public getText() : string
Return values
string

The visible innerText of this element.

isDisplayed()

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

public isDisplayed() : bool
Return values
bool

isEnabled()

Is the element currently enabled or not? This will generally return true for everything but disabled input elements.

public isEnabled() : bool
Return values
bool

isSelected()

Determine whether or not this element is selected or not.

public isSelected() : bool
Return values
bool

        
On this page

Search results