Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 SUT 中有这个字符串'LOAD' button,然后我试图使用命令查找脚本中是否存在这个文本,ImageFound(text:"'LOAD' button)但它总是返回错误。我能够找到单词 LOAD 本身,但是当我在它周围添加撇号时,结果不正确。
'LOAD' button
ImageFound(text:"'LOAD' button)
如果LOAD当您需要与其交互时,该字符串在 SUT 中是唯一的,则没有理由搜索完整的字符串'LOAD' button。您可以在一定程度上从 string (目标的子字符串)的存在中推断出LOAD您的目标字符串确实存在。
LOAD
除了数据之外,对 UI 文本的内容进行断言通常不是一个好习惯。任何静态字符串都可以在呈现 UI 之前、在单元测试或其他比 Eggplant 更轻量级的测试方案中进行验证。