android - Android UI 自动化测试 WebView perform(webKeys("mockString")) 不起作用
问题描述
onWebView()
.withElement(findElement(Locator.XPATH,"//*the_corect_path"))
.perform(clearElement())
.perform(webKeys("mock_string"))
onWebView()
.withElement(findElement(Locator.XPATH,"//*the_corect_path"))
.check(webMatches(getText(), containsString("mock_string")))
在执行(webKeys(“mock_string”))之后,它在正确的输入中显示“mock_string”,但是,为什么上面的代码会抛出异常:
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'a string containing "mock_string"' doesn't match:
Expected: a string containing "mock_string"
Got: ""
解决方案
推荐阅读
- regex - 你怎么能要求一个未确定的字符在 Ruby Treetop 中连续重复一定次数?
- extjs - 如何访问在 extjs 控制器中创建的商店?
- opencv - 当图像沿 z 方向倾斜时,SIFT 不起作用,有什么办法可以使这成为可能吗?
- c# - 如何创建播放视频的激活过程
- linq - 无法创建类型为“System.DBNull”的常量值。此上下文仅支持原始类型或枚举类型
- batch-file - 存储在变量中时如何正确转义多行输出加 FOR 加 %PROGRAMFILES(X86)% 加管道
- python - 从另一个文件更改字典中的值
- asp.net - 如何以相对于 asp.net 身份核心 v2.2.1 的格式对密码进行哈希处理
- angular - 使用角度 httpClient 发布文本时如何删除标题?
- android - 树莓派 4 是否支持 Android Things?