appCrawler关于web遍历怎么执行操作呢?

之前MTSC上2.6版本是支持web遍历的。看2.7版本的源码里面也有webdriver,但没执行成功。

执行指令:
java -jar appcrawler-2.7.0.jar --capability “automationName=selenium,browserName=chrome,app=http://www.baidu.com” -u “http://127.0.0.1:4444/wd/hub” -o log

问题如下:
log4j:WARN No appenders could be found for logger (com.ceshiren.appcrawler.utils.Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See Apache log4j 1.2 - Frequently Asked Technical Questions for more info.
2021-11-06 19:42:15 DEBUG [Log.191.parseParams] config=
2021-11-06 19:42:15 DEBUG [Log.192.parseParams] Param(,false,false,http://127.0.0.1:4444/wd/hub,log,0,,,,,false,Map(automationName → selenium, browserName → chrome, app → http://www.baidu.com),)
2021-11-06 19:42:15 INFO [Log.249.parseParams] result directory = log
2021-11-06 19:42:15 DEBUG [Log.251.parseParams] yaml config
2021-11-06 19:42:15 DEBUG [Log.252.parseParams] — {}

2021-11-06 19:42:15 INFO [Log.25.initLog] console already exist
2021-11-06 19:42:15 INFO [Log.340.addLogFile]

appcrawler 全平台自动遍历测试工具
Q&A: appcrawler - 测试人社区
author: seveniruby

2021-11-06 19:42:15 DEBUG [Log.56.getGlobalEncoding] default Charset=GBK
2021-11-06 19:42:15 DEBUG [Log.57.getGlobalEncoding] default file.encoding=GBK
2021-11-06 19:42:15 DEBUG [Log.58.getGlobalEncoding] project directory=null
2021-11-06 19:42:15 INFO [Log.130.start] set xpath attribute with List(name(), name, label, value, resource-id, content-desc, text, id, name, innerText, tag, class)
2021-11-06 19:42:15 INFO [Log.101.$anonfun$loadPlugins$4] com.ceshiren.appcrawler.plugin.TagLimitPlugin@1d46303
2021-11-06 19:42:15 INFO [Log.101.$anonfun$loadPlugins$4] com.ceshiren.appcrawler.plugin.ReportPlugin@4541c
2021-11-06 19:42:15 INFO [Log.101.$anonfun$loadPlugins$4] com.ceshiren.appcrawler.plugin.FreeMind@2c2a9
2021-11-06 19:42:15 INFO [Log.23.init] com.ceshiren.appcrawler.plugin.TagLimitPlugin init
2021-11-06 19:42:15 INFO [Log.23.init] com.ceshiren.appcrawler.plugin.ReportPlugin init
2021-11-06 19:42:15 INFO [Log.23.init] com.ceshiren.appcrawler.plugin.FreeMind init
2021-11-06 19:42:15 INFO [Log.33.initReportPath] reportPath=D:\log
2021-11-06 19:42:15 INFO [Log.35.initReportPath] testcaseDir=D:\log/tmp/
2021-11-06 19:42:15 INFO [Log.137.start] prepare setup Appium
2021-11-06 19:42:15 INFO [Log.273.setupAppium] afterAllMax=2
2021-11-06 19:42:16 INFO [Log.279.setupAppium] selenium
2021-11-06 19:42:16 INFO [Log.33.] url=http://127.0.0.1:4444/wd/hub
Exception in thread “main” org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘LAPTOP-DLDUM295’, ip: ‘192.168.146.1’, os.name: ‘Windows 10’, os.arch: ‘x86’, os.version: ‘10.0’, java.version: ‘1.8.0_201’
Driver info: driver.version: SeleniumDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:573)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at com.ceshiren.appcrawler.driver.SeleniumDriver.(SeleniumDriver.scala:37)
at com.ceshiren.appcrawler.core.Crawler.setupAppium(Crawler.scala:282)
at com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:138)
at com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:333)
at com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:300)
at com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:84)
at com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
Caused by: java.net.ConnectException: Failed to connect to /127.0.0.1:4444
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
… 10 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245)
… 32 more

找个时间我写个教程吧

辛苦思寒大大啦~

关闭