zoukankan      html  css  js  c++  java
  • Appium+python自动化测试过程中问题

     一、自动删除contactmanager

    自动化测试appium提供的sample如下包/activity:com.example.android.contactmanager/.ContactManager ,发现提示如下错误

    info: [debug] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
    >     at [object Object].<anonymous> (C:Program Files (x86)Appium ode_modulesappium ode_modulesappium-adblibadb.js:1146:21)
    >     at [object Object].<anonymous> (C:Program Files (x86)Appium ode_modulesappium ode_modulesappium-adblibadb.js:180:9)
    >     at ChildProcess.exithandler (child_process.js:742:7)
    >     at ChildProcess.emit (events.js:110:17)
    >     at maybeClose (child_process.js:1016:16)
    >     at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
    > info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity)","origValue":"Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity"},"sessionId":null}
    > info: <-- POST /wd/hub/session 500 2518.066 ms - 346

    发现提示该包不存在。很奇怪我安装了之后确认能够运行了之后再运行的自动化代码,为什么提示不存在呢?

    于是观察模拟器运行界面信息,发现启动代码后自动把模拟器中的contactmanager删除了,那当然找不到这个包和activity啦。

    二、Failed to start an Appium session, err was: Error: Requested a new session but one was in progress

    这是由于之前的会话没有关闭,然后你又开启了测试实例,解决方法: 
    1. 停止appium服务 
    2. 在Genarel Setting那里设置覆盖Session,重启Appium

    测试结束在AfterClass加driver.quit()

  • 相关阅读:
    poj 2886 Who Gets the Most Candies?(线段树)
    Android开发之SoundPool使用具体解释
    Win8.1应用开发之动态磁贴
    开发人员获取苹果技术支持
    Win32 Windows编程 十二
    华为上机练习题--压缩字符串
    PS 滤镜算法原理 ——马赛克
    JS版汉字与拼音互转终极方案,附简单的JS拼音输入法
    mybatis入门基础----动态SQL
    windows上如何搭建Git Server
  • 原文地址:https://www.cnblogs.com/Ladylittleleaf/p/9566296.html
Copyright © 2011-2022 走看看