AppCrawler 关于 AppCrawler 运行过程中的几个小问题

游戏人间 · 2020年07月22日 · 最后由 Trevor Wang 回复于 2020年10月26日 · 1789 次阅读

最近在研究 AppCrawler,但是在运行过程中发现了几个问题,麻烦大佬们帮忙解答一下~

1.运行过程中会跳到其他 APP
能否让 AppCrawler 仅在指定 APP 内操作?

2.运行了几十条后,APP 界面就不动了,一直停留在某个页面
结束运行,生成报告后,在报告处也没看出来哪里报错了

3.怎么才能看到它失败呢?
虽然我现在没有写 testcase,但是也应该可以检测出来 crash 吧?即使我后台杀死 APP,查看报告还都是正常的,不知道是怎么回事

config 文件内容为:
---
pluginList: []
saveScreen: true
reportTitle: "AppCrawler自动遍历测试报告"
resultDir: ""
waitLoading: 500
waitLaunch: 6000
showCancel: true
maxTime: 10800
maxDepth: 5
capability:
  noReset: "true"
  fullReset: "false"
  appium: "http://127.0.0.1:4723/wd/hub"
  appPackage: "*****"
  appActivity: "activity.StartUpActivity"
  automationName: uiautomator2
  autoGrantPermissions: true
  dontStopAppOnReset: true
testcase:
  name: "TesterHome AppCrawler"
  steps:
  - given: []
    when: null
    then: []
    xpath: "/*"
    action: "Thread.sleep(5000)"
    actions: []
    times: 0
selectedList:
- {xpath: "//*[@clickable='true']", action: click }
firstList: 
- { xpath: "//*[contains(@text, '运动')]", action: click }
lastList:
- { xpath: "//*[contains(@text, '课程')]", action: click }
- { xpath: "//*[contains(@text, '社区')]", action: click }
- { xpath: "//*[contains(@text, '发现')]", action: click }
- { xpath: "//*[contains(@text, '我的')]", action: click }
backButton: []
triggerActions:
- xpath: et_username
  action: ***
  times: 1
- xpath: et_password
  action: ***
  times: 1
xpathAttributes:
- "name"
- "label"
- "value"
- "resource-id"
- "content-desc"
- "instance"
- "text"
sortByAttribute:
- "depth"
- "list"
- "selected"
findBy: "default"
defineUrl: []
baseUrl: []
appWhiteList: []
urlBlackList: []
urlWhiteList: []
blackList:
- given: []
  when: null
  then: []
  xpath: ".*[0-9]{2}.*"
  action: null
  actions: []
  times: 0
beforeRestart: []
beforeElement:
- given: []
  when: null
  then: []
  xpath: "/*"
  action: "Thread.sleep(500)"
  actions: []
  times: 0
afterElement: []
afterPage: []
afterPageMax: 5
tagLimitMax: 3
tagLimit:
- {xpath: "//*[contains(@class, 'List')]//*", times: 1}
assertGlobal: []

共收到 5 条回复 时间 点赞

配置文件中不需要的统统删掉,只留你自己需要的部分

其他的行为配置错了,可能起反效果

配置文件跑起来了,不过一直在第一页不动;不用配置文件直接跑还能遍历一部分呢,不过遍历不全,想用配置文件增加遍历的内容,求问楼主跑起来效果咋样?

我研究的还是不深,所以没什么效果😂 感觉不是很好用,当然,这与自己能力有关系,期待其他大佬的分享

Trevor Wang 回复

我已经精简了一部分了,但是感觉还不是很好,遗留了上面的问题,感觉研究不够

游戏人间 回复

第一个问题我尝试优化过 还没有特别的改善

https://github.com/lgxqf/UICrawler 这个有没有看过

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册