gpt4 book ai didi

appium - 在 Mac 上使用 appium 工具安装应用程序时出现包和事件错误

转载 作者:行者123 更新时间:2023-12-03 23:14:44 34 4
gpt4 key购买 nike

我正在使用 appium 工具测试我的应用程序。在测试过程中,android应用程序在启动器事件附近崩溃,仅在8以下版本的某些设备上显示以下错误。如何解决?

An unknown server-side error occurred while processing the command. Original error: Cannot start the "com.bodaty.samyata.samyata09.login.launcheractivity" or "com.bodaty.samyata.samyata09.com.bodaty.samyata.samyata09.login.launcheractivity" never started.


[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[ADB] Getting focused package and activity
[ADB] Running '/Users/Anusha/Library/Android/sdk/platform-tools/adb -P 5037 -s a035f0de shell dumpsys window windows'
[ADB] Found package: 'com.bodaty.samyata.samyata09' and fully qualified activity name : 'com.bodaty.samyata.samyata09.login.MainPhone'
[ADB] Incorrect package and activity. Retrying.
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[JSONWP Proxy] Matched '/' to command name 'deleteSession'
[JSONWP Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/f30fa70a-c42e-45ab-bf24-5a07755da6e4] with no body

所需的能力
{
"platformName": "Android",
"platformVersion": "6.0.1",
"deviceName": "Vivi Vivo 1606",
"automationName": "UiAutomator2",
"app": "/Users/Anusha/Downloads/samyata.apk"
}

最佳答案

在上述错误中,未定义应用程序启动所需的功能“appActivity”和“appPackage”。

如果您正在检查元素,请通过查找“appActivity”和“appPackage”来修改 Appium Inspector 中的所需功能,如下所示

{
"platformName": "Android",
"deviceName": "Motorola",
"app": "/Users/saif.siddiqui/Desktop/SaifLearning/src/test/resources/app/Todoist_v12.8_apkpure.com.apk",
"noReset": true,
"appActivity": "com.todoist.activity.HomeActivity",
"appPackage": "com.todoist",
"automatioName": "uiautomator2"
}

如果您正在运行测试用例,然后出现错误,请相应地在代码中修改所需的功能,如下所示:
    caps.setCapability("platformName", platformName);
caps.setCapability("deviceName", deviceName);
caps.setCapability("app", uri);
caps.setCapability("noReset", true);
URL remoteUrl = new URL("http://localhost:4723/wd/hub");
caps.setCapability("appPackage", "com.todoist");
caps.setCapability("appActivity","com.todoist.activity.HomeActivity");
driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), caps);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

关于appium - 在 Mac 上使用 appium 工具安装应用程序时出现包和事件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53313580/

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