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, toWaitTime
public void putElementLocation(String name, ByType byType, String value)
WriteLocation
putElementLocation
in interface WriteLocation
name
- 元素名称byType
- 元素定位类型ByType
枚举value
- 元素定位内容public void putElementTempletLocation(String name, ByType byType, String templetId)
WriteTempletLocation
putElementTempletLocation
in interface WriteTempletLocation
name
- 元素名称byType
- 元素定位类型ByType
枚举templetId
- 模板idpublic void putElementType(String name, ElementType elementType)
WriteLocation
putElementType
in interface WriteLocation
name
- 元素名称elementType
- 元素类型(ElementType
枚举)public void putIframeName(String name, String iframeName)
WriteLocation
putIframeName
in interface WriteLocation
name
- 元素名称iframeName
- 元素父窗体名称public void putWaitTime(String name, long waitTime)
WriteLocation
putWaitTime
in interface WriteLocation
name
- 元素名称waitTime
- 元素等待时间public void putTemplet(String templetId, String templetValue)
WriteTempletLocation
putTemplet
in interface WriteTempletLocation
templetId
- 模板idtempletValue
- 模板内容public void putTempletReplaceKey(String name, String templetId, String key, String value)
WriteTempletLocation
putTempletReplaceKey
in interface WriteTempletLocation
name
- 元素名称templetId
- 模板idkey
- 被替换的关键词value
- 替换的内容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 ReadLocation find(String name)
ReadLocation
find
in interface ReadLocation
name
- 元素名称public String getDefaultValue()
ReadElementLimit
getDefaultValue
in interface ReadElementLimit
public void putDefaultValue(String name, String defaultValue)
name
- 元素名称defaultValue
- 元素默认值public boolean isNative()
AppElementLocation
isNative
in interface AppElementLocation
public String getContext()
AppElementLocation
getContext
in interface AppElementLocation
public void putContext(String name, String context)
WriteAppElementLocation
当写入该属性后,则表示该app元素为webview的元素
putContext
in interface WriteAppElementLocation
name
- 元素名称context
- 上下文public long getBeforeTime()
ReadLocation
注意:该方法读取到的时间单位为毫秒
getBeforeTime
in interface ReadLocation
public void putBeforeTime(String name, long beforeTime)
WriteLocation
注意:该方法写入的时间单位为毫秒
putBeforeTime
in interface WriteLocation
name
- 元素名称beforeTime
- 前置等待时间Copyright © 2024. All rights reserved.