public class XmlLocation extends AbstractLocation implements ReadElementLimit, AppElementLocation
文件名:XmlLocation.java
用途:该类用于从指定格式的xml中读取元素信息
注意:
编码时间:2017年9月25日下午4:23:40
修改时间:2021年4月17日 上午11:21:25
Modifier and Type | Field and Description |
---|---|
protected org.dom4j.Element |
element
缓存元素信息
|
END_SIGN, name, placeholder, START_SIGN
Constructor and Description |
---|
XmlLocation(org.dom4j.Document dom)
根据xml文件的
Document 对象进行构造 |
XmlLocation(File xmlFile)
根据xml文件对象进行构造
|
Modifier and Type | Method and Description |
---|---|
ReadLocation |
find(String name)
用于预读元素信息,并将元素信息进行缓存,以便于快速查找元素信息
|
long |
getBeforeTime()
用于返回元素的前置等待时间
|
String |
getContext()
用于返回当前元素的所在的上下文内容
|
String |
getDefaultValue()
用于读取元素的默认值
|
ArrayList<ElementLocationInfo> |
getElementLocation()
用于返回元素的定位信息
|
ElementType |
getElementType()
用于返回元素的类型
|
ArrayList<String> |
getIframeNameList()
用于返回元素的所有父窗体名称集合
|
long |
getWaitTime()
用于返回元素的等待时间
|
boolean |
isNative()
用于返回当前元素是否为app原生元素
|
addReplaceFunction, addReplaceWord, getEndElementPlaceholder, getPlaceholder, getStartElementPlaceholder, setElementPlaceholder, toElementType, toWaitTime
public XmlLocation(File xmlFile)
xmlFile
- xml文件对象IncorrectFileException
- xml文件有误时抛出的异常public XmlLocation(org.dom4j.Document dom)
Document
对象进行构造dom
- Document
对象public ArrayList<ElementLocationInfo> getElementLocation()
ReadLocation
getElementLocation
in interface ReadLocation
public ElementType getElementType()
ReadLocation
getElementType
in interface ReadLocation
ElementType
枚举)public ArrayList<String> getIframeNameList()
ReadLocation
getIframeNameList
in interface ReadLocation
public long getWaitTime()
ReadLocation
getWaitTime
in interface ReadLocation
public String getDefaultValue()
ReadElementLimit
getDefaultValue
in interface ReadElementLimit
public ReadLocation find(String name)
ReadLocation
find
in interface ReadLocation
name
- 元素名称public boolean isNative()
AppElementLocation
isNative
in interface AppElementLocation
public String getContext()
AppElementLocation
getContext
in interface AppElementLocation
public long getBeforeTime()
ReadLocation
注意:该方法读取到的时间单位为毫秒
getBeforeTime
in interface ReadLocation
Copyright © 2024. All rights reserved.