Properties

$id

$id : string

Type

string

Methods

__construct()

__construct(\RemoteExecuteMethod  $executor, string  $id) 

Parameters

\RemoteExecuteMethod $executor
string $id

clear()

clear() : \RemoteWebElement

If this element is a TEXTAREA or text INPUT element, this will clear the value.

Returns

\RemoteWebElement —

The current instance.

click()

click() : \RemoteWebElement

Click this element.

Returns

\RemoteWebElement —

The current instance.

findElement()

findElement(\WebDriverBy  $by) : \RemoteWebElement

Find the first WebDriverElement within this element using the given mechanism.

Parameters

\WebDriverBy $by

Returns

\RemoteWebElement —

NoSuchElementException is thrown in HttpCommandExecutor if no element is found.

findElements()

findElements(\WebDriverBy  $by) : array<mixed,\RemoteWebElement>

Find all WebDriverElements within this element using the given mechanism.

Parameters

\WebDriverBy $by

Returns

array<mixed,\RemoteWebElement> —

A list of all WebDriverElements, or an empty array if nothing matches

getAttribute()

getAttribute(string  $attribute_name) : string

Get the value of a the given attribute of the element.

Parameters

string $attribute_name

The name of the attribute.

Returns

string —

The value of the attribute.

getCSSValue()

getCSSValue(string  $css_property_name) : string

Get the value of a given CSS property.

Parameters

string $css_property_name

The name of the CSS property.

Returns

string —

The value of the CSS property.

getLocation()

getLocation() : \WebDriverPoint

Get the location of element relative to the top-left corner of the page.

Returns

\WebDriverPoint —

The location of the element.

getLocationOnScreenOnceScrolledIntoView()

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.

Returns

\WebDriverPoint —

The location of the element.

getSize()

getSize() : \WebDriverDimension

Get the size of element.

Returns

\WebDriverDimension —

The dimension of the element.

getTagName()

getTagName() : string

Get the tag name of this element.

Returns

string —

The tag name.

getText()

getText() : string

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

Returns

string —

The visible innerText of this element.

isDisplayed()

isDisplayed() : boolean

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

Returns

boolean

isEnabled()

isEnabled() : boolean

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

Returns

boolean

isSelected()

isSelected() : boolean

Determine whether or not this element is selected or not.

Returns

boolean

sendKeys()

sendKeys(mixed  $value) : \RemoteWebElement

Simulate typing into an element, which may set its value.

Parameters

mixed $value

The data to be typed.

Returns

\RemoteWebElement —

The current instance.

setFileDetector()

setFileDetector(\FileDetector  $detector) : \RemoteWebElement

Set the fileDetector in order to let the RemoteWebElement to know that you are going to upload a file.

Bascially, if you want WebDriver trying to send a file, set the fileDector to be LocalFileDetector. Otherwise, keep it UselessFileDetector.

eg. $element->setFileDetector(new LocalFileDetector);

Parameters

\FileDetector $detector

Returns

\RemoteWebElement

submit()

submit() : \RemoteWebElement

If this current element is a form, or an element within a form, then this will be submitted to the remote server.

Returns

\RemoteWebElement —

The current instance.

getID()

getID() : string

Get the opaque ID of the element.

Returns

string —

The opaque ID.

equals()

equals(\WebDriverElement  $other) : boolean

Test if two element IDs refer to the same DOM element.

Parameters

\WebDriverElement $other

Returns

boolean

upload()

upload(string  $local_file) : string

Upload a local file to the server

Parameters

string $local_file

Throws

\WebDriverException

Returns

string —

The remote path of the file.

newElement()

newElement(string  $id) : \RemoteWebElement

Return the WebDriverElement with $id

Parameters

string $id

Returns

\RemoteWebElement