Class HtmlElement
- java.lang.Object
-
- com.axway.ats.uiengine.elements.UiElement
-
- com.axway.ats.uiengine.elements.html.HtmlElement
-
- Direct Known Subclasses:
HiddenHtmlElement,RealHtmlElement
public abstract class HtmlElement extends UiElement
Used to represent generic HTML element (tag). It could be used to work with generic elements likespan,div, etc. Such elements could be located by any HTML attribute including custom ones.Special cases:
- use
_textattribute for finding elements by certain text (in-between tags) - use
_partTextattribute for finding elements by partial match of text in-between tags - use
_inputTypeattribute for locating elements by theirtypeattribute. _inputType is replaced withtypeHTML attribute when generating element''s XPath
-
-
Field Summary
-
Fields inherited from class com.axway.ats.uiengine.elements.UiElement
log, properties
-
-
Constructor Summary
Constructors Constructor Description HtmlElement(UiDriver uiDriver, UiElementProperties properties)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidclick()Simulate mouse click actionabstract voiddoubleClick()Simulate mouse double click actionabstract voiddragAndDropTo(HtmlElement targetElement)Drag and drop an element on top of other elementabstract StringgetAttributeValue(String attribute)Get element attribute valueabstract StringgetCssPropertyValue(String propertyName)Get CSS property valueabstract StringgetTextContent()Get text content of the elementabstract voidmouseOver()Simulate mouse overabstract voidpressEnterKey()Simulate Enter keyabstract voidpressEscapeKey()Simulate Escape keyabstract voidpressSpaceKey()Simulate Space keyabstract voidpressTabKey()Simulate Tab keyabstract voidrightClick()Simulate mouse right click actionabstract voidsetTextContent(String content)Set the content of the element-
Methods inherited from class com.axway.ats.uiengine.elements.UiElement
checkTypeAndRules, getElementProperties, getElementProperty, getPropertyNamesToUseForMatch, getUiDriver, logAction, toString
-
-
-
-
Constructor Detail
-
HtmlElement
public HtmlElement(UiDriver uiDriver, UiElementProperties properties)
-
-
Method Detail
-
getAttributeValue
public abstract String getAttributeValue(String attribute)
Get element attribute value- Returns:
- value of the attribute (style/class/...)
-
getCssPropertyValue
public abstract String getCssPropertyValue(String propertyName)
Get CSS property value- Parameters:
propertyName- CSS property name- Returns:
- the value of the target CSS property
-
getTextContent
public abstract String getTextContent()
Get text content of the element- Returns:
- text content of the element
-
setTextContent
public abstract void setTextContent(String content)
Set the content of the element- Parameters:
content- the new content
-
click
public abstract void click()
Simulate mouse click action
-
doubleClick
public abstract void doubleClick()
Simulate mouse double click action
-
rightClick
public abstract void rightClick()
Simulate mouse right click action
-
mouseOver
public abstract void mouseOver()
Simulate mouse over
-
pressEnterKey
public abstract void pressEnterKey()
Simulate Enter key
-
pressSpaceKey
public abstract void pressSpaceKey()
Simulate Space key
-
pressTabKey
public abstract void pressTabKey()
Simulate Tab key
-
pressEscapeKey
public abstract void pressEscapeKey()
Simulate Escape key
-
dragAndDropTo
public abstract void dragAndDropTo(HtmlElement targetElement)
Drag and drop an element on top of other element- Parameters:
targetElement- the target element
-
-