思寒老师,能指导下diff功能的使用吗?
我用2.4.0版本报错
我用2.7.4版本提示没有 --diff命令
不知道是我使用的不对,还是程序的问题,期待老师回复
appcrawler 运行出错
2022-10-28 10:52:43 INFO [AppCrawler$.185.parseParams] Find Conf /Users/joyce/Downloads/test.yml
Exception in thread “main” com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (StringReader); line: 1, column: 1]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4766)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4668)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3630)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3598)
at com.ceshiren.appcrawler.utils.TData$.fromYaml(TData.scala:57)
at com.ceshiren.appcrawler.core.CrawlerConf.load(CrawlerConf.scala:253)
at com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:186)
at com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:73)
at com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
贴下你的配置文件
同问+1
老师,我就是用pycharm打开编辑保存的,也还是报这个错。而且pycharm中yaml中文乱码。请问还需要从哪里排查呢
android 12 vivo iqoo5 无法安装:io.appium.uiautomator2.server和io.appium.uiautomator2.sever.test 有遇到的吗?哪里有这2个安装包,自己安装
你的pycharm里是不是设置的编码不是utf8
name_$eq(“Steps”);
2023-02-04 15:59:35 DEBUG [SuiteToClass$.61.genTestCaseClass] write to D:\app_test\demo\20230204155707_com.maxus.settings/tmp/
2023-02-04 15:59:35 DEBUG [ScalaTestRuntime.42.runTestCase] -RD:\app_test\demo\20230204155707_com.maxus.settings/tmp/-oF-uD:\app_test\demo\20230204155707_com.maxus.settings-hD:\app_test\demo\20230204155707_com.maxus.settings
2023-02-04 15:59:35 INFO [ScalaTestRuntime.59.runTestCase] run -R D:\app_test\demo\20230204155707_com.maxus.settings/tmp/ -oF -u D:\app_test\demo\20230204155707_com.maxus.settings -h D:\app_test\demo\20230204155707_com.maxus.settings
An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
java.lang.RuntimeException: Error creating extended parser class: Could not determine whether class ‘org.pegdown.Parser$$parboiled’ has already been loaded
at org.parboiled.Parboiled.createParser(Parboiled.java:58)
at org.pegdown.PegDownProcessor.(PegDownProcessor.java:94)
at org.pegdown.PegDownProcessor.(PegDownProcessor.java:73)
at org.pegdown.PegDownProcessor.(PegDownProcessor.java:54)
at org.pegdown.PegDownProcessor.(PegDownProcessor.java:47)
at org.scalatest.tools.HtmlReporter.(HtmlReporter.scala:117)
at org.scalatest.tools.ReporterFactory.createHtmlReporter(ReporterFactory.scala:192)
at org.scalatest.tools.ReporterFactory.getReporterFromConfiguration(ReporterFactory.scala:239)
at org.scalatest.tools.ReporterFactory.$anonfun$createReportersFromConfigurations$1(ReporterFactory.scala:248)
at scala.collection.Iterator$$anon$9.next(Iterator.scala:575)
at scala.collection.immutable.List.prependedAll(List.scala:156)
at scala.collection.immutable.List$.from(List.scala:651)
at scala.collection.immutable.List$.from(List.scala:648)
at scala.collection.SeqFactory$Delegate.from(Factory.scala:306)
at scala.collection.immutable.Seq$.from(Seq.scala:42)
at scala.collection.immutable.Seq$.from(Seq.scala:39)
at scala.collection.IterableOps.map(Iterable.scala:671)
at scala.collection.IterableOps.map$(Iterable.scala:671)
at org.scalatest.tools.ReporterConfigurations.map(ReporterConfiguration.scala:42)
at org.scalatest.tools.ReporterFactory.createReportersFromConfigurations(ReporterFactory.scala:247)
at org.scalatest.tools.ReporterFactory.getDispatchReporter(ReporterFactory.scala:251)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1507)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1011)
at org.scalatest.tools.Runner$.run(Runner.scala:850)
at com.ceshiren.appcrawler.plugin.scalatest.ScalaTestRuntime.runTestCase(ScalaTestRuntime.scala:60)
at com.ceshiren.appcrawler.plugin.ReportPlugin.generateReport(ReportPlugin.scala:82)
at com.ceshiren.appcrawler.plugin.ReportPlugin.stop(ReportPlugin.scala:26)
at com.ceshiren.appcrawler.core.Crawler.$anonfun$stop$2(Crawler.scala:1290)
at com.ceshiren.appcrawler.core.Crawler.$anonfun$stop$2$adapted(Crawler.scala:1290)
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.$anonfun$stop$1(Crawler.scala:1290)
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.stop(Crawler.scala:1290)
at com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:237)
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)
Caused by: java.lang.RuntimeException: Could not determine whether class ‘org.pegdown.Parser$$parboiled’ has already been loaded
at org.parboiled.transform.AsmUtils.findLoadedClass(AsmUtils.java:213)
at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:35)
at org.parboiled.Parboiled.createParser(Parboiled.java:54)
… 41 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String) accessible: module java.base does not “opens java.lang” to unnamed module @59662a0b
at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:201)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:195)
at org.parboiled.transform.AsmUtils.findLoadedClass(AsmUtils.java:206)
… 43 more
我用的appcrawler-2.7.4-hogwarts.jar,appium版本为:1.18.3,分别试了两个JAVA版本(java 19.0.2 2023-01-17和 jdk-18.0.1.1),都报这个错误,请问是什么问题
切换到java17试试
刚刚试了下java17,还是不行,报相同的错误
先降低下java版本到11版本吧。17和18我还没试过。有些api可能被禁用了
还有每次xpath查找控件需要10秒,可不可以减少这个时间
你是不是运行了很久,查询慢多数是appium跑的太久了,导致他自己分析控件的时候开始变慢了
问一下android11版本上能跑吗,我总是跑不动,提示连接不上
[Appium] Appium v1.22.3 creating new AndroidUiautomator2Driver (v1.70.1) session
[Appium] Applying relaxed security to ‘AndroidUiautomator2Driver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “appium:appium”: “http://127.0.0.1:4723/wd/hub”,
[BaseDriver] “platformName”: “android”,
[BaseDriver] “appium:app”: “”,
[BaseDriver] “appium:appActivity”: “.activity.init.InitActivity”,
[BaseDriver] “appium:appPackage”: “com.baidu.homework”,
[BaseDriver] “appium:automationName”: “UiAutomator2”,
[BaseDriver] “appium:deviceName”: “7H17021000FES”,
[BaseDriver] “appium:dontStopAppOnReset”: true,
[BaseDriver] “appium:newCommandTimeout”: 120,
[BaseDriver] “appium:noReset”: “true”
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] Capability ‘noReset’ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] appium
[BaseDriver] Session created with session id: a05516a5-3619-4417-ba9a-7830df92337f
[UiAutomator2] Starting ‘com.baidu.homework’ directly on the device
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES shell am force-stop io.appium.uiautomator2.server.test’
[UiAutomator2] Starting UIAutomator2 server 4.27.0
[UiAutomator2] Using UIAutomator2 server from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’ and test from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[ADB] Creating ADB subprocess with args: [“-P”,5037,“-s”,“7H17021000FES”,“shell”,“am”,“instrument”,“-w”,“-e”,“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[WD Proxy] socket hang up
[UiAutomator2] The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of ‘uiautomator2ServerLaunchTimeout’ capability
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8201
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES forward --remove tcp:8201’
[UiAutomator2] Restoring hidden api policy to the device default configuration
[ADB] Running ‘G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[BaseDriver] Event ‘newSessionStarted’ logged at 1677135378386 (14:56:18 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of ‘uiautomator2ServerLaunchTimeout’ capability
[W3C] at Object.errorAndThrow (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:94:35)
[W3C] at UiAutomator2Server.startSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:236:15)
[W3C] at runMicrotasks ()
[W3C] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:416:5)
[W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:229:7)
[W3C] at AppiumDriver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\lib\appium.js:387:35)
[HTTP] ← POST /wd/hub/session 500 39780 ms - 1151
[HTTP]
然后在android9的机器上就能跑
命令是这个:
java -jar appcrawler-2.7.4-hogwarts.jar -c config_baidu_homework.yaml --capability automationName=UiAutomator2
config_baidu_homework.yaml
capability:
appPackage: “com.baidu.homework”
appActivity: “.activity.init.InitActivity”
dontStopAppOnReset: true
deviceName: “7H17021000FES”
newCommandTimeout: 300
implicitlyWaitTestCase: 300
implicitlyWaitCrawl: 300
maxTime: 1800
maxDepth: 10
执行这个命令超时了,你去看看这个命令的执行结果是啥
G:\Users\Administrator\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 7H17021000FES shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’
可能跟特定机型限制了权限有关系,本质属于appium的问题。
咨询下大佬,appcrawler3.0版本发布了吗?是不是需要付费,付费后再 哪里能获取到?
不好意思,因为工作太忙,拖了好久,为了方便大家,我们正在用python和java重写。
我们公司也帮一些客户打造了一些专业版本,主要是帮他们解决一些小程序、公众号、游戏、pc等特殊领域的自动化测试,通过打造一些领域特定的自动化驱动引擎来实现的,所以中间改造了下appcrawler支持插件也耽误了一些时间。
appcrawler本身是开源的,Android和Web的遍历能力也是长期支持的,我主要是对已有的架构不满意,希望大升级一次,把完整能力的自动化测试、自动遍历、数据驱动、模型驱动结合起来。下个版本的发布时间是5月前后,还得等2个月。
好滴,感谢思寒大佬答疑解惑, 5月份前后发布的appcrawler 3.0.0版本还是和之前版本一样开源免费是吧?