TucoTuco.Element

This module handles calls directed at specific DOM elements.

They all take an WebDriver.Element.Reference record as the first argument. The WebDriver.Element.Reference is supposed to be an opaque data type and is not meant to be manipulated.

Elements are associated with a particular session and have no meaning outside that WedDriver session.

Accessing an element that does not exist on the page will return a response of { :stale_element_reference, response }

All the command functions will return {:ok, response} or {error, response} where error is one of those listed in WebDriver.Error.

Functions summary

attribute(element, attribute_name)

Returns the value of the given element's attribute.

clear(element)

Clears the specified form field or textarea element.

click(element)

Click on the specified element.

css(element, property_name)

Get the computed value of an element's CSS property. https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/css/:propertyName

displayed?(element)

Returns a boolean denoting if the element is currently visible.

enabled?(element)

Returns a boolean denoting if the element is enabled or not.

equals?(element, other_element)

Determine if two element ids refer to the same DOM element.

location(element)

Returns the current location of the specified element in pixels from the top left corner.

location_in_view(element)

Determine an element's location once it has been scrolled into view.

name(element)

Get the name of the specified element.

selected?(element)

Returns a boolean denoting if the element is selected or not. Returns :elementnotselectable if it is not able to be selected.

size(element)

Returns size in pixels of the specified element.

submit(element)

Submit a FORM element. May be applied to any descendent of a FORM element.

text(element)

Retreives the visible text of the element. Returns a string.

value(element, value)

Send a list of keystrokes to the specified element.

Functions

attribute(element, attribute_name)

clear(element)

css(element, property_name)

Get the computed value of an element's CSS property. https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/css/:propertyName

Returns a string.

displayed?(element)

enabled?(element)

equals?(element, other_element)

location(element)

Returns the current location of the specified element in pixels from the top left corner.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/location

Returns [x: x, y: y]

location_in_view(element)

Determine an element's location once it has been scrolled into view.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/location_in_view

Returns [x: x, y: y]

selected?(element)

Returns a boolean denoting if the element is selected or not. Returns :elementnotselectable if it is not able to be selected.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/selected

size(element)

Returns size in pixels of the specified element.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/size

Returns [width: w, height: h]

submit(element)

Submit a FORM element. May be applied to any descendent of a FORM element.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/submit

text(element)

Retreives the visible text of the element. Returns a string.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/text

value(element, value)

Send a list of keystrokes to the specified element.

https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/value

Parameters: [value: String]