public class SikuliAssertEvent extends SikuliAbstractEvent
文件名:SikuliAssertEvent.java
用途: 封装sikuli工具的断言事件,可设置FindSikuliElement
类对象,用以元素名称来进行操作
注意:通过元素名称对元素进行查找的方式不支持外链词语
编码时间:2022年2月16日 上午8:40:52
修改时间:2022年2月16日 上午8:40:52
Modifier and Type | Class and Description |
---|---|
class |
SikuliAssertEvent.SikuliAssertFailException
文件名:SikuliAssertEvent.java
|
DEFAULT_REGION, find, log, operateTime
Constructor and Description |
---|
SikuliAssertEvent()
构造对象
|
Modifier and Type | Method and Description |
---|---|
boolean |
assertElementsNumber(SikuliElement referencedElement,
CompareNumberType compareNumberType,
SikuliElement comparativeElement)
断言两元素中的数字内容,按照
CompareNumberType 指定的比较类型进行比较。若断言的
元素文本内容存在非数字字符时,则直接断言失败 |
boolean |
assertElementsNumber(String referencedElementName,
CompareNumberType compareNumberType,
String comparativeElementName)
断言两元素中的数字内容,按照
CompareNumberType 指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败 |
boolean |
assertElementsNumber(String referencedElementName,
int referencedIndex,
CompareNumberType compareNumberType,
String comparativeElementName,
int comparativeIndex)
断言两元素中的数字内容,按照
CompareNumberType 指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败 |
boolean |
assertNumber(SikuliElement element,
CompareNumberType compareNumberType,
double compareNumber)
断言元素中的数字内容与指定的数字按照
CompareNumberType 指定的比较类型进行比较。若断言的元素文本内容为非数字字符时,则直接断言失败 |
boolean |
assertNumber(String elementName,
CompareNumberType compareNumberType,
double compareNumber)
断言两元素中的数字内容,按照
CompareNumberType 指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败 |
boolean |
assertNumber(String elementName,
int index,
CompareNumberType compareNumberType,
double compareNumber)
断言两元素中的数字内容,按照
CompareNumberType 指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败 |
boolean |
assertTextContainKey(SikuliElement element,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextContainKey(String, boolean, String...) |
boolean |
assertTextContainKey(String elementName,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextContainKey(String, boolean, String...) |
boolean |
assertTextContainKey(String elementName,
int index,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextContainKey(String, boolean, String...) |
boolean |
assertTextNotContainKey(SikuliElement element,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中不包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextNotContainKey(String, boolean, String...) |
boolean |
assertTextNotContainKey(String elementName,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中不包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextNotContainKey(String, boolean, String...) |
boolean |
assertTextNotContainKey(String elementName,
int index,
boolean isJudgeAllKey,
String... keys)
断言元素的文本内容中不包含指定的关键词。可设置元素的文本内容是否需要判断传入的所有关键词,其用法可参考
AssertStringUtil.assertTextNotContainKey(String, boolean, String...) |
void |
setOcrEvent(SikuliOcrEvent ocr)
该方法用于设置使用自定义配置的ocr事件类对象
|
void |
setThrowException(boolean isThrowException)
该方法用于设置当断言失败时,是否抛出
SikuliAssertEvent.SikuliAssertFailException 异常 |
actionOperate, recordLog, setFindElementTool, setLogRecordTool, setOperateTime
public void setThrowException(boolean isThrowException)
SikuliAssertEvent.SikuliAssertFailException
异常isThrowException
- 断言是否是否抛出异常public void setOcrEvent(SikuliOcrEvent ocr)
ocr
- ocr事件类对象public boolean assertTextContainKey(SikuliElement element, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextContainKey(String, boolean, String...)
element
- 元素类对象isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertTextContainKey(String elementName, int index, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextContainKey(String, boolean, String...)
elementName
- 元素名称index
- 多元素时的下标,允许传入负数,参考FindSikuliElement.findElement(String, int, String...)
方法isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertTextContainKey(String elementName, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextContainKey(String, boolean, String...)
elementName
- 元素名称isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertTextNotContainKey(SikuliElement element, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextNotContainKey(String, boolean, String...)
element
- 元素类对象isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertTextNotContainKey(String elementName, int index, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextNotContainKey(String, boolean, String...)
elementName
- 元素名称index
- 多元素时的下标,允许传入负数,参考FindSikuliElement.findElement(String, int, String...)
方法isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertTextNotContainKey(String elementName, boolean isJudgeAllKey, String... keys)
AssertStringUtil.assertTextNotContainKey(String, boolean, String...)
elementName
- 元素名称isJudgeAllKey
- 是否需要完全判断所有关键词keys
- 关键词组ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertElementsNumber(SikuliElement referencedElement, CompareNumberType compareNumberType, SikuliElement comparativeElement)
CompareNumberType
指定的比较类型进行比较。若断言的
元素文本内容存在非数字字符时,则直接断言失败referencedElement
- 参考元素compareNumberType
- 比较方式CompareNumberType
枚举类comparativeElement
- 比较元素OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertElementsNumber(String referencedElementName, int referencedIndex, CompareNumberType compareNumberType, String comparativeElementName, int comparativeIndex)
CompareNumberType
指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败referencedElementName
- 参考元素名称referencedIndex
- 多元素时的下标,允许传入负数,参考FindSikuliElement.findElement(String, int, String...)
方法compareNumberType
- 比较方式CompareNumberType
枚举类comparativeElementName
- 比较元素名称comparativeIndex
- 多元素时的下标,允许传入负数,参考FindSikuliElement.findElement(String, int, String...)
方法ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertElementsNumber(String referencedElementName, CompareNumberType compareNumberType, String comparativeElementName)
CompareNumberType
指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败referencedElementName
- 参考元素名称compareNumberType
- 比较方式CompareNumberType
枚举类comparativeElementName
- 比较元素名称ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertNumber(SikuliElement element, CompareNumberType compareNumberType, double compareNumber)
CompareNumberType
指定的比较类型进行比较。若断言的元素文本内容为非数字字符时,则直接断言失败element
- Element
对象compareNumberType
- 比较方式CompareNumberType
枚举类compareNumber
- 预期数字OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertNumber(String elementName, int index, CompareNumberType compareNumberType, double compareNumber)
CompareNumberType
指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败elementName
- 参考元素名称index
- 多元素时的下标,允许传入负数,参考FindSikuliElement.findElement(String, int, String...)
方法compareNumberType
- 比较方式CompareNumberType
枚举类compareNumber
- 预期数字ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常public boolean assertNumber(String elementName, CompareNumberType compareNumberType, double compareNumber)
CompareNumberType
指定的比较类型进行比较。若断言的元素文本内容存在非数字字符时,则直接断言失败elementName
- 参考元素名称compareNumberType
- 比较方式CompareNumberType
枚举类compareNumber
- 预期数字ElementOperateException
- 未指定元素查找类时,抛出的异常TimeoutException
- 元素查找超时时,抛出的异常OperateTimeoutException
- 操作超时时,抛出的异常Copyright © 2024. All rights reserved.