crawl not finish, return with exception,有没人知道这个异常怎么解决呢?

2022-03-16 18:23:11 INFO [Crawler.185.$anonfun$waitAppLoaded$1] wait for app loaded
2022-03-16 18:23:11 INFO [Crawler.693.refreshPage] refresh page
2022-03-16 18:23:11 INFO [ReactWebDriver.88.getPageSourceWithRetry] start to get page source from appium
2022-03-16 18:23:11 ERROR [Crawler.221.crawlWithRetry] crawl not finish, return with exception
2022-03-16 18:23:11 ERROR [Crawler.222.crawlWithRetry] null
2022-03-16 18:23:11 ERROR [Crawler.223.crawlWithRetry] NullPointerException:
2022-03-16 18:23:11 ERROR [Crawler.224.crawlWithRetry] java.lang.NullPointerException
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] java.lang.NullPointerException
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.driver.ReactWebDriver.getNodeListByKey(ReactWebDriver.scala:262)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.getURIElementsByStep(Crawler.scala:849)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.$anonfun$getElementByTriggerActions$2(Crawler.scala:1267)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.$anonfun$getElementByTriggerActions$2$adapted(Crawler.scala:1265)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.getElementByTriggerActions(Crawler.scala:1265)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.crawl(Crawler.scala:976)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.$anonfun$crawlWithRetry$1(Crawler.scala:214)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at scala.util.Try$.apply(Try.scala:210)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:214)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:171)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:319)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:286)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:73)
2022-03-16 18:23:11 ERROR [Crawler.225.$anonfun$crawlWithRetry$2] at com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
2022-03-16 18:23:11 ERROR [Crawler.226.crawlWithRetry] create new session
Exception in thread “main” java.lang.NullPointerException
at com.ceshiren.appcrawler.driver.ReactWebDriver.getNodeListByKey(ReactWebDriver.scala:262)
at com.ceshiren.appcrawler.core.Crawler.getURIElementsByStep(Crawler.scala:849)
at com.ceshiren.appcrawler.core.Crawler.$anonfun$getElementByTriggerActions$2(Crawler.scala:1267)
at com.ceshiren.appcrawler.core.Crawler.$anonfun$getElementByTriggerActions$2$adapted(Crawler.scala:1265)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
at com.ceshiren.appcrawler.core.Crawler.getElementByTriggerActions(Crawler.scala:1265)
at com.ceshiren.appcrawler.core.Crawler.crawl(Crawler.scala:976)
at com.ceshiren.appcrawler.core.Crawler.$anonfun$crawlWithRetry$1(Crawler.scala:214)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.util.Try$.apply(Try.scala:210)
at com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:214)
at com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:171)
at com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:319)
at com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:286)
at com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:73)
at com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)

应该是你的appium的page source没有返回正确的内容,时间跑久了,appium不稳定吧

常见的几个问题

  • appium page source报错
  • appium page source里有非法字符之类的

你可以看看前面的日志里打印的page source是什么样的

[Crawler.373.getUri] defineUrl=
请问这个问题会和页面控件没被点击有关系吗?

用例配置如下
image
日志如下

你贴的都是正常的日志吧,错误部分没贴出来。 把log文件上传上来,配置文件也有文本贴下

这个应该是blacklist被你注销了 没有加上所致