Show / Hide Table of Contents

Class WebElementDescription

The Object Description how to identify the Element for Web Application.

Inheritance
Object
ElementDescription
WebElementDescription
Inherited Members
ElementDescription.driver
ElementDescription.UseDriver(WebDriver)
ElementDescription.FindElement()
ElementDescription.FindElement(Int32)
ElementDescription.FindElement(By)
ElementDescription.FindElement(By, Int32)
ElementDescription.Exists()
ElementDescription.Exists(Int32)
ElementDescription.Click()
ElementDescription.Perform(Action)
ElementDescription.Perform(Func<String, IWebElement>, String)
ElementDescription.Perform(Action<String>, String)
ElementDescription.Perform(Action<Int32>, Int32)
ElementDescription.Perform(Func<Boolean>)
ElementDescription.Perform(Func<Byte[]>)
ElementDescription.GetScreenshot()
ElementDescription.Perform(Func<String>)
ElementDescription.Perform(Func<String, String>, String)
ElementDescription.SendKeys(String)
ElementDescription.SetValue(String)
ElementDescription.GetText()
ElementDescription.Value
ElementDescription.IsSelected
ElementDescription.IsEnabled
ElementDescription.IsDisplayed
ElementDescription.Clear()
ElementDescription.GetAttribute(String)
ElementDescription.GetProperty(String)
ElementDescription.FindElements(By)
ElementDescription.FindElements()
ElementDescription.FindElements(Int32)
Namespace: AxaFrance.WebEngine.Web
Assembly: AxaFrance.WebEngine.Web.dll
Syntax
public class WebElementDescription : ElementDescription

Constructors

| Edit this page View Source

WebElementDescription()

Initialize the Element. If the element is not created within a PageModel, you should use UseDriver(WebDriver) before us the element.

Declaration
public WebElementDescription()
| Edit this page View Source

WebElementDescription(WebDriver)

Initialize the ElementDescription with a given WebDriver as contexte to use.

Declaration
public WebElementDescription(WebDriver driver)
Parameters
Type Name Description
WebDriver driver

WebDriver instance to use.

Properties

| Edit this page View Source

Attributes

Other non-standard HTML Elements

Declaration
public IEnumerable<HtmlAttribute> Attributes { get; set; }
Property Value
Type Description
IEnumerable<HtmlAttribute>
| Edit this page View Source

ClassName

CSS class name

Declaration
public string ClassName { get; set; }
Property Value
Type Description
String
| Edit this page View Source

CssSelector

CssSelector of the element. avoid to use CssSelector if other identification method is available.

Declaration
public string CssSelector { get; set; }
Property Value
Type Description
String
| Edit this page View Source

Id

The Id attribute of the HTML element.

Declaration
public string Id { get; set; }
Property Value
Type Description
String
| Edit this page View Source

InnerText

InnerText of HTML element.

Declaration
public string InnerText { get; set; }
Property Value
Type Description
String
| Edit this page View Source

IsVisibleInViewPort

Checks if the WebElement is displayed in the current viewport. This function is based on javascript function getBoundingClientRect(), it may not working on older version (67.0) of Chrome on mobile devices.

Declaration
public bool IsVisibleInViewPort { get; }
Property Value
Type Description
Boolean
| Edit this page View Source

LinkText

The Text of a Hyperlink

Declaration
public string LinkText { get; set; }
Property Value
Type Description
String
| Edit this page View Source

Name

The Name attribute of the HTML element.

Declaration
public string Name { get; set; }
Property Value
Type Description
String
| Edit this page View Source

TagName

The HTML Tag name

Declaration
public string TagName { get; set; }
Property Value
Type Description
String
| Edit this page View Source

XPath

XPath of the element. avoid to use absolute XPATH if another identification method is available.

Declaration
public string XPath { get; set; }
Property Value
Type Description
String

Methods

| Edit this page View Source

ApplyAttribute(FindsByAttribute)

Applies the locator defined in FindsByAttribute. this function is called automatically before InternalFindElements()

Declaration
public override void ApplyAttribute(FindsByAttribute attr)
Parameters
Type Name Description
FindsByAttribute attr
Overrides
ElementDescription.ApplyAttribute(FindsByAttribute)
| Edit this page View Source

AsSelect()

Returns an WebElement as OpenQA.Selenium.Support.UI.SelectElement to get more possible operations.

Declaration
public SelectElement AsSelect()
Returns
Type Description
SelectElement

An OpenQA.Selenium.Support.UI.SelectElement object represents an HTML <select> tag.

| Edit this page View Source

CheckByValue(String)

Checks an RadioButton from a given RadioGroup (used for radio button group, <input type="radio"> elements)

Declaration
public IWebElement CheckByValue(string value)
Parameters
Type Name Description
String value

the value to be checked in current Radiobutton group.

Returns
Type Description
IWebElement
| Edit this page View Source

DragAndDropTo(ElementDescription)

Drag the current element and drop it to element. It may not work on Mobile Devices.

Declaration
public void DragAndDropTo(ElementDescription element)
Parameters
Type Name Description
ElementDescription element

The target element to drop.

| Edit this page View Source

DragAndDropTo(IWebElement)

Drag the current element and drop it to element.

Declaration
public void DragAndDropTo(IWebElement element)
Parameters
Type Name Description
IWebElement element

The target element to drop.

| Edit this page View Source

GetInnerHtml()

Gets the InnerHtml of the current element.

Declaration
public string GetInnerHtml()
Returns
Type Description
String

A string representation of InnerHtml the current WebElement

| Edit this page View Source

GetOuterHtml()

Gets the OuterHtml of the current element.

Declaration
public string GetOuterHtml()
Returns
Type Description
String

A string representation of InnerHtml the current WebElement

| Edit this page View Source

InternalClick()

Overrides the default behavior of Click: Scrolling the element into view to avoid ElementClickInterceptedException

Declaration
protected override void InternalClick()
Overrides
ElementDescription.InternalClick()
| Edit this page View Source

InternalFindElement()

Implemente element identifying algorithm, without the need of object synchronization.

Declaration
protected override IWebElement InternalFindElement()
Returns
Type Description
IWebElement

Identified test object.

Overrides
ElementDescription.InternalFindElement()
| Edit this page View Source

InternalFindElements()

Implemente element identifying algorithm, without the need of object synchronization.

Declaration
protected override IReadOnlyCollection<IWebElement> InternalFindElements()
Returns
Type Description
IReadOnlyCollection<IWebElement>

Identified test objects

Overrides
ElementDescription.InternalFindElements()
| Edit this page View Source

InternalGetScreenshot()

Implemente screenshot generation for the current specific element

Declaration
protected override byte[] InternalGetScreenshot()
Returns
Type Description
Byte[]

The screenshot image in RAW Binary data format.

Overrides
ElementDescription.InternalGetScreenshot()
| Edit this page View Source

MouseHover()

Simulate a mouse hover on the indicated WebElement.

Declaration
public void MouseHover()
| Edit this page View Source

RightClick()

Simulate a mouse right click on the indicated WebElement.

Declaration
public void RightClick()
| Edit this page View Source

ScrollIntoView()

Scroll the current element into the visible area.

Declaration
public void ScrollIntoView()
| Edit this page View Source

SelectByIndex(Int32)

Select an option from html tag <select> by its displayed text.

Declaration
public void SelectByIndex(int index)
Parameters
Type Name Description
Int32 index

The 0-based index to be selected.

| Edit this page View Source

SelectByText(String)

Select an option from html tag <select> by its displayed text.

Declaration
public void SelectByText(string text)
Parameters
Type Name Description
String text

the text value to be selected.

| Edit this page View Source

SelectByValue(String)

Select an option from html tag <select> by its value.

Declaration
public void SelectByValue(string value)
Parameters
Type Name Description
String value

the text value to be selected.

| Edit this page View Source

SetSecure(String)

Set the value of a password textbox

Declaration
public void SetSecure(string encrypted)
Parameters
Type Name Description
String encrypted

A base64 formatted encrypted data. using default encrptionkey provided in appsetting.json

| Edit this page View Source

ToString()

Shows a string representation of this WebElementDescription

Declaration
public override string ToString()
Returns
Type Description
String

A string representation of this WebElementDescription

Overrides
System.Object.ToString()
  • Edit this page
  • View Source
In this article
Back to top Copyright ® 2016-2024 AXA France, All rights reserved.