AppCrawler 使用了配置文件后启动报错 Exception in thread "main" scala.MatchError

steven · 2019年01月02日 · 最后由 f0rest 回复于 2019年01月21日 · 2490 次阅读

启动命令:java -jar appcrawler-2.4.0-jar-with-dependencies.jar -c config.yaml
报错信息:

019-01-02 19:27:05 INFO [AppCrawler$.203.parseParams] Find Conf /Users/steven/Tool/appcrawler/config.yaml
2019-01-02 19:27:05 INFO [AppCrawler$.223.parseParams] use default appium address 4723
2019-01-02 19:27:05 INFO [AppCrawler$.230.parseParams] appium address = Some(http://127.0.0.1:4723/wd/hub)
2019-01-02 19:27:05 INFO [AppCrawler$.242.parseParams] result directory = 20190102192704
2019-01-02 19:27:05 INFO [Crawler.130.start] set xpath attribute with List(name, label, value, resource-id, content-desc, instance, text)
2019-01-02 19:27:05 INFO [Crawler.135.start] set xpath
2019-01-02 19:27:05 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.TagLimitPlugin@48a0c8aa
2019-01-02 19:27:05 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.ReportPlugin@4cbc2e3b
2019-01-02 19:27:05 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.FreeMind@765ffb14
2019-01-02 19:27:05 INFO [TagLimitPlugin.19.init] com.testerhome.appcrawler.plugin.TagLimitPlugin init
2019-01-02 19:27:05 INFO [ReportPlugin.19.init] com.testerhome.appcrawler.plugin.ReportPlugin init
2019-01-02 19:27:05 INFO [FreeMind.19.init] com.testerhome.appcrawler.plugin.FreeMind init
2019-01-02 19:27:05 INFO [ReportPlugin.21.start] reportPath=/Users/steven/Tool/appcrawler/20190102192704
2019-01-02 19:27:05 INFO [ReportPlugin.24.start] create /Users/steven/Tool/appcrawler/20190102192704/tmp/ directory
2019-01-02 19:27:05 INFO [Crawler.138.start] prepare setup Appium
2019-01-02 19:27:05 INFO [Crawler.250.setupAppium] afterPageMax=2
2019-01-02 19:27:07 INFO [Crawler.273.setupAppium] use AppiumClient
2019-01-02 19:27:07 INFO [Crawler.274.setupAppium] Map(newCommandTimeout -> 120, launchTimeout -> 120000, platformVersion -> , platformName -> Android, appium -> http://127.0.0.1:4723/wd/hub, autoWebview -> false, autoLaunch -> true, noReset -> true, androidInstallTimeout -> 180000)
Exception in thread "main" scala.MatchError: [androidInstallTimeout, app, appium, autoLaunch, autoWebview, deviceName, launchTimeout, newCommandTimeout, noReset, platformName, platformVersion] (of class java.util.Collections$UnmodifiableSet)
    at com.testerhome.appcrawler.driver.AppiumClient.appium(AppiumClient.scala:94)
    at com.testerhome.appcrawler.driver.AppiumClient.<init>(AppiumClient.scala:40)
    at com.testerhome.appcrawler.Crawler.setupAppium(Crawler.scala:277)
    at com.testerhome.appcrawler.Crawler.start(Crawler.scala:139)
    at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:322)
    at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290)
    at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:91)
    at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

config.yaml:

logLevel: "TRACE"
reportTitle: ""    #指生成的HTML(index.html)报告头部显示的标题信息
saveScreen: true
screenshotTimeout: 20
currentDriver: "android"
showCancel: true
tagLimitMax: 5
tagLimit:
- xpath: //*[../*[@selected=‘true‘]]
  count: 12
maxTime: 10800
resultDir: ""   #结果文件夹名,给定后,将不动态命名
capability:
  newCommandTimeout: 120
  launchTimeout: 120000
  platformVersion: ""
  platformName: "Android"
  autoWebview: "false"
  autoLaunch: "true"
  noReset: "true"
  androidInstallTimeout: 180000
androidCapability:
  deviceName: ""
  appPackage: "***********"
  appActivity: ""  #写不写无所谓,因为APP会自动判别当前的activity是否正确,是不是launchActivity,如果不是则会报错
  dontStopAppOnReset: true
  app: ""
  appium: "http://0.0.0.0:4723/wd/hub"
  automationName: uiautomator2
  reuse: 3
headFirst: true
enterWebView: true
urlBlackList:
- //*[contains(@resource-id, "com.alipay.android.phone.openplatform:id/logout") and @clickable=‘true‘]   #登出
urlWhiteList:
backButton:
triggerActions:    # 主要解决登录的问题,当遇到登录输入框时,输入内容,比testcase更好用
- action: "63033023"
  xpath: "//*[@resource-id=‘com.ali.user.mobile.security.ui:id/userAccountInput‘]"
  times: 1
- action: "alipayhk123"
  xpath: "//*[@resource-id=‘com.ali.user.mobile.security.ui:id/userPasswordInput‘]"
  times: 1
- action: "click"
  xpath: "//*[@resource-id=‘com.ali.user.mobile.security.ui:id/loginButton‘]"
  times: 1

startupActions:
- swipe("left")
- swipe("left")
- swipe("left")

是不是配置文件哪里写错了

共收到 1 条回复 时间 点赞

capability 参数错了
androidCapability: 这行注掉

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册