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
_text
attribute for finding elements by certain text (in-between tags) - use
_partText
attribute for finding elements by partial match of text in-between tags - use
_inputType
attribute for locating elements by theirtype
attribute. _inputType is replaced withtype
HTML 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 void
click()
Simulate mouse click actionabstract void
doubleClick()
Simulate mouse double click actionabstract void
dragAndDropTo(HtmlElement targetElement)
Drag and drop an element on top of other elementabstract String
getAttributeValue(String attribute)
Get element attribute valueabstract String
getCssPropertyValue(String propertyName)
Get CSS property valueabstract String
getTextContent()
Get text content of the elementabstract void
mouseOver()
Simulate mouse overabstract void
pressEnterKey()
Simulate Enter keyabstract void
pressEscapeKey()
Simulate Escape keyabstract void
pressSpaceKey()
Simulate Space keyabstract void
pressTabKey()
Simulate Tab keyabstract void
rightClick()
Simulate mouse right click actionabstract void
setTextContent(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
-
-