AppCrawler的學(xué)習(xí)筆記

介紹

  • 一個(gè)基于自動(dòng)遍歷的app爬蟲工具. 支持android和iOS, 支持真機(jī)和模擬器. 最大的特點(diǎn)是靈活性. 可通過配置來設(shè)定遍歷的規(guī)則。查看-在線文檔
  • 注意此工具是建立到appium基礎(chǔ)之上,首先自己搭建好appium的環(huán)境

獲取方式

運(yùn)行

  • gui點(diǎn)擊啟動(dòng)
Paste_Image.png
  • 命名啟動(dòng)
appium --session-override
  • 我的json參數(shù)設(shè)置,現(xiàn)在只是測試了安卓
---
pluginList:
- "com.xueqiu.qa.appcrawler.plugin.TagLimitPlugin"
- "com.xueqiu.qa.appcrawler.plugin.ReportPlugin"
#- "com.xueqiu.qa.appcrawler.plugin.ProxyPlugin"
logLevel: "TRACE"
saveScreen: true
screenshotTimeout: 20
tagLimitMax: 3
currentDriver: "android"
maxTime: 10800
resultDir: ""
capability:
  newCommandTimeout: 120
  launchTimeout: 120000
  platformVersion: ""
  platformName: ""
  autoWebview: "false"
  autoLaunch: "true"
  noReset: "false"
androidCapability:
  deviceName: "JTJ4C16331013562"
  appPackage: "cn.ibona.t1_beta"
  appActivity: "cn.ibona.t1.main.ui.activity.SplashActivity"
  app: "d:/t13.2.2.apk"
  appium: "http://127.0.0.1:4723/wd/hub"
maxDepth: 20
headFirst: true
enterWebView: true

selectedList:
#android非空標(biāo)簽
- //*[clickable="true"]
- //*[clickable="true"]//android.widget.TextView[string-length(@text)>0 and string-length(@text)<20]
- //android.widget.EditText
- //*[contains(name(), 'Text') and string-length(@text)>0 and string-length(@text)<20 ]

triggerActions: # 這里可以設(shè)置觸發(fā)器
- action: "click"
  xpath: "http://*[@resource-id='com.huawei.systemmanager:id/btn_allow']"
  times: 0
- action: "click"
  xpath: "http://*[@resource-id='cn.ibona.t1_beta:id/btn_skip']"
  times: 0
- action: "12345678911"
  xpath: "http://*[@resource-id='cn.ibona.t1_beta:id/phoneNumberEditText']"
  times: 1
- action: "click"
  xpath: "http://*[@resource-id='cn.ibona.t1_beta:id/start_button']"
  times: 1
- action: "123456"
  xpath: "http://*[@resource-id='cn.ibona.t1_beta:id/passwordEditText']"
  times: 1
- action: "click"
  xpath: "http://*[@resource-id='cn.ibona.t1_beta:id/loginButton']"
  times: 1
startupActions: # 這里是滑動(dòng),可以設(shè)置swipe("down")
- swipe("left")
- swipe("left")
- swipe("left")
- swipe("left")
- println(driver)
#beforeElementAction:
#- Thread.sleep(3000)
#- println(driver.getPageSource())
afterElementAction:
- println(driver)
#- println(driver.getPageSource)
#- Thread.sleep(3000)

  • 設(shè)置上面參數(shù)后執(zhí)行:
appcrawler -a d:\t13.2.2.apk -c E:\app\appcrawler-1.7.1\conf\t1.yml

就會(huì)開始自動(dòng)的遍歷你的應(yīng)用的UI了,并且各個(gè)步驟有截圖

兩個(gè)版本對(duì)比

  • 如果想對(duì)比兩次遍歷的版本
appcrawler --diff --master E:\app\appcrawler-1.7.1\bin\Android_20161206162754 --candidate E:\app\appcrawler-1.7.1\bin\Android_20161206165446\ --report d:\diff
Paste_Image.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容