gpt4 book ai didi

android - AWS Device Farm 上用于 Cordova Android 应用程序的 Calabash,正确的 Web View 名称?

转载 作者:太空狗 更新时间:2023-10-29 14:05:12 25 4
gpt4 key购买 nike

我在尝试为 Cordova 应用程序编写 Calabash 测试时遇到了麻烦。 webView 和 cordovaWebView 在本地或 AWS 上对我不起作用。


当我针对设备运行时在本地运行的代码变体:

Then(/^I entered text "(.*?)" into input with id "(.*?)"$/) do |arg1, arg2|
enter_text("SystemWebView css:'##{arg2}'", arg1)
end

但是,在 AWS 上它给了我这个错误:

map SystemWebView css:'#login-email', 查询失败,因为:java.util.concurrent.ExecutionException: java.lang.ClassCastException: sh.calaba.instrumentationbackend.actions.webview.CalabashChromeClient cannot be cast to org.apache .cordova.engine.SystemWebChromeClient (运行时错误) (运行时错误) ./features/step_definitions/calabash_steps.rb:8:in /^I entered text "(.*?)"into input with id "(.*?)"$/'
features/login.feature:7:in
然后我将文本“test@tester”输入到 ID 为“login-email”的输入中'


我尝试的另一个代码变体,希望它能在 AWS Device Farm 上运行:

Then(/^I entered text "(.*?)" into input with id "(.*?)"$/) do |arg1, arg2|
enter_text("CalabashChromeClient css:'##{arg2}'", arg1)
end

但这也给我一个错误:等待元素超时:CalabashChromeClient css:'#login-email' (Calabash::Android::WaitHelpers::WaitError)


使用 cordovaWebView 时,出现以下错误:

超时等待元素:cordovaWebView css:'#login-email' (Calabash::Android::WaitHelpers::WaitError)


我通过在控制台中尝试找到了在本地运行的正确 webview 名称。说到 AWS Device Farm,我在这里有点盲目,非常感谢你们提供的所有提示/技巧。我也愿意更换测试框架。


 query("*")
[
[0] {
"id" => nil,
"enabled" => true,
"contentDescription" => nil,
"visible" => true,
"tag" => nil,
"description" => "com.android.internal.policy.impl.PhoneWindow$DecorView{41c4f3b8 V.E..... R.....I. 0,0-720,1232}",
"class" => "com.android.internal.policy.impl.PhoneWindow$DecorView",
"rect" => {
"center_y" => 616,
"center_x" => 360,
"height" => 1232,
"y" => 0,
"width" => 720,
"x" => 0
}
},
[1] {
"id" => nil,
"enabled" => true,
"contentDescription" => nil,
"visible" => true,
"tag" => nil,
"description" => "android.widget.LinearLayout{41c4f8a8 V.E..... ......I. 0,0-720,1232}",
"class" => "android.widget.LinearLayout",
"rect" => {
"center_y" => 616,
"center_x" => 360,
"height" => 1232,
"y" => 0,
"width" => 720,
"x" => 0
}
},
[2] {
"id" => "content",
"enabled" => true,
"contentDescription" => nil,
"visible" => true,
"tag" => nil,
"description" => "android.widget.FrameLayout{41c50560 V.E..... ......I. 0,25-720,1232 #1020002 android:id/content}",
"class" => "android.widget.FrameLayout",
"rect" => {
"center_y" => 628,
"center_x" => 360,
"height" => 1207,
"y" => 25,
"width" => 720,
"x" => 0
}
},
[3] {
"id" => nil,
"enabled" => true,
"contentDescription" => nil,
"visible" => true,
"tag" => nil,
"description" => "android.widget.ImageView{41bb9f40 V.ED.... ........ 0,0-720,1207}",
"class" => "android.widget.ImageView",
"rect" => {
"center_y" => 628,
"center_x" => 360,
"height" => 1207,
"y" => 25,
"width" => 720,
"x" => 0
}
}
]

最佳答案

这个问题似乎与新的 Android 系统 WebViews 有关。例如,您使用的是 Android 5.1 或更高版本吗?与 webView 相同的应用程序在 4.4 智能手机上对我来说工作正常但由于这个错误在某些 5.1 上失败。

阅读其他帖子后,我发现这应该在 Calabash-Android 的 0.5.12 版本中得到修复。

查看更改日志:calabash-android 0.5.12 发行说明修复 Calabash WebView 查询不适用于 Lollipop 和 M 中的新 Android 系统 WebView。

请更新!!!

关于android - AWS Device Farm 上用于 Cordova Android 应用程序的 Calabash,正确的 Web View 名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32958694/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com