public class JsonLocation extends AbstractLocation implements ReadElementLimit, AppElementLocation
文件名:JsonLocation.java
用途: 用于读取以json形式存储的元素定位信息
编码时间:2020年10月28日上午8:24:56
修改时间:2021年4月17日 上午11:20:56
Modifier and Type | Field and Description |
---|---|
static String |
KEY_BEFORE_TIME_VALUE
指向json中的元素前置等待时间key值
|
static String |
KEY_CONTEXT_VALUE
指向json中的元素与app相关的上下文key值
|
static String |
KEY_DEFAULT_VALUE
指向json中的元素默认值的key值
|
static String |
KEY_ELEMENT
指向json中的元素key值
|
static String |
KEY_IFRAME
指向json中的元素所在窗体key值
|
static String |
KEY_LOCATION
指向json中的元素定位方式key值
|
static String |
KEY_TEMP
指向json中的元素定位模板key值
|
static String |
KEY_TEMPLETE
指向json中的模板key值
|
static String |
KEY_TYPE
指向json中的元素定位类型key值
|
static String |
KEY_VALUE
指向json中的元素定位模板key值
|
static String |
KEY_WAIT
指向json中的元素等待时间key值
|
END_SIGN, name, placeholder, START_SIGN
Constructor and Description |
---|
JsonLocation(File jsonTextFile)
通过写在文件中的json文本类对象对类进行构造
|
JsonLocation(String jsonText)
通过json文本对类进行构造
|
Modifier and Type | Method and Description |
---|---|
protected void |
analysisJson(String text)
用于将读取到的json进行转换,分离模板json与元素json
|
ReadLocation |
find(String name)
用于预读元素信息,并将元素信息进行缓存,以便于快速查找元素信息
|
long |
getBeforeTime()
用于返回元素的前置等待时间
|
String |
getContext()
用于返回当前元素的所在的上下文内容
|
String |
getDefaultValue()
用于读取元素的默认值
|
String |
getElementJson()
返回获取的元素json内容
|
ArrayList<ElementLocationInfo> |
getElementLocation()
用于返回元素的定位信息
|
ElementType |
getElementType()
用于返回元素的类型
|
ArrayList<String> |
getIframeNameList()
用于返回元素的所有父窗体名称集合
|
String |
getTempletJson()
返回获取的模板json内容
|
long |
getWaitTime()
用于返回元素的等待时间
|
boolean |
isNative()
用于返回当前元素是否为app原生元素
|
addReplaceFunction, addReplaceWord, getEndElementPlaceholder, getPlaceholder, getStartElementPlaceholder, setElementPlaceholder, toElementType, toWaitTime
public static final String KEY_TEMPLETE
public static final String KEY_ELEMENT
public static final String KEY_LOCATION
public static final String KEY_TEMP
public static final String KEY_VALUE
public static final String KEY_TYPE
public static final String KEY_WAIT
public static final String KEY_DEFAULT_VALUE
public static final String KEY_IFRAME
public static final String KEY_CONTEXT_VALUE
public static final String KEY_BEFORE_TIME_VALUE
public JsonLocation(File jsonTextFile)
jsonTextFile
- 存储json的文件类对象public JsonLocation(String jsonText)
jsonText
- json文本public String getTempletJson()
public String getElementJson()
protected void analysisJson(String text)
text
- json文本UndefinedElementException
- json中无元素信息时抛出的异常public ReadLocation find(String name)
ReadLocation
find
in interface ReadLocation
name
- 元素名称public long getWaitTime()
ReadLocation
getWaitTime
in interface ReadLocation
public ArrayList<String> getIframeNameList()
ReadLocation
getIframeNameList
in interface ReadLocation
public ElementType getElementType()
ReadLocation
getElementType
in interface ReadLocation
ElementType
枚举)public ArrayList<ElementLocationInfo> getElementLocation()
ReadLocation
getElementLocation
in interface ReadLocation
public String getDefaultValue()
ReadElementLimit
getDefaultValue
in interface ReadElementLimit
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.