WebElementWrapper¶
This is a JavaScript wrapper for RemoteWebElement of Selenium .NET library.
For code complete feature use class name WebElementWrapper, e.g.
var /**WebElementWrapper*/element = 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. |
ContextClickAt | Opens context menu for this element. |
DoubleClick | Performs double click on this element. |
DoubleClickAt | Performs double click on this element. |
FindElement | Finds the first descendant element that matches By selector. |
FindElementByClassName | Finds the first descendant element that matches the CSS Class supplied. |
FindElementByCssSelector | Finds the first descendant element matching the specified CSS selector. |
FindElementById | Finds the first descendant element that matches the ID supplied. |
FindElementByLinkText | Finds the first of descendant elements that match the link text supplied. |
FindElementByName | Finds the first of descendant elements that match the name supplied. |
FindElementByPartialLinkText | Finds the first of descendant elements that match the part of the link text supplied. |
FindElementByTagName | Finds the first of descendant elements that match the DOM Tag supplied. |
FindElementByXPath | Finds the first of descendant elements that match the XPath supplied. |
FindElements | Finds a list of descendant elements that match the supplied By object. |
FindElementsByClassName | Finds all decendant elements that match the class name supplied. |
FindElementsByCssSelector | Finds all descendant elements matching the specified CSS selector. |
FindElementsById | Finds all descendant elements that matche the ID supplied. |
FindElementsByLinkText | Finds all descendant elements that match the link text supplied. |
FindElementsByName | Finds all descendant elements that match the name supplied. |
FindElementsByPartialLinkText | Finds all descendant elements that match the part of the link text supplied. |
FindElementsByTagName | Finds all descendant elements that match the DOM Tag supplied. |
FindElementsByXPath | Finds all descendant elements that match the XPath supplied. |
GetAttribute | Gets the value of the specified attribute for this element. |
GetComputedAccessibleLabel | Gets the computed accessible label of this element. |
GetComputedAccessibleRole | Gets the computed accessible role of 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. |
GetDomAttribute | Gets the value of a declared HTML attribute of this element. |
GetDomProperty | Gets the value of a JavaScript property of this element. |
GetEnabled | Gets a value indicating whether or not this element is enabled. |
GetHashCode | Method to get the hash code of the element. |
GetId | Gets internal element id. |
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. |
GetScreenshotIW | Gets screenshot of the element. |
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.
element.Clear()
Click¶
Clicks this element.
element.Click()
ClickAt¶
Clicks this element at the specified location.
element.ClickAt(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | number | Horizontal offset from the top-left corner of the element. |
y | number | Vertical offset from the top-left corner of the element. |
ContextClick¶
Opens context menu for this element.
element.ContextClick()
ContextClickAt¶
Opens context menu for this element. Requires Rapise 8.3+.
element.ContextClickAt(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | number | Horizontal offset from the top-left corner of the element. |
y | number | Vertical offset from the top-left corner of the element. |
DoubleClick¶
Performs double click on this element.
element.DoubleClick()
DoubleClickAt¶
Performs double click on this element. Requires Rapise 8.3+.
element.DoubleClickAt(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | number | Horizontal offset from the top-left corner of the element. |
y | number | Vertical offset from the top-left corner of the element. |
FindElement¶
Finds the first descendant element that matches By selector. Requires Rapise 8.3+.
element.FindElement(by)
Parameters:
Name | Type | Description |
---|---|---|
by | By | By object. |
Returns:
element or null.
FindElementByClassName¶
Finds the first descendant element that matches the CSS Class supplied.
element.FindElementByClassName(className)
Parameters:
Name | Type | Description |
---|---|---|
className | string | CSS class name of the element. |
Returns:
WebElementWrapper: element or null.
FindElementByCssSelector¶
Finds the first descendant element matching the specified CSS selector.
element.FindElementByCssSelector(cssSelector)
Parameters:
Name | Type | Description |
---|---|---|
cssSelector | string | The CSS selector to match. |
Returns:
WebElementWrapper: element ot null.
FindElementById¶
Finds the first descendant element that matches the ID supplied.
WebDriver.FindElementByTagName('section').FindElementById('h3')
Parameters:
Name | Type | Description |
---|---|---|
id | string | ID of the element. |
Returns:
WebElementWrapper: element or null.
FindElementByLinkText¶
Finds the first of descendant elements that match the link text supplied.
element.FindElementByLinkText(linkText)
Parameters:
Name | Type | Description |
---|---|---|
linkText | string | Link text of element. |
Returns:
WebElementWrapper: element or null.
FindElementByName¶
Finds the first of descendant elements that match the name supplied.
element.FindElementByName(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Name of the element on the page. |
Returns:
WebElementWrapper: element or null.
FindElementByPartialLinkText¶
Finds the first of descendant elements that match the part of the link text supplied.
element.FindElementByPartialLinkText(partialLinkText)
Parameters:
Name | Type | Description |
---|---|---|
partialLinkText | string | Part of the link text. |
Returns:
WebElementWrapper: element or null.
FindElementByTagName¶
Finds the first of descendant elements that match the DOM Tag supplied.
element.FindElementByTagName(tagName)
Parameters:
Name | Type | Description |
---|---|---|
tagName | string | DOM tag Name of the element being searched. |
Returns:
WebElementWrapper: element or null.
FindElementByXPath¶
Finds the first of descendant elements that match the XPath supplied.
element.FindElementByXPath(xpath)
Parameters:
Name | Type | Description |
---|---|---|
xpath | string | xpath to the element. |
Returns:
WebElementWrapper: element or null.
FindElements¶
Finds a list of descendant elements that match the supplied By object. Requires Rapise 8.3+.
element.FindElements(by)
Parameters:
Name | Type | Description |
---|---|---|
by | By | By object. |
Returns:
array of elements.
FindElementsByClassName¶
Finds all decendant elements that match the class name supplied.
element.FindElementsByClassName(className)
Parameters:
Name | Type | Description |
---|---|---|
className | string | className of the element. |
Returns:
WebElementWrapper: array of elements.
FindElementsByCssSelector¶
Finds all descendant elements matching the specified CSS selector.
element.FindElementsByCssSelector(cssSelector)
Parameters:
Name | Type | Description |
---|---|---|
cssSelector | string | The CSS selector to match. |
Returns:
WebElementWrapper: array of elements.
FindElementsById¶
Finds all descendant elements that matche the ID supplied.
element.FindElementsById(id)
Parameters:
Name | Type | Description |
---|---|---|
id | string | ID of the element. |
Returns:
WebElementWrapper: array of elements.
FindElementsByLinkText¶
Finds all descendant elements that match the link text supplied.
element.FindElementsByLinkText(linkText)
Parameters:
Name | Type | Description |
---|---|---|
linkText | string | Link text of element. |
Returns:
WebElementWrapper: array of elements.
FindElementsByName¶
Finds all descendant elements that match the name supplied.
element.FindElementsByName(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Name of the element on the page. |
Returns:
WebElementWrapper: array of elements.
FindElementsByPartialLinkText¶
Finds all descendant elements that match the part of the link text supplied.
element.FindElementsByPartialLinkText(partialLinkText)
Parameters:
Name | Type | Description |
---|---|---|
partialLinkText | string | Part of the link text. |
Returns:
WebElementWrapper: array of elements.
FindElementsByTagName¶
Finds all descendant elements that match the DOM Tag supplied.
element.FindElementsByTagName(tagName)
Parameters:
Name | Type | Description |
---|---|---|
tagName | string | DOM tag Name of the element being searched. |
Returns:
WebElementWrapper: array of elements.
FindElementsByXPath¶
Finds all descendant elements that match the XPath supplied.
element.FindElementsByXPath(xpath)
Parameters:
Name | Type | Description |
---|---|---|
xpath | string | xpath to the element. |
Returns:
WebElementWrapper: array of elements.
GetAttribute¶
Gets the value of the specified attribute for this element.
element.GetAttribute(attributeName)
Parameters:
Name | Type | Description |
---|---|---|
attributeName | string | Name of the element attribute. |
GetComputedAccessibleLabel¶
Gets the computed accessible label of this element. Requires Rapise 8.3+.
element.GetComputedAccessibleLabel()
GetComputedAccessibleRole¶
Gets the computed accessible role of this element. Requires Rapise 8.3+.
element.GetComputedAccessibleRole()
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.
element.GetCoordinates()
GetCssValue¶
Gets the value of a CSS property of this element.
element.GetCssValue(propertyName)
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
GetDisplayed¶
Gets a value indicating whether or not this element is displayed.
element.GetDisplayed()
GetDomAttribute¶
Gets the value of a declared HTML attribute of this element. Requires Rapise 8.3+.
element.GetDomAttribute(attributeName)
Parameters:
Name | Type | Description |
---|---|---|
attributeName | string | Name of the declared element attribute. |
GetDomProperty¶
Gets the value of a JavaScript property of this element. Requires Rapise 8.3+.
element.GetDomProperty(propertyName)
Parameters:
Name | Type | Description |
---|---|---|
propertyName | string | Name of the DOM property to read. |
GetEnabled¶
Gets a value indicating whether or not this element is enabled.
element.GetEnabled()
GetHashCode¶
Method to get the hash code of the element.
element.GetHashCode()
GetId¶
Gets internal element id.
element.GetId()
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.
element.GetLocation()
GetLocationOnScreenOnceScrolledIntoView¶
Gets the point where the element would be when scrolled into view.
element.GetLocationOnScreenOnceScrolledIntoView()
GetScreenshotIW¶
Gets screenshot of the element.
element.GetScreenshotIW()
GetSelected¶
Gets a value indicating whether or not this element is selected.
element.GetSelected()
GetSize¶
Gets a 'Size' object containing the height and width of this element.
element.GetSize()
GetTagName¶
Gets the tag name of this element.
element.GetTagName()
GetText¶
Gets the innerText of this element, without any leading or trailing whitespace, and with other whitespace collapsed.
element.GetText()
SelectOptionByText¶
Selects option from select element.
element.SelectOptionByText(option)
Parameters:
Name | Type | Description |
---|---|---|
option |
SendKeys¶
Simulates typing text into the element.
element.SendKeys(text)
Parameters:
Name | Type | Description |
---|---|---|
text |
Submit¶
Submits this element to the web server.
element.Submit()