Skip to main content

###快速启动-android稳定性测试


  • 前置条件:需安装adb环境、需安装adb环境、需安装adb环境,重要事情说三遍

  • 简介: 结合字节跳动提供的开源工具Fastbot_android, 进行封装了基础版的稳定性测试, 只需要数据线连接电脑,并确定在cmd中输入adb devices,看到了手机设备号,即可运行命令。

  • 命令参数
必选参数:
  startproject              创建工程目录
  
  run                       运行
  
    package 包名,必须输入,不然会抛出异常
    
    -m 10 是设置分钟,置默认为5分钟
    
    -t 500 是设置点击事件,默认设置为500
    
    -log 是捕获异常日志,布尔值,默认是true
    
    -module 是获取自定义文件中的模块名称

  • 基础教程
  1. 新建一个工程目录testProject,在Terminal中输入命令创建脚手架:
PS E:\testProject> py -m dfwsgroup startproject demo          
2022-02-23 11:27:43.369 | INFO     | dfwsgroup.scaffold:create_folder:29 - 创建文件夹:demo
2022-02-23 11:27:43.371 | INFO     | dfwsgroup.scaffold:create_file:38 - 创建文件:demo\__init__.py
2022-02-23 11:27:43.372 | INFO     | dfwsgroup.scaffold:create_folder:29 - 创建文件夹:demo\modules
2022-02-23 11:27:43.373 | INFO     | dfwsgroup.scaffold:create_file:38 - 创建文件:demo\modules\dfwsgroup.json
2022-02-23 11:27:43.374 | INFO     | dfwsgroup.scaffold:create_file:38 - 创建文件:demo\debugfeng.py 
  1. 在Terminal中输入运行命令

默认是运行 5 分钟点击 500 下

PS E:\testProject> py -m dfwsgroup run "包名" -module "login"(login是dfwsgroup.json文件中的模块名)

默认是运行 10 分钟点击 1000 下

PS E:\testProject> py -m dfwsgroup run "包名" -m 10 -t 100 -module "login"(login是dfwsgroup.json文件中的模块名)

默认是运行 5 分钟点击 500 下,并不要记录日志

PS E:\testProject> py -m dfwsgroup run "包名" -module login -l flase
  1. 设置自定义文件dfwsgroup.json文件

json文件固定格式:

{
  "login": [
    {
      "prob": 1,
      "activity": "xz.act.app_v4.account.LoginActivityV4",
      "times": 1,
      "actions": [
        {
          "xpath": "//*[@resource-id='xz.act:id/tv_account']",
          "action": "CLICK",
          "throttle": 2000
        }
      ]
    },
    {
      "prob": 1,
      "activity": "xz.act.app_v4.account.AccountLoginActivityV4",
      "times": 1,
      "actions": [
        {
          "xpath": "//*[@resource-id='xz.act:id/et_select']",
          "action": "CLICK",
          "throttle": 2000
        },
        {
          "xpath": "//*[@resource-id='xz.act:id/et_search']",
          "action": "CLICK",
          "text": "*测试酒店",
          "clearText": false,
          "throttle": 2000
        },
        {
          "xpath": "//*[@resource-id='xz.act:id/group_name']",
          "action": "CLICK",
          "throttle": 2000
        }
      ]
    }
  ]
}

|

后续会在增加黑白名单操作,敬请期待。。。



###严正声明

  • 作者只提供工具使用,当用户使用其他用途时,对用户或者他人造成任何形式的损失和伤害,该工具不承担任何责任。

  • 本协议的一切解释权与修改权归本工具所有。

Release files for dfwsgroup 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dfwsgroup 1.0.8
File Size Uploaded
dfwsgroup-1.0.8.tar.gz 511.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dfwsgroup 1.0.8
File Interpreter ABI Platform
dfwsgroup-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / dfwsgroup-1.0.8.tar.gz

Download URL dfwsgroup-1.0.8.tar.gz
Size 511.4 kB
Tags Source
SHA-256 checksum
How to use checksums
21fe0f482e7f8522f7025bca7234d2f053132c4d74efa48298c70aebe09cddd9
BLAKE2b-256 checksum
How to use checksums
a83233d975372c72d679d176e251b40520124e6aa674df5081caae66022ce041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Release files / dfwsgroup-1.0.8-py3-none-any.whl

Download URL dfwsgroup-1.0.8-py3-none-any.whl
Size 512.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7eda129b00ae90ae68dab1f726444ba9d39f74d9b69ca6174a688a2cad1b726f
BLAKE2b-256 checksum
How to use checksums
d10e4637713b8855b80915442ec9ce8c41d17602892fa6c7832128f5564f6e1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page