任何人都可以帮助我吗我是使用 Appium 进行 Android 测试的新手,我正在尝试在 AVD 中打开应用程序,该应用程序正在安装,但随后出现错误“无法创建新会话。(原始错误:命令失败:)”, “killed”:false,“code”:1,“signal”:null,“origValue”:“命令失败:”},“sessionId”:null}
我在这里先向您的帮助表示感谢
尝试只提供 capabilities.setCapability("appActivity", ".MainActivity");
'''
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "/Apps/src/");
File app = new File(appDir, "ChatApp-release.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "emulator-5554");
capabilities.setCapability("platformVersion", "7.1.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.aaa.charla");
capabilities.setCapability("appActivity", "com.aaa.xxx.MainActivity");
driver = new AndroidDriver(new URL("https://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
Thread.sleep(10000);
driver.quit();
以下是调试日志:
信息:控制台日志级别:调试信息:--> POST /wd/hub/session {"desiredCapabilities":{"app":"D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9. 35.1195-release.apk","appPackage":"com.odysseyinc.charla","appActivity":"com.odyssey.chatapp.MainActivity","newCommandTimeout":"10000","platformName":"Android"," version":"7.1.1","deviceName":"emulator-5554"}} info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_162) info: [debug] 以下所需提供了功能,但 appium 未识别。它们将被传递到该服务器上运行的任何其他服务。:版本信息:[调试]使用所需上限的本地应用程序:D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk 信息:[调试] 创建新的 appium 会话 0d25aeac-d055-449f-af84-b6d314d9b4a5 信息:启动 android appium 信息:[ debug] 获取 Java 版本信息:Java 版本是:1.8.0_162 信息:
慕后森
红颜莎娜
相关分类