public class NoFileLocation extends AbstractLocation implements WriteLocation, WriteTempletLocation, ReadElementLimit, WriteAppElementLocation, AppElementLocation
文件名:NoFileLocation.java
用途: 提供在不编写元素定位文件的情况下读取元素定位方法,通过该类,可存储一些临时添加的元素定位方式,并在编写脚本过程中进行调用
编码时间:2020年10月29日上午8:38:24
修改时间:2021年4月17日 下午12:21:42
END_SIGN, name, placeholder, START_SIGN| Constructor and Description |
|---|
NoFileLocation()
构造类对象
|
| 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原生元素
|
void |
putBeforeTime(String name,
long beforeTime)
用于设置元素的前置等待时间,多次设置内容时将覆盖上一次设置的内容
|
void |
putContext(String name,
String context)
用于编写app元素的上下文
|
void |
putDefaultValue(String name,
String defaultValue)
用于写入元素的默认值
|
void |
putElementLocation(String name,
ByType byType,
String value)
用于设置元素的定位方式,该内容允许多次设置,将存储多个元素定位方式
|
void |
putElementTempletLocation(String name,
ByType byType,
String templetId)
用于设置元素调用模板的id,该内容允许多次设置,将存储多个元素定位方式模板。若元素名称不存在,则创建元素
|
void |
putElementType(String name,
ElementType elementType)
用于设置元素的类型,多次设置内容时将覆盖上一次设置的内容
|
void |
putIframeName(String name,
String iframeName)
用于设置元素的所有父窗体名称集合,多次设置内容时将覆盖上一次设置的内容
|
void |
putTemplet(String templetId,
String templetValue)
用于设置元素定位模板内容,将根据对模板的id来区分模板,多次设置将覆盖上一次设置的内容
|
void |
putTempletReplaceKey(String name,
String templetId,
String key,
String value)
用于设置元素调用模板时,该内容允许多次设置,将存储多个替换模板的词语。若元素不存在相应的模板,则抛出异常
|
void |
putWaitTime(String name,
long waitTime)
用于设置元素的等待时间,多次设置内容时将覆盖上一次设置的内容
|
addReplaceFunction, addReplaceWord, getEndElementPlaceholder, getPlaceholder, getStartElementPlaceholder, setElementPlaceholder, toElementType, toWaitTimepublic void putElementLocation(String name, ByType byType, String value)
WriteLocationputElementLocation in interface WriteLocationname - 元素名称byType - 元素定位类型ByType枚举value - 元素定位内容public void putElementTempletLocation(String name, ByType byType, String templetId)
WriteTempletLocationputElementTempletLocation in interface WriteTempletLocationname - 元素名称byType - 元素定位类型ByType枚举templetId - 模板idpublic void putElementType(String name, ElementType elementType)
WriteLocationputElementType in interface WriteLocationname - 元素名称elementType - 元素类型(ElementType枚举)public void putIframeName(String name, String iframeName)
WriteLocationputIframeName in interface WriteLocationname - 元素名称iframeName - 元素父窗体名称public void putWaitTime(String name, long waitTime)
WriteLocationputWaitTime in interface WriteLocationname - 元素名称waitTime - 元素等待时间public void putTemplet(String templetId, String templetValue)
WriteTempletLocationputTemplet in interface WriteTempletLocationtempletId - 模板idtempletValue - 模板内容public void putTempletReplaceKey(String name, String templetId, String key, String value)
WriteTempletLocationputTempletReplaceKey in interface WriteTempletLocationname - 元素名称templetId - 模板idkey - 被替换的关键词value - 替换的内容public ArrayList<ElementLocationInfo> getElementLocation()
ReadLocationgetElementLocation in interface ReadLocationpublic ElementType getElementType()
ReadLocationgetElementType in interface ReadLocationElementType枚举)public ArrayList<String> getIframeNameList()
ReadLocationgetIframeNameList in interface ReadLocationpublic long getWaitTime()
ReadLocationgetWaitTime in interface ReadLocationpublic ReadLocation find(String name)
ReadLocationfind in interface ReadLocationname - 元素名称public String getDefaultValue()
ReadElementLimitgetDefaultValue in interface ReadElementLimitpublic void putDefaultValue(String name, String defaultValue)
name - 元素名称defaultValue - 元素默认值public boolean isNative()
AppElementLocationisNative in interface AppElementLocationpublic String getContext()
AppElementLocationgetContext in interface AppElementLocationpublic void putContext(String name, String context)
WriteAppElementLocation当写入该属性后,则表示该app元素为webview的元素
putContext in interface WriteAppElementLocationname - 元素名称context - 上下文public long getBeforeTime()
ReadLocation注意:该方法读取到的时间单位为毫秒
getBeforeTime in interface ReadLocationpublic void putBeforeTime(String name, long beforeTime)
WriteLocation注意:该方法写入的时间单位为毫秒
putBeforeTime in interface WriteLocationname - 元素名称beforeTime - 前置等待时间Copyright © 2024. All rights reserved.