• 套路不是:这是干啥的、怎么实现的、解决了什么疑难杂症、效果咋样😂

  • 我记得 unittest 代码块里边有个地方设置编码格式的,你可以搜出来改掉试试

  • 你把代理关了就行了吧

  • 还是被发现了😂

  • 接口测试工具如何选择 at 2018年01月19日

    我觉着初学者不应该依赖那种接口测试工具。
    比如你可以找搞一个 http 协议的接口测试写写,然后再试试 dubbo。我是这么搞的: 先用 Charles 抓包,把一些请求参数放到 postman 里边去请求下,看看接口响应是不是跟 Charles 中的响应一致,然后再根据请求参数用 httpclients 去实现。
    最后你会发现用 java 会比 python 更自然一点。个人建议用 java😂

  • 完美😀

  • 测试楼主可见功能 at 2017年12月15日

    仅楼主可见后,我这种有偷窥嗜好的表示很难受。😂

  • clean 了下,不知道怎么就好了


    @nil 楼主好,请问生成的覆盖率文件:coverage.ec 从上手机上 pull 出来后,是需要放到指定目录吗?我是把这个文件放在工程的根目录,但是使用命令:gradle jacocoTestReport 报错了,日志:

    E:\Code-for-Git\A-Native-TesterHome\app>gradle createDebugCoverageReport
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':app'.
    > Could not resolve all dependencies for configuration ':app:_debugApk'.
       > A problem occurred configuring project ':swipebackhelper'.
          > Failed to notify project evaluation listener.
             > com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependen
    cyCacheDir(Ljava/io/File;)V
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.
    
    BUILD FAILED in 1s
    

    实在是没有解决办法,求助!

  • 这个问题已经解决了

    @DoctorQ 楼主好,最近在调研jacoco来统计Android的代码覆盖率,使用testerhome客户端的源码来调试的。但是遇到下边的问题,日志如下:

    09-06 14:28:13.661 27367-27367/com.testerhome.nativeandroid D/CrashReport: >>> com.testerhome.nativeandroid.views.TopicDetailActivity onDestroyed <<<
    09-06 14:28:18.091 27367-27367/com.testerhome.nativeandroid W/Toast: From com.testerhome.nativeandroid, go ahead.
    09-06 14:28:18.821 27367-27420/com.testerhome.nativeandroid D/dalvikvm: GC_EXPLICIT freed 3173K, 14% free 32497K/37432K, paused 9ms+8ms, total 79ms
    09-06 14:28:19.081 27367-27367/com.testerhome.nativeandroid I/Timeline: Timeline: Activity_launch_request time:1621065528
    09-06 14:28:19.101 27367-27367/com.testerhome.nativeandroid D/CrashReport: >>> com.testerhome.test.InstrumentedActivity onPaused <<<
    09-06 14:28:19.131 27367-27367/com.testerhome.nativeandroid D/CrashReport: >>> com.testerhome.nativeandroid.views.DummyActivity onCreated <<<
    09-06 14:28:19.141 27367-27367/com.testerhome.nativeandroid D/CrashReport: >>> com.testerhome.nativeandroid.views.DummyActivity onResumed <<<
    09-06 14:28:19.191 27367-27367/com.testerhome.nativeandroid I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@43ee8dd0 time:1621065637
    09-06 14:28:19.651 27367-27367/com.testerhome.nativeandroid D/CrashReport: >>> com.testerhome.nativeandroid.views.DummyActivity onPaused <<<
    09-06 14:28:19.701 27367-27367/com.testerhome.nativeandroid D/IntrumentedPlayer: .InstrumentedActivity: onDestroy()
    09-06 14:28:19.701 27367-27367/com.testerhome.nativeandroid D/JacocoInstrumentation:: JacocoInstrumentation: onActivityFinished()
    09-06 14:28:19.701 27367-27367/com.testerhome.nativeandroid D/JacocoInstrumentation:: generateCoverageReport path :/data/data/com.testerhome.nativeandroid/files/coverage.ec
    09-06 14:28:19.731 27367-27367/com.testerhome.nativeandroid D/JacocoInstrumentation:: java.lang.reflect.InvocationTargetException
                                                                                          java.lang.reflect.InvocationTargetException
                                                                                              at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                              at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                              at com.testerhome.test.JacocoInstrumentation.generateCoverageReport(JacocoInstrumentation.java:86)
                                                                                              at com.testerhome.test.JacocoInstrumentation.onActivityFinished(JacocoInstrumentation.java:135)
                                                                                              at com.testerhome.test.InstrumentedActivity.onDestroy(InstrumentedActivity.java:58)
                                                                                              at android.app.Activity.performDestroy(Activity.java:5421)
                                                                                              at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117)
                                                                                              at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3494)
                                                                                              at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3525)
                                                                                              at android.app.ActivityThread.access$1500(ActivityThread.java:141)
                                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)
                                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                              at android.os.Looper.loop(Looper.java:136)
                                                                                              at android.app.ActivityThread.main(ActivityThread.java:5072)
                                                                                              at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                              at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
                                                                                              at dalvik.system.NativeStart.main(Native Method)
                                                                                           Caused by: java.lang.IllegalStateException: JaCoCo agent not started.
                                                                                              at org.jacoco.agent.rt.internal_932a715.Agent.getInstance(Agent.java:72)
                                                                                              at org.jacoco.agent.rt.RT.getAgent(RT.java:32)
                                                                                              at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                                              at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                                              at com.testerhome.test.JacocoInstrumentation.generateCoverageReport(JacocoInstrumentation.java:86) 
                                                                                              at com.testerhome.test.JacocoInstrumentation.onActivityFinished(JacocoInstrumentation.java:135) 
                                                                                              at com.testerhome.test.InstrumentedActivity.onDestroy(InstrumentedActivity.java:58) 
                                                                                              at android.app.Activity.performDestroy(Activity.java:5421) 
                                                                                              at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117) 
                                                                                              at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3494) 
                                                                                              at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3525) 
                                                                                              at android.app.ActivityThread.access$1500(ActivityThread.java:141) 
                                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266) 
                                                                                              at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                              at android.os.Looper.loop(Looper.java:136) 
                                                                                              at android.app.ActivityThread.main(ActivityThread.java:5072) 
                                                                                              at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                                              at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) 
                                                                                              at dalvik.system.NativeStart.main(Native Method) 
    

    这个logcat日志是在退出testerhome客户端之后的错误日志,然后看了下jacoco的依赖包源码,发现如下:从RT.class中的

    public static IAgent getAgent() throws IllegalStateException {
        return Agent.getInstance();
    }
    

    方法调用了Agent.class中的

    public class Agent implements IAgent {
        private static Agent singleton;
    
        ......
    
        public static synchronized Agent getInstance() throws IllegalStateException {
            if(singleton == null) {
                throw new IllegalStateException("JaCoCo agent not started.");
            } else {
                return singleton;
            }
        }
    

    但是源码中的singleton引用在初始化的是没有引用任何对象,所以一直都会抛出IllegalStateException异常。

    实在找不到路子了,所以想问下:是我的覆盖率统计方式出错了,还是jacoco本身的问题

  • @heyniu 楼主好,我把你的遍历工程导入到 Android Studio 上。在 Android Studio 可以运行,但是想通过断点的方式看看整体的执行流程,却发现不能 debug。网上找了好久也没解决,请问需要什么配置么。

    错误告警如下:

    Error running Iteration:
    Cannot debug application from module AutoClick on device lge-nexus_5-055846c6f0df5ffb.
    This application does not have the debuggable attribute enabled in its manifest.
    If you have manually set it in the manifest, then remove it and let the IDE automatically assign it.
    If you are using Gradle, make sure that your current variant is debuggable.

  • 1、首先看看路径下有没有那个 debug 包
    2、如果没有就试试 cnpm 重新下载 macaca,npm 下载路径最好不要使用默认的,因为这样很难固化 macaca 测试环境
    仅供参考😀

  • 移动测试初探-续 at 2017年06月30日

    @kasi 楼主你好,请问这个性能实时监控怎么跟业务相结合?比如,能自动监控到在处理哪块业务的时候,应用进程所占用的内存、CPU 处于峰值

  • 我也碰到过,感觉跟机型有关。最后用自带的方法封装了一个点击输入框的动作,然后在用 adb 命令输入

  • 没权限截屏😂