测试之家
  • 社区
  • 问答
  • 招聘
  • 社区学堂新
  • 开源项目
  • 活动
  • Wiki
  • 注册
  • 登录
新手
264768502 (阳光下的草)
第 10582 位会员 / 2016-07-22
2 篇帖子 • 137 条回帖
4 关注者
0 正在关注
4 收藏
打赏支持
GitHub Public Repos
  • adb_wrapper 41

    A Python wrapper for adb command (Windows/Linux) based on subprocess

  • NetBooter_Control 2

    This a python script which can control NetBooter NP-05B

  • qiandao 1

    kanzhun/haodou/u-share 自动签到

  • zapif 0

    Algebraically remove C preprocessor conditionals

  • xmltojson 0

    Cli tool and Python module to convert XML to JSON

  • LogView 0

  • goproxy 0

    🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server i...

  • DeepLearningExamples 0

    Deep Learning Examples

  • demjson 0

    Python module for JSON data encoding, including jsonlint. See the project Wiki here on Github. ...

  • git-commit-plugin 0

    Automatically generate git commit

More on GitHub
  • 个人信息
  • 专栏
  • 话题
  • 回帖
  • 收藏
  • 关注中
  • 关注者
  • Ui2.0 弹窗问题更新源码并测试通过 at 2017年05月08日

    原生 AOSP 不需要
    国内魔改系统就难说了

  • Ui2.0 弹窗问题更新源码并测试通过 at 2017年05月05日

    adb shell settings put global package_verifier_enable 0

  • 大家有没有做过 python3.4.4 的图片识别文字的功能 at 2017年04月18日

    自己先找一些自己实际遇到的图片,做些训练
    然后再识别看看

  • jenkins 执行 python 脚本报:ImportError: No module named configparser at 2017年04月17日

    configparser 是 python3 的
    你确定 jenkins 用的和你手动用的是同一个 python?

  • 求 UIAutomator2.0 的 hasObject 方法、findObject 方法随机抛空指针异常的 Bug 解决方案 at 2017年03月15日

    把错误堆栈打出来,一级级往下看是哪里出的空指针

  • 请问使用 UiAutomator 时如何精确滑动到某一坐标点? at 2017年03月01日

    家里没法看源码,明天可以看看怎么 import
    另外又想到一个 api
    swipe(Point[] segments, int segmentSteps)
    设 3 个点,第一个第二个用来拖拽到目标位置,第三个点可以横向拖

  • 请问使用 UiAutomator 时如何精确滑动到某一坐标点? at 2017年03月01日

    换一种思路,在点了第一张图之后,用 key 来移动,比如 pressDown 之类的

    重写不代表你要替换 jar 包里原来的功能,你可以自己写一个 draghold 方法,你只要能调用 touchMove/Down/Up 就行,仿照原来的写法

  • 求助:python 测试 APP 如何切换到 webview,可以分享一下吗 at 2017年03月01日

    先看是不是 webview,有些 APP 用了自己的 view,而不是标准 webview,所以 appium 对这种情况无能为力

  • 请问使用 UiAutomator 时如何精确滑动到某一坐标点? at 2017年03月01日

    一种,你可以用 flingForward() 代替 drag,不过你的控件必须是 UiScrollable 的
    另一种,重写 swipe
    extras\android\m2repository\com\android\support\test\uiautomator\uiautomator-v18\2.1.2\uiautomator-v18-2.1.2-sources.jar!\android\support\test\uiautomator\InteractionController.java

    public boolean swipe(int downX, int downY, int upX, int upY, int steps, boolean drag) {
        boolean ret = false;
        int swipeSteps = steps;
        double xStep = 0;
        double yStep = 0;
    
        // avoid a divide by zero
        if(swipeSteps == 0)
            swipeSteps = 1;
    
        xStep = ((double)(upX - downX)) / swipeSteps;
        yStep = ((double)(upY - downY)) / swipeSteps;
    
        // first touch starts exactly at the point requested
        ret = touchDown(downX, downY);
        if (drag)
            SystemClock.sleep(mUiAutomatorBridge.getSystemLongPressTime());
        for(int i = 1; i < swipeSteps; i++) {
            ret &= touchMove(downX + (int)(xStep * i), downY + (int)(yStep * i));
            if(ret == false)
                break;
            // set some known constant delay between steps as without it this
            // become completely dependent on the speed of the system and results
            // may vary on different devices. This guarantees at minimum we have
            // a preset delay.
            SystemClock.sleep(MOTION_EVENT_INJECTION_DELAY_MILLIS);
        }
        if (drag)
            SystemClock.sleep(REGULAR_CLICK_LENGTH);
        ret &= touchUp(upX, upY);
        return(ret);
    }
    

    把 SystemClock.sleep(REGULAR_CLICK_LENGTH);这一行的 REGULAR_CLICK_LENGTH 改成 mUiAutomatorBridge.getSystemLongPressTime()

    第二种我没试过,仅仅理论上可行

  • 奇诡的 adb error,connot create file No Such file or directory at 2017年02月25日

    看代码,用了 popen.commiucate,所以肯定是跑完了才会跑下一个命令

  • 奇诡的 adb error,connot create file No Such file or directory at 2017年02月24日

    shell=True -> shell=False 呢? 其实你也不会运行 cmd 里的自带命令吧
    另外还是推荐 subprocess 的命令用列表的方式传进去,避免一些转义的问题

    另外错误 log 不足啊
    不是 sc.Error("cannot create file/directory '%s': %s", dst, strerror(errno));么
    后面的 strerror(errno) 是几呢

  • 奇诡的 adb error,connot create file No Such file or directory at 2017年02月24日

    虽说 python 是支持在 windows 用 / 作为路径分隔符,但是 c++ 未必,所以推荐在 windows 还是老老实实用 \ 吧

    另,adb 的 wrapper 真是好多个人写....
    https://github.com/264768502/adb_wrapper

  • android 端,每次安装都需要安装 unlock、ime 2 个 apk,影响到测试 at 2017年02月23日

    adb shell settings put global package_verifier_enable 0
    adb shell settings put global verifier_verify_adb_installs 0

  • 大家有没有做过 python3.4.4 的图片识别文字的功能 at 2017年02月23日

    pytesseract

  • 执行截屏操作后,在手机目录中找不到对应截图 at 2017年02月22日

    系统版本? 4.2 以上才行
    拿 takeScreenshot 的返回值看看是 true 还是 false

  • 在 UiAutomator 测试脚本无法启动指定 app at 2017年02月22日

    至少标准的安卓系统是不会阻止直接启动某个 Activity 的
    但是国内这些魔改版就很难说了,就像你遇到的那样.

  • 求助-非原生控件如何测试 at 2017年02月22日

    自动化的目标不一样
    比如如果只是测遍历元素,用用 monkey 也能成
    但是要测逻辑/行为,遍历就不行了
    我不认为 testin 有办法逃出比图的套路

  • 求助-非原生控件如何测试 at 2017年02月22日

    要么让他们改代码,让这个 view 继承自 webview
    要不只能玩比图了http://tmq.qq.com/2017/02/test_guide/

  • 求助-非原生控件如何测试 at 2017年02月21日

    谁告诉你 Appium 只能定位原生控件的?
    能支持 webview 也算是它的一大卖点
    https://testerhome.com/topics/2987

  • 在 UiAutomator 测试脚本无法启动指定 app at 2017年02月21日

    理论上,从系统上来说不需要,起 activity 不需要目标 app 已启动,除非目标 APP 自己设了限制
    如果可以的话,看看 logcat,看看启动后 logcat 是否有显示目标 app 的相关打印来确定问题
    另外,adb shell am start XXX 如果也启动不了,可以看看打印是什么

  • 在 UiAutomator 测试脚本无法启动指定 app at 2017年02月20日

    直接调用 API 去起不行么?非要用 shell
    Context context = InstrumentationRegistry.getInstrumentation().getContext();
    Intent intent = context.getPackageManager().getLaunchIntentForPackage(appPackageName);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    context.startActivity(intent);

  • Appium 自动化测试问题请教 at 2017年02月17日

    用 UiWatcher

  • appium 运行时,如何获取 adb shell dumpsyst 或 adb bugreport日志,这两者运行时会有冲突,如何解决? at 2017年02月17日

    和 appium 用同一个同路径的 adb.exe

    其实没特殊需求的话,直接在手机里运行你的命令 (uiautomator2 的 executeShellCommand) 然后再 pull 出来

  • 求助:python 怎么解析出嵌套的 if 代码结构? at 2017年02月16日

    用堆栈

  • 请问有可以编程控制的摄像头吗? at 2017年02月14日

    语言?操作系统?平台?

  • 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 下一页
  • 关于 / 活跃用户 / 中国移动互联网测试技术大会 / 反馈 / Github / API / 帮助推广
    TesterHome社区,测试之家,由众多测试工程师组织和维护的技术社区,致力于帮助新人成长,提高测试地位,推进质量发展。Inspired by RubyChina
    友情链接 WeTest腾讯质量开放平台 / InfoQ / 掘金 / SegmentFault / 测试窝 / 百度测试吧 / IT大咖说
    简体中文 / 正體中文 / English

    ©testerhome.com 测试之家   渝ICP备2022001292号
      渝公网安备 50022202000435号    版权所有 © 重庆年云聚力信息技术有限公司