WebElement

This is a JavaScript wrapper for RemoteWebElement of Selenium .NET library. For code complete feature use class name WebElementWrapper, e.g.

var /**WebElementWrapper*/el = WebDriver.FindElementById('username');

Action Summary

Action Description
Clear Clears the content of this element.
Click Clicks this element.
ClickAt Clicks this element at the specified location.
ContextClick Opens context menu for this element.
DoubleClick Performs double click on this element.
FindElementByClassName Finds the first element in the page that matches the CSS Class supplied.
FindElementByCssSelector Finds the first element matching the specified CSS selector.
FindElementById Finds the first element in the page that matches the ID supplied.
FindElementByLinkText Finds the first of elements that match the link text supplied.
FindElementByName Finds the first of elements that match the name supplied.
FindElementByPartialLinkText Finds the first of elements that match the part of the link text supplied.
FindElementByTagName Finds the first of elements that match the DOM Tag supplied.
FindElementByXPath Finds the first of elements that match the XPath supplied.
FindElementsByClassName Finds a list of elements that match the class name supplied.
FindElementsByCssSelector Finds all elements matching the specified CSS selector.
FindElementsById Finds the first element in the page that matches the ID supplied.
FindElementsByLinkText Finds a list of elements that match the link text supplied.
FindElementsByName Finds a list of elements that match the name supplied.
FindElementsByPartialLinkText Finds a list of elements that match the part of the link text supplied.
FindElementsByTagName Finds a list of elements that match the DOM Tag supplied.
FindElementsByXPath Finds a list of elements that match the XPath supplied.
GetAttribute Gets the value of the specified attribute for this element.
GetCoordinates Gets a 'Point' object containing the coordinates of the
upper-left corner of this element relative to the upper-left
corner of the page.
GetCssValue Gets the value of a CSS property of this element.
GetDisplayed Gets a value indicating whether or not this element is displayed.
GetEnabled Gets a value indicating whether or not this element is enabled.
GetHashCode Method to get the hash code of the element.
GetLocation Gets a 'Point' object containing the coordinates of the
upper-left corner of this element relative to the upper-left
corner of the page.
GetLocationOnScreenOnceScrolledIntoView Gets the point where the element would be when scrolled into view.
GetSelected Gets a value indicating whether or not this element is selected.
GetSize Gets a 'Size' object containing the height and width of this element.
GetTagName Gets the tag name of this element.
GetText Gets the innerText of this element, without any leading or
trailing whitespace, and with other whitespace collapsed.
SelectOptionByText Selects option from select element.
SendKeys Simulates typing text into the element.
Submit Submits this element to the web server.

Action Detail

Clear()

Clears the content of this element.

Click()

Clicks this element.

ClickAt(x, y)

Clicks this element at the specified location.

Parameters:

Name Type Description
x number
y number

ContextClick()

Opens context menu for this element.

DoubleClick()

Performs double click on this element.

FindElementByClassName(className)

Finds the first element in the page that matches the CSS Class supplied.

Parameters:

Name Type Description
className string CSS class name of the element.

Returns:

element or null.

FindElementByCssSelector(cssSelector)

Finds the first element matching the specified CSS selector.

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

element ot null.

FindElementById(id)

Finds the first element in the page that matches the ID supplied.

Parameters:

Name Type Description
id string ID of the element.

Returns:

element or null.

FindElementByLinkText(linkText)

Finds the first of elements that match the link text supplied.

Parameters:

Name Type Description
linkText string Link text of element.

Returns:

element or null.

FindElementByName(name)

Finds the first of elements that match the name supplied.

Parameters:

Name Type Description
name string Name of the element on the page.

Returns:

element or null.

FindElementByPartialLinkText(partialLinkText)

Finds the first of elements that match the part of the link text supplied.

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

element or null.

FindElementByTagName(tagName)

Finds the first of elements that match the DOM Tag supplied.

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

Returns:

element or null.

FindElementByXPath(xpath)

Finds the first of elements that match the XPath supplied.

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

element or null.

FindElementsByClassName(className)

Finds a list of elements that match the class name supplied.

Parameters:

Name Type Description
className string className of the element.

Returns:

array of elements.

FindElementsByCssSelector(cssSelector)

Finds all elements matching the specified CSS selector.

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

array of elements.

FindElementsById(id)

Finds the first element in the page that matches the ID supplied.

Parameters:

Name Type Description
id string ID of the element.

Returns:

array of elements.

FindElementsByLinkText(linkText)

Finds a list of elements that match the link text supplied.

Parameters:

Name Type Description
linkText string Link text of element.

Returns:

array of elements.

FindElementsByName(name)

Finds a list of elements that match the name supplied.

Parameters:

Name Type Description
name string Name of the element on the page.

Returns:

array of elements.

FindElementsByPartialLinkText(partialLinkText)

Finds a list of elements that match the part of the link text supplied.

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

array of elements.

FindElementsByTagName(tagName)

Finds a list of elements that match the DOM Tag supplied.

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

Returns:

array of elements.

FindElementsByXPath(xpath)

Finds a list of elements that match the XPath supplied.

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

array of elements.

GetAttribute(attributeName)

Gets the value of the specified attribute for this element.

Parameters:

Name Type Description
attributeName

GetCoordinates()

Gets a 'Point' object containing the coordinates of the upper-left corner of this element relative to the upper-left corner of the page.

GetCssValue(propertyName)

Gets the value of a CSS property of this element.

Parameters:

Name Type Description
propertyName

GetDisplayed()

Gets a value indicating whether or not this element is displayed.

GetEnabled()

Gets a value indicating whether or not this element is enabled.

GetHashCode()

Method to get the hash code of the element.

GetLocation()

Gets a 'Point' object containing the coordinates of the upper-left corner of this element relative to the upper-left corner of the page.

GetLocationOnScreenOnceScrolledIntoView()

Gets the point where the element would be when scrolled into view.

GetSelected()

Gets a value indicating whether or not this element is selected.

GetSize()

Gets a 'Size' object containing the height and width of this element.

GetTagName()

Gets the tag name of this element.

GetText()

Gets the innerText of this element, without any leading or trailing whitespace, and with other whitespace collapsed.

SelectOptionByText(option)

Selects option from select element.

Parameters:

Name Type Description
option

SendKeys(text)

Simulates typing text into the element.

Parameters:

Name Type Description
text

Submit()

Submits this element to the web server.