Maxim-Customizable Monkey Test Tool (Android)

Maxim’s secondary development based on monkey, which is newer than the original monkey The following functions are added
  1. Multiple random test modes: dfs (depth traversal), mix mode (monkey random test + control identification) troy mode (according to the control selector) Traverse)
  2. The execution time can be set
  3. You can customize the activity black and white list
  4. Compatible with multiple Android versions
  5. Anti-bounce, Anti-sleep, anti-feign death

Maxim

How to use

  1. adb push The framework.jar monkey.jar file to the /sdcard folder
  2. Execute: adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test .monkey.Monkey -p com.panda.videoliveplatform –uiautomatormix –running-minutes 60

Parameter description:

< ol>

  • tv.panda.test.monkey.Monkey main call entry No need to modify
  • -p com.panda.videoliveplatform appid to be tested
  • strategy mode
  • div>
    –uiautomatormix hybrid mode (70% of the controls resolve random clicks, and the remaining 30% are based on the original Monkey event probability distribution)
    –pct-uiautomatormix n The control resolution event probability in the hybrid mode can be customized
    demo:
    [ {

    “prob”: 1,
    “activity”: “com.sjk. userattribute.login.PwdLoginActivity”,
    “actions”: [

    < div> {

    “xpath”: “//*[@resource-id=’com.sjk.android:id/et_phone’]”,
    “action”: “INPUTTEXT”,
    “text”: “15154111005 “,
    “index”: 0,
    “throttle”: 500
    },
    {
    “xpath”: “//*[@resource-id=’com.sjk.android:id/et_pwd’]”,
    “action”: “INPUTTEXT”,
    “text”: “123456”,
    “index”: 0,
    “throttle”: 500
    },

    < div> “xpath”: “//*[@resource-id=’com.sjk.android:id/tv_login’]”,

    “index”: 0,
    “action “: “CLICK”,
    “throttle”: 500
    }
    }
    },

    < div>]
    –uiautomatordfs DFS depth traversal algorithm (optimized version) (Note Android5 does not support dfs) ​​
    –uiautomatortroy Troy mode
    Configure max. xpath.selector troy control selector to customize its own control selection priority, max.xpath.selector needs to be pushed to /sdcard/
    demo:
    [

    < div> {

    “firstList”: [
    {
    “xpath”: “//*[contains(@text,’绝地求生’)] “

    “selectList”: [
    “xpath”: “//* [@clickable=’true’]”
    “xpath”: “//*[@clickable=’true’]/ /*[contains(name(),’Text’)]”
    },
    “xpath”: “//*[@clickable =’true’]//*[contains(name(),’Button’)]”
    },
    {
    “xpath”: ” //*[@clickable=’true’]//*[contains(name(),’Image’)]”
    “LastList”: [
    {
    “xpath”: “//*[../*[@selected=’true’]]”
    },
    {
    “xpath”: “//*[../../*/*[@selected=’true’]]”
    },
    {< /div>

    “xpath”: “//*[../../*/*[@selected=’true’] and contains(@resource-id,’tab_’)]”
    },
    {
    “xpath”: “//*[contains(@resource-id,’HorizontalScrollView’)]”
    “xpath”: “//*[contains(@resource-id,’HorizontalScrollView’)]”
    ],
    “blackList”: [
    {
    “xpath”: “//*[contains(@resource- id,’wrapper_in_custom_title_bar’)]//*[contains(@resource-id,’right_button’)]”
    },

    “xpath “: “//*[contains(@resource-id,’share’)]”

    }
    }
    ]
    4. Execution time–running-minutes 60 Execution of fine-grained control of monkey scene for 60 minutes
    5.–act-whitelist-file/sdcard/awl.strings From Define Activity Whitelist

    Appetizer