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.

Clear() 

Click

Clicks this element.

Click() 

ClickAt

Clicks this element at the specified location.

ClickAt(x, y) 

Parameters:

Name Type Description
x number
y number

ContextClick

Opens context menu for this element.

ContextClick() 

DoubleClick

Performs double click on this element.

DoubleClick() 

FindElementByClassName

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

FindElementByClassName(className) 

Parameters:

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

Returns:

element or null.

FindElementByCssSelector

Finds the first element matching the specified CSS selector.

FindElementByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

element ot null.

FindElementById

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

FindElementById(id) 

Parameters:

Name Type Description
id string ID of the element.

Returns:

element or null.

FindElementByLinkText

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

FindElementByLinkText(linkText) 

Parameters:

Name Type Description
linkText string Link text of element.

Returns:

element or null.

FindElementByName

Finds the first of elements that match the name supplied.

FindElementByName(name) 

Parameters:

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

Returns:

element or null.

FindElementByPartialLinkText

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

FindElementByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

element or null.

FindElementByTagName

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

FindElementByTagName(tagName) 

Parameters:

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

Returns:

element or null.

FindElementByXPath

Finds the first of elements that match the XPath supplied.

FindElementByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

element or null.

FindElementsByClassName

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

FindElementsByClassName(className) 

Parameters:

Name Type Description
className string className of the element.

Returns:

array of elements.

FindElementsByCssSelector

Finds all elements matching the specified CSS selector.

FindElementsByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

array of elements.

FindElementsById

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

FindElementsById(id) 

Parameters:

Name Type Description
id string ID of the element.

Returns:

array of elements.

FindElementsByLinkText

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

FindElementsByLinkText(linkText) 

Parameters:

Name Type Description
linkText string Link text of element.

Returns:

array of elements.

FindElementsByName

Finds a list of elements that match the name supplied.

FindElementsByName(name) 

Parameters:

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

Returns:

array of elements.

FindElementsByPartialLinkText

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

FindElementsByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

array of elements.

FindElementsByTagName

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

FindElementsByTagName(tagName) 

Parameters:

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

Returns:

array of elements.

FindElementsByXPath

Finds a list of elements that match the XPath supplied.

FindElementsByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

array of elements.

GetAttribute

Gets the value of the specified attribute for this element.

GetAttribute(attributeName) 

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.

GetCoordinates() 

GetCssValue

Gets the value of a CSS property of this element.

GetCssValue(propertyName) 

Parameters:

Name Type Description
propertyName

GetDisplayed

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

GetDisplayed() 

GetEnabled

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

GetEnabled() 

GetHashCode

Method to get the hash code of the element.

GetHashCode() 

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.

GetLocation() 

GetLocationOnScreenOnceScrolledIntoView

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

GetLocationOnScreenOnceScrolledIntoView() 

GetSelected

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

GetSelected() 

GetSize

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

GetSize() 

GetTagName

Gets the tag name of this element.

GetTagName() 

GetText

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

GetText() 

SelectOptionByText

Selects option from select element.

SelectOptionByText(option) 

Parameters:

Name Type Description
option

SendKeys

Simulates typing text into the element.

SendKeys(text) 

Parameters:

Name Type Description
text

Submit

Submits this element to the web server.

Submit()