测试之家
  • 社区
  • 问答
  • 招聘
  • 社区学堂新
  • 开源项目
  • 活动
  • 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
  • 個人信息
  • 個人專欄
  • 帖子
  • 回帖
  • 收藏
  • 正在關注
  • 關注者
  • python 脚本报错,求指点 at 2017年07月11日

    为什么要 exit?
    如果是在做测试不应该告诉上一级结果吗

  • 如果是移动端的测试,应该对操作系统了解哪些呢? at 2017年07月03日

    开发知道什么,测试也就需要知道什么
    有时候甚至更多,不然怎么发现更好逼格 (滑稽) 的 bug
    其实还是去啃一本操作系统原理的书吧 (linux/android),如果是做 app 或者网站的话
    弄明白个大概就行

  • 安卓 7.0 设备上,允许获取权限后如何继续操作 APP at 2017年06月30日

    抓 log,报 bug 给 appium

  • windows+python3+appium1.4.16+android6.0,appium server 中文显示乱码求解? at 2017年06月30日

    python3 不用添加 u
    IDE/Project 的编码和你 terminal 的编码没关系.
    举个例子,如果你用的是中文版 windows,那大多数情况下你 cmd 的编码是 gbk,所以当你需要 print 东西到 cmd 之前,需要转成 gbk
    至于你现在看到的窗口,看上去是 appium 起的,你得查看起的这个 terminal 的输出编码是什么

  • windows+python3+appium1.4.16+android6.0,appium server 中文显示乱码求解? at 2017年06月29日

    当然有,所有 python 内部处理用 str(py3)/unicode(py2),所有输出转换到对应编码

  • 安卓 7.0 设备上,允许获取权限后如何继续操作 APP at 2017年06月28日

    capabilities.setCapability("automationName","uiautomator2")

  • windows+python3+appium1.4.16+android6.0,appium server 中文显示乱码求解? at 2017年06月28日

    把 log 存成文件看

  • 用 notepad++ 编写玩测试脚本,运行 python 时却报错, at 2017年06月28日

    打开 cmd
    把 python.exe 拖进去
    输入空格
    把你的脚本也拖进去
    回车

  • 安卓 7.0 设备上,允许获取权限后如何继续操作 APP at 2017年06月28日

    依然看不出问题来,尝试升级 appium 到最新,然后用 uiautomator2

  • 用 notepad++ 编写玩测试脚本,运行 python 时却报错, at 2017年06月27日

    文件用 utf8 存
    文件内申明 utf8
    print 前把内容 encode 成你 cmd 的显示编码
    引号用半角而不是全角

  • 安卓 7.0 设备上,允许获取权限后如何继续操作 APP at 2017年06月26日

    后续操作的代码呢
    目前这些没看出有什么问题

  • done at 2017年06月24日

    错误贴完整,代码贴上来
    顺便是 ide 报错还是运行时报错

  • done at 2017年06月24日

    yymobile 下建一个__init__.py
    然后 from yymobile.public.readconfig import xxx
    大小写自己注意

  • done at 2017年06月23日

    贴上整个项目的文件 tree
    整个项目作为一个包的话,需要从该项目根目录开始 import 路径

  • 在 suite setup 中写了启动 appium 的服务 然后运行脚本 脚本只能运行到启动服务下面的运行不了 at 2017年06月23日

    appium xxx xx xxx &
    python? 如果是的话,怎么还在用 os.system
    改换 subprocess 了

  • 安卓 7.0 设备上,允许获取权限后如何继续操作 APP at 2017年06月23日

    “但是点击后就无法继续对 APP 进行操作了”,比如?
    最好 show me the code

  • PageObject+Python+Appium at 2017年06月16日

    把 err 用 gbk 解码打印出来看看你就知道原因了

  • python + paramiko 实现自动部署替换文件 at 2017年06月16日

    顺便练练英语吧,如果你想知道 pty 参数问题的原因

    https://github.com/fabric/fabric/issues/395

    pty/tty = false

    The bash shell launched connects to the stdout/stderr/stdin of the started process and is kept running until there is nothing attached to the sockets and it's children have exited. A good deamon process will ensure it doesn't wait for it's children to exit, fork a child process and then exit. When in this mode no SIGHUP will be sent to the child process by SSH. I believe this will work correctly for most scripts executing a process that handles deamonizing itself and doesn't need to be backgrounded. Where init scripts use '&' to background a process then it's likely that the main problem will be whether the backgrounded process ever attempts to read from stdin since that will trigger a SIGHUP if the session has been terminated.

    pty/tty = true*

    If the init script backgrounds the process started, the parent BASH shell will return an exit code to the SSH connection, which will in turn look to exit immediately since it isn't waiting on a child process to terminate and isn't blocked on stdout/stderr/stdin. This will cause a SIGHUP to be sent to the parent bash shell process group, which since job control is disabled in non-interactive mode in bash, will include the child processes just launched. Where a daemon process explicitly starts a new process session when forking or in the forked process then it or it's children won't receive the SIGHUP from the BASH parent process exiting. Note this is different from suspended jobs which will see a SIGTERM.

    I suspect the problems around this only working sometimes has to do with a slight race condition. If you look at the standard approach to deamonizing - http://www.itp.uzh.ch/~dpotter/howto/daemonize, you'll see that in the code the new session is created by the forked process which may not be run before the parent exits, thus resulting the random sucess/failure behaviour mentioned above. A sleep statement will allow enough time for the forked process to have created a new session, which is why it works for some cases.

    pty/tty = true and job control is explicitly enabled in bash

    SSH won't connect to the stdout/stderr/stdin of the bash shell or any launched child processes, which will mean it will exit as soon as the parent bash shell started finished executing the requested commands. In this case, with job control explicitly enabled, any processes launched by the bash shell with '&' to background them will be placed into a separate session immediately and will not receive the SIGHUP signal when the the parent process to the BASH session exits (SSH connection in this case).

    如果看不明白的话我可以简单解释下

  • python + paramiko 实现自动部署替换文件 at 2017年06月16日

    统一 print 写法,要么都函数式要么都作为函数调用 (推荐后者)
    用 except Exception as e 替代逗号的写法
    不要捕获"Exception",你应该要知道要调用的函数会抛出什么异常
    ssh_client 尝试使用 with,而不是手动指定何时关
    尝试使用 format 来格式化字符串而不是%
    既然函数内尝试捕获了异常,但依然像正常状态一样返回了一个不可用的实例,建议要么不要捕获异常,要么捕获之后加打印,然后把异常抛出交给上一级处理
    感兴趣的话试用看看 argparse 来原做某些按需的处理,很多时候脚本不要做交互式的才更好用

  • jenkins Performance plugin 报错 at 2017年06月11日

    支持模糊,但是你还是先搞清楚当前 job 的 workspace 是哪里吧

  • jenkins Performance plugin 报错 at 2017年06月10日

    看插件文档了么?看到右边的问号了么?

  • pytest 执行测试用例后如何生成测试报告 at 2017年05月28日

    试试 python -m pytest test_x.py

  • UiAutomator 2.0 在 Android 7.0 系统上无法在 sd 卡创建 txt 文件 at 2017年05月28日

    manifest 里权限申请了么
    测试 apk 装的时候用-g 参数,这样默认所有权限直接授权,不用动态申请了,或者不用到 M/N/O 的特性的话,指定编译的 sdk 为 L 也可以绕过

  • 请教:stdout.readline ().strip () 在 MAC 环境上一直处于阻塞,代码运行到这个地方就不动了 at 2017年05月16日

    有耐心的话,可以参考我的这个实现:
    https://github.com/264768502/adb_wrapper/blob/master/adb_wrapper/base_wrapper.py
    主要看_command_blocking 这个函数
    兼容了 py2 和 py3

    具体原理可以参考一下 sf 的回答
    http://stackoverflow.com/questions/2715847/python-read-streaming-input-from-subprocess-communicate/17698359#17698359

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

    uiautomator2.0 作为 apk,安装起来肯定也受限于安卓系统的安全管理策略
    如果有方法可以跳过这个,那岂不是一个很大的漏洞
    所以每个魔改系统都有自己的策略,想要一招搞定所有系统,难

    另外,如果实在不想 root,可以用障碍辅助服务
    比如每个手机预先安装类似酷市场的酷安装,然后去障碍辅助里开启

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

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