Appium Appium 测试今日头条 apk 时候报错

lvshunnian · 2017年11月02日 · 最后由 lvshunnian 回复于 2017年11月02日 · 1776 次阅读

测试今日头条 apk 时,打开之后秒退,别的像 QQ,网易云音乐都没有出现此现象 日志和报错已贴上,尚未弄懂怎么回事,请指教

代码如下:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.0");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "fc86ccdd");
capabilities.setCapability(MobileCapabilityType.APP, "D:\eclipse\apps\toutiao.apk");
capabilities.setCapability("noReset", true); //不需要再次安装
capabilities.setCapability("unicodeKeyboard", "True");//支持中文输入,会自动安装 Unicode 输入法。默认值为 false
capabilities.setCapability("resetKeyboard", "True");
capabilities.setCapability("newCommandTimeout", 30*1000);
URL url = new URL("http://127.0.0.1:4723/wd/hub");
AndroidDriver driver = new AndroidDriver(url, capabilities);
报错如下:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error occured while starting App. Original error: com.ss.android.article.news.activity.SplashBadgeActivity or com.ss.android.article.news.com.ss.android.article.news.activity.SplashBadgeActivity never started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 52.05 seconds

共收到 1 条回复 时间 点赞

已解决,配置上"appPackage",和"appActivity"就可以了,应该是默认的没有找到.

lvshunnian 关闭了讨论 11月02日 16:31
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册