• SplashActivity 吧

  • 最好在帖子回复,贴代码方便,而且其他同学有可能会遇到你类似的问题,我也有可能不能解答哦,大神们看到了可以帮助回答。

  • 能否提供详细一点的信息呢?比如运行命令和 jacoco 代码

  • 先贴方法

    desired_caps = {
            'platformName': Platform,
            'platformVersion': PlatformVersion,
            'deviceName': DeviceName,
            'app': ApkPATH,
            'unicodeKeyboard': True,
            'resetKeyboard': True,
            'udid': UdId,
            'appPackage': PackageName,
            # 'appActivity': FirstActivity,
            'noRest': True
    }
    
    my_driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    my_driver.implicitly_wait(TIME_TO_WAIT)
    
  • 历历在目的 2 年 测试生活 at 2017年06月12日

    我也正在经历楼主类似搭建自动化从 0 到 1 的过程 向楼主学习 天道酬勤,机会是留给有准备的人!(真的,2 年有这种经历太棒了!)

  • appiumlog

    [debug] [ADB] Pressing the HOME button
    [debug] [ADB] Getting connected devices...
    [debug] [ADB] 1 device(s) connected
    [debug] [ADB] Running 'D:\Users\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","192.168.134.1
    01:5555","shell","input","keyevent",3]
    [debug] [AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
    [debug] [AndroidBootstrap] Received command result from bootstrap
    [debug] [UiAutomator] Shutting down UiAutomator
    [debug] [UiAutomator] Moving to state 'stopping'
    [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
    [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
    [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
    [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 18.601
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
    [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    [debug] [UiAutomator] UiAutomator shut down normally
    [debug] [UiAutomator] Moving to state 'stopped'
    [debug] [ADB] Attempting to kill all uiautomator processes
    [debug] [ADB] Getting all processes with uiautomator
    [debug] [ADB] Getting connected devices...
    [debug] [ADB] 1 device(s) connected
    [debug] [ADB] Running 'D:\Users\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","192.168.134.1
    01:5555","shell","ps"]
    [ADB] No uiautomator process found to kill, continuing...
    [debug] [UiAutomator] Moving to state 'stopped'
    [debug] [Logcat] Stopping logcat capture
    [debug] [ADB] Getting connected devices...
    [debug] [ADB] 1 device(s) connected
    [debug] [ADB] Running 'D:\Users\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","192.168.134.1
    01:5555","shell","am","force-stop","io.appium.unlock"]
    [debug] [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
    [Appium] Removing session 50f32436-b1c1-4369-b72f-2c6fdeb3ec7d from our master session list
    [debug] [BaseDriver] Event 'quitSessionFinished' logged at 1496979735883 (11:42:15 GMT+0800 (中国标准时间))
    [debug] [MJSONWP] Received response: null
    [debug] [MJSONWP] But deleting session, so not returning
    [debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
    [HTTP] <-- DELETE /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d 200 1572 ms - 76
    [HTTP] --> POST /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d/element {"using":"id","sessionId":"50f32436-b1c1
    -4369-b72f-2c6fdeb3ec7d","value":"right_text"}
    [HTTP] <-- POST /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d/element 404 3 ms - 131
    [HTTP] --> GET /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d/screenshot {}
    [HTTP] <-- GET /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d/screenshot 404 2 ms - 131
    [HTTP] --> DELETE /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d {}
    [HTTP] <-- DELETE /wd/hub/session/50f32436-b1c1-4369-b72f-2c6fdeb3ec7d 404 3 ms - 131
    
  • 好的 感谢 我再看看

  • 多个 case 不行

  • $buildDir/outputs/code-coverage/connected/flavors/coverage.ec
    你看下有没有把导出来的 ec 文件放到这个路径,然后执行 gradle jacocoTestReport

  • 医生,想给当时生病的奶奶治病

  • adb pull coverage.ec 路径 本地路径

  • 如果怕被覆盖可以设置 DEFAULT_COVERAGE_FILE_PATH 保存的路径。因为现在的文件是存到 apkfile 里面的。如果删除 apk,文件也会被删除。

  • 可能的问题:没有读到 coverage.ec 文件或确保 coverage.ec 有数据.查看一下 jacocoTestReport 配置的路径是不是跟你自己的文件路径一致.我当时就是文件路径的问题

  • 这个不好分析.最好有 log.我这边最后是 build,gradle 的配置问题.😥

  • 还可以按照系统做个简单的区分使用 grep 和 findstr👍

  • 给楼主点个赞👍
    我之前也写过这个.感觉有些地方可以讨论一下
    比如

    def get_current_activity(self):
            ret = self.shell_cmd('dumpsys activity top').split('ACTIVITY')[1].split('\n')[0].split()[0].strip()
            return ret.split('/')[0] + '/' + ret.split('/')[0] + ret.split('/')[1]
    

    我使用的 (windows 环境)

    def get_current_activity(self):
        return self.shell_cmd('dumpsys activity | findstr "mFocusedActivity"').stdout.read().split('/')[-1].split()[0]
    

    当然还有另外一种方式:

    def get_current_activity(self):
        return adb.shell('dumpsys window w | findstr \/| findstr name=').stdout.read().split('/')[-1].split(')')[0]
    

    如果是 unix 可以用 grep 代替 findstr
    当然条条大路通罗马,能达到目的都是可行的.😀

  • 小米应用审核被拒... at 2017年05月22日

    多谢提供思路..正尝试联系一下小米的工作人员..
    附 trace

    0x0001ff68 wait4+8 (/system/lib/libc.so)
    0x0005e21f dvmOptimizeDexFile(int, long, long, char const*, unsigned int, unsigned int, bool)+546 (/system/lib/libdvm.so)
    dalvik.system.DexFile.openDexFileNative
    dalvik.system.DexFile.openDexFile (DexFile.java)
    dalvik.system.DexFile. (DexFile.java)
    dalvik.system.DexFile.loadDex (DexFile.java)
    dalvik.system.DexPathList.loadDexFile (DexPathList.java)
    dalvik.system.DexPathList.makeDexElements (DexPathList.java)
    java.lang.reflect.Method.invokeNative
    java.lang.reflect.Method.invoke (Method.java)
    android.support.multidex.a$b.a (MultiDex.java)
    android.support.multidex.a$b.b (MultiDex.java)
    android.support.multidex.a$b.a (MultiDex.java)
    android.support.multidex.a.a (MultiDex.java)
    android.support.multidex.a.a (MultiDex.java)
    android.support.multidex.MultiDexApplication.attachBaseContext (MultiDexApplication.java)
    com.excelliance.open.LBApplication.attachBaseContext (LBApplication.java)
    android.app.Application.attach (Application.java)
    android.app.Instrumentation.newApplication (Instrumentation.java)
    android.app.Instrumentation.newApplication (Instrumentation.java)
    android.app.LoadedApk.makeApplication (LoadedApk.java)
    android.app.ActivityThread.handleBindApplication (ActivityThread.java)
    android.app.ActivityThread.access$1600 (ActivityThread.java)
    android.app.ActivityThread$H.handleMessage (ActivityThread.java)
    android.os.Handler.dispatchMessage (Handler.java)
    android.os.Looper.loop (Looper.java)
    android.app.ActivityThread.main (ActivityThread.java)
    java.lang.reflect.Method.invokeNative
    java.lang.reflect.Method.invoke (Method.java)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java)
    com.android.internal.os.ZygoteInit.main (ZygoteInit.java)
    dalvik.system.NativeStart.main
    
  • 小米应用审核被拒... at 2017年05月19日

    难啊 我们研发也在抓头

  • 小米应用审核被拒... at 2017年05月19日

    嗯 我们再分析一下 感谢!👍

  • 小米应用审核被拒... at 2017年05月19日

    好的 我先试试

  • 测试行业的编程语言之争 at 2017年05月18日

    那么到底哪种语法比较适合测试行业?

  • 感谢回复!亲测有效解决!由于没有使用 *gradle wrapper * 所以运行的gradle -Dfile.encoding=UTF-8 jacocoTestReport
    一万个赞!!👍 👍

  • 是的,你可以在 github 上找一个 app 试试

  • 我是用的我们公司自己的项目,其他需要配置和各个加的类 文章已经说清楚了哦 可以动手试试

  • 嗯 我也同意 但是要求团队能够接受