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 fastrun startproject demo          
2022-02-23 11:27:43.369 | INFO     | fastrun.scaffold:create_folder:29 - 创建文件夹:demo
2022-02-23 11:27:43.371 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\__init__.py
2022-02-23 11:27:43.372 | INFO     | fastrun.scaffold:create_folder:29 - 创建文件夹:demo\modules
2022-02-23 11:27:43.373 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\modules\fastrun.json
2022-02-23 11:27:43.374 | INFO     | fastrun.scaffold:create_file:38 - 创建文件:demo\debugfeng.py 
  1. 在Terminal中输入运行命令

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

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

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

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

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

PS E:\testProject> py -m fastrun run "包名" -module login -l flase
  1. 设置自定义文件fastrun.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 fastrun 1.0.4

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

Source distribution (sdist)

Source distribution for fastrun 1.0.4
File Size Uploaded
fastrun-1.0.4.tar.gz 9.2 kB Details

Built distribution (wheel)

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

Total release size: 20.4 kB

Release files / fastrun-1.0.4.tar.gz

Download URL fastrun-1.0.4.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0ad8307b11d1427b2c674462eea0d6ec67b6474daf8f60ce53cd4978aa21c8b5
BLAKE2b-256 checksum
How to use checksums
3a6e3432635df828a9a8318f160ea01e35622472f2b533379398fce802d8dec8
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 / fastrun-1.0.4-py3-none-any.whl

Download URL fastrun-1.0.4-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c79e8d5021490e2a0b9d1d6e8f7a7edfcc3c42fd723fc8da1908fcde4557df5
BLAKE2b-256 checksum
How to use checksums
d3c4a40bb9d8a0f0739979f93baf1c4daf9b1933a610fd45f7b30afd4eb6f85c
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.4 This release

2 release files

1.0.3

2 release files

1.0.1

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