Class WebElementDescription
The Object Description how to identify the Element for Web Application.
Inherited Members
Namespace: AxaFrance.WebEngine.Web
Assembly: AxaFrance.WebEngine.Web.dll
Syntax
public class WebElementDescription : ElementDescription
Constructors
| Improve this Doc View SourceWebElementDescription()
Initialize the Element. If the element is not created within a PageModel, you should use UseDriver(WebDriver) before us the element.
Declaration
public WebElementDescription()
WebElementDescription(WebDriver)
Initialize the ElementDescription with a given WebDriver as contexte to use.
Declaration
public WebElementDescription(WebDriver driver)
Parameters
Type | Name | Description |
---|---|---|
OpenQA.Selenium.WebDriver | driver | WebDriver instance to use. |
Properties
| Improve this Doc View SourceAttributes
Other non-standard HTML Elements
Declaration
public IEnumerable<HtmlAttribute> Attributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<HtmlAttribute> |
ClassName
CSS class name
Declaration
public string ClassName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
---|---|
System.String |
Id
The Id attribute of the HTML element.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String |
InnerText
InnerText of HTML element.
Declaration
public string InnerText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
---|---|
System.Boolean |
LinkText
The Text of a Hyperlink
Declaration
public string LinkText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Name
The Name attribute of the HTML element.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TagName
The HTML Tag name
Declaration
public string TagName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
---|---|
System.String |
Methods
| Improve this Doc View SourceApplyAttribute(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
| Improve this Doc View SourceAsSelect()
Returns an WebElement as OpenQA.Selenium.Support.UI.SelectElement to get more possible operations.
Declaration
public SelectElement AsSelect()
Returns
Type | Description |
---|---|
OpenQA.Selenium.Support.UI.SelectElement | An OpenQA.Selenium.Support.UI.SelectElement object represents an HTML <select> tag. |
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 |
---|---|---|
System.String | value | the value to be checked in current Radiobutton group. |
Returns
Type | Description |
---|---|
OpenQA.Selenium.IWebElement |
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. |
DragAndDropTo(IWebElement)
Drag the current element and drop it to element
.
Declaration
public void DragAndDropTo(IWebElement element)
Parameters
Type | Name | Description |
---|---|---|
OpenQA.Selenium.IWebElement | element | The target element to drop. |
GetInnerHtml()
Gets the InnerHtml of the current element.
Declaration
public string GetInnerHtml()
Returns
Type | Description |
---|---|
System.String | A string representation of InnerHtml the current WebElement |
GetOuterHtml()
Gets the OuterHtml of the current element.
Declaration
public string GetOuterHtml()
Returns
Type | Description |
---|---|
System.String | A string representation of InnerHtml the current WebElement |
InternalClick()
Overrides the default behavior of Click: Scrolling the element into view to avoid ElementClickInterceptedException
Declaration
protected override void InternalClick()
Overrides
| Improve this Doc View SourceInternalFindElement()
Implemente element identifying algorithm, without the need of object synchronization.
Declaration
protected override IWebElement InternalFindElement()
Returns
Type | Description |
---|---|
OpenQA.Selenium.IWebElement | Identified test object. |
Overrides
| Improve this Doc View SourceInternalFindElements()
Implemente element identifying algorithm, without the need of object synchronization.
Declaration
protected override IReadOnlyCollection<IWebElement> InternalFindElements()
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<OpenQA.Selenium.IWebElement> | Identified test objects |
Overrides
| Improve this Doc View SourceInternalGetScreenshot()
Implemente screenshot generation for the current specific element
Declaration
protected override byte[] InternalGetScreenshot()
Returns
Type | Description |
---|---|
System.Byte[] | The screenshot image in RAW Binary data format. |
Overrides
| Improve this Doc View SourceMouseHover()
Simulate a mouse hover on the indicated WebElement.
Declaration
public void MouseHover()
RightClick()
Simulate a mouse right click on the indicated WebElement.
Declaration
public void RightClick()
ScrollIntoView()
Scroll the current element into the visible area.
Declaration
public void ScrollIntoView()
SelectByIndex(Int32)
Select an option from html tag <select> by its displayed text.
Declaration
public void SelectByIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The 0-based index to be selected. |
SelectByText(String)
Select an option from html tag <select> by its displayed text.
Declaration
public void SelectByText(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | the text value to be selected. |
SelectByValue(String)
Select an option from html tag <select> by its value.
Declaration
public void SelectByValue(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | the text value to be selected. |
SetSecure(String)
Set the value of a password textbox
Declaration
public void SetSecure(string encrypted)
Parameters
Type | Name | Description |
---|---|---|
System.String | encrypted | A base64 formatted encrypted data. using default encrptionkey provided in appsetting.json |
ToString()
Shows a string representation of this WebElementDescription
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of this WebElementDescription |