支持社区,对我们帮助非常大,希望越来越好
@appium_test 请问使用 WebDriverAgent 的话是不是必须要有测试 app 的源码啊?xcodebuild -project 必须得是.xcodeproj 文件吗?
#8 楼 @chenhengjie123 好的,感谢!
#6 楼 @chenhengjie123 非常感谢!我试了一下
yefengjundeMacBook-Pro:WebDriverAgent yefengjun$ ./Scripts/bootstrap.sh
Fetching dependencies
Building Inspector
Creating bundle directory...
Fetching Inspector dependencies...
npm WARN react-treeview@0.4.6 requires a peer of react@>=0.14.0 but none was installed.
npm WARN web-driver-inspector@1.0.0 No repository field.
Building Inspector...
> web-driver-inspector@1.0.0 build /Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector
> webpack --progress --colors
Hash: 30b1e7620a314d43cf44
Version: webpack 1.14.0
Time: 4269ms
Asset Size Chunks Chunk Names
inspector.js 700 kB 0 [emitted] main
[0] multi main 28 bytes {0} [built]
+ 182 hidden modules
Done
这样就是可以了吧?这两个警告有影响吗?
#3 楼 @lunamagic -d 显示的是这样的,没有看到 building 啊?
bogon:WebDriverAgent yefengjun$ ./Scripts/bootstrap.sh -d
Fetching dependencies
bogon:WebDriverAgent yefengjun$
奇怪了,我把 WebDriverAgent 文件夹放到别的目录下之后运行./Scripts/bootstrap.sh 就成功了,回到原来 Appium 的目录下就不行
这是终端的信息
bogon:WebDriverAgent yefengjun$ ./Scripts/bootstrap.sh
Fetching dependencies
Building Inspector
Creating bundle directory...
Fetching Inspector dependencies...
npm WARN react-treeview@0.4.6 requires a peer of react@>=0.14.0 but none was installed.
npm WARN web-driver-inspector@1.0.0 No repository field.
Building Inspector...
> web-driver-inspector@1.0.0 build /Users/yefengjun/Documents/WebDriverAgent/Inspector
> webpack --progress --colors
Hash: 464241247f16d853b410
Version: webpack 1.14.0
Time: 1816ms
Asset Size Chunks Chunk Names
inspector.js 712 kB 0 [emitted] main
[0] multi main 28 bytes {0} [built]
+ 182 hidden modules
Done
@chenhengjie123 这个问题重新开了一个帖子,麻烦再帮忙看一下吧,感谢!我重新换了一个 WebDriverAgent 还是同样的问题。不知道怎么搞了....
#117 楼 @xlth1947 没有解决,我重新在 git 上下了一个 WebDriverAgent 跑了一下 终端上信息是:
2017-01-20 12:23:01.818 XCTRunner[6819:524048] *** Assertion failure in -[FBResponseFilePayload initWithFilePath:], /Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgentLib/Routing/FBResponseFilePayload.m:24
你跟我的情况一样吗?
#53 楼 @chenhengjie123 我重新下了个 WebDriverAgent,还是不行同样的问题,然后http://172.16.23.2:8100/inspector也报错了....
另一个版本的 wda 是哪个版本啊?在哪下呢?
#48 楼 @appium_test 您好,请问一下我在用 safari 访问http://172.16.23.2:8100 显示正常
{
"value" : "Unhandled endpoint: \/ -- http:\/\/172.16.23.2:8100\/ with parameters {\n wildcards = (\n \"\"\n );\n}",
"sessionId" : "AE6BF076-84FD-4C1C-8199-ABD2B3595E86",
"status" : 1
}
但是访问http://172.16.23.2:8100/inspector的时候浏览器中什么都没显示,没有显示页面元素啊。这是为什么呢?
#45 楼 @Lihuazhang @chenhengjie123 请问一下我在真机和模拟器上都能运行成功 WebDriverAgent,访问http://172.16.23.2:8100 也显示正常
{
"value" : "Unhandled endpoint: \/ -- http:\/\/172.16.23.2:8100\/ with parameters {\n wildcards = (\n \"\"\n );\n}",
"sessionId" : "AE6BF076-84FD-4C1C-8199-ABD2B3595E86",
"status" : 1
}
但是访问http://172.16.23.2:8100/inspector的时候浏览器中什么都没显示,没有像上面那样显示树形的页面元素。这是为什么呢?
还有个问题,我运行./Scripts/bootstrap.sh 的时候报错了不知道怎么解决,还请麻烦帮忙看一下
yefengjundeMacBook-Pro:WebDriverAgent yefengjun$ ./Scripts/bootstrap.sh
Fetching dependencies
Building Inspector
Creating bundle directory...
Fetching Inspector dependencies...
npm WARN react-treeview@0.4.6 requires a peer of react@>=0.14.0 but none was installed.
npm WARN web-driver-inspector@1.0.0 No repository field.
Building Inspector...
> web-driver-inspector@1.0.0 build /Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector
> webpack --progress --colors
Hash: 9ed7d0b85cc08341fd0f
Version: webpack 1.14.0
Time: 71ms
[0] multi main 28 bytes {0} [built] [1 error]
+ 1 hidden modules
ERROR in ./js/app.js
Module parse failed: /Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/js/app.js Unexpected token (59:4)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (59:4)
at Parser.pp$4.raise (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp.unexpected (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:603:10)
at Parser.pp$3.parseExprAtom (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1822:12)
at Parser.pp$3.parseExprSubscripts (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1692:19)
at Parser.pp$3.parseExprOps (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1597:21)
at Parser.pp$3.parseParenAndDistinguishExpression (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1861:32)
at Parser.pp$3.parseExprAtom (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1796:19)
at Parser.pp$3.parseExprSubscripts (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1715:21)
at Parser.pp$3.parseMaybeUnary (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1692:19)
at Parser.pp$3.parseExprOps (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1637:21)
at Parser.pp$3.parseMaybeConditional (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1620:21)
at Parser.pp$3.parseMaybeAssign (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1597:21)
at Parser.pp$3.parseExpression (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1573:21)
at Parser.pp$1.parseReturnStatement (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:839:33)
at Parser.pp$1.parseStatement (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:699:34)
at Parser.pp$1.parseBlock (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:981:25)
at Parser.pp$3.parseFunctionBody (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2105:24)
at Parser.pp$3.parseMethod (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2075:10)
at Parser.pp$1.parseClassMethod (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1137:25)
at Parser.pp$1.parseClass (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1118:14)
at Parser.pp$1.parseStatement (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:697:19)
at Parser.pp$1.parseTopLevel (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:638:25)
at Parser.parse (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:516:17)
at Object.parse (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:3098:39)
at Parser.parse (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/webpack/lib/Parser.js:902:15)
at DependenciesBlock.<anonymous> (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/webpack/lib/NormalModule.js:104:16)
at DependenciesBlock.onModuleBuild (/Users/yefengjun/Downloads/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Inspector/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
@ multi main
Done
#102 楼 @weamylady 我也是用 9.3 的真机可以运行,但是真机上 wda 打开之后就自动退到后台了,打开 wda 是黑屏的 第一次接触这个不太懂怎么用。你那也是这样的吗?
#116 楼 @chenhengjie123 好的我先看一下。谢谢了!
#114 楼 @chenhengjie123 哎,不好意思。刚开始测 ios 没多久 问题有点小白还请见谅....但是我现在不知道怎么添加开发证书。我装好测试包后去描述文件中没有看到要让我信任的证书..
#112 楼 @chenhengjie123 感谢!现在感觉问题就是出在手机没装签名的问题了。但是开发说已经把测试机的 uuid 加到概要文件中了,不需要再在描述文件那里信任添加签名证书,直接就能运行。所以现在卡在签名证书了.....
@chenhengjie123 您好还想再请教个问题。CrashMonkey4IOS 这个工具只能运行本地有工程的 app 吗?如果没有工程代码,只有开发提供的测试安装包 ipa 文件和 BundleID 如何能跑起来呢。我现在运行起来不启动真机上的 app
yefengjundeMacBook-Pro:~ yefengjun$ smart_monkey -a com.JDVideo -w 65aa3a56dcd0fcb6b8e4b3dc769bba4baf991562
INSTRUMENTS_TRACE_PATH : /Users/yefengjun/*.trace
RESULT_BASE_PATH : /Users/yefengjun/smart_monkey_result
{:app_path=>"com.JDVideo", :device=>"65aa3a56dcd0fcb6b8e4b3dc769bba4baf991562", :run_count=>1, :time_limit_sec=>nil, :detail_event_count=>50}
2016-12-19 13:44:32.164 instruments[6392:422777] WebKit Threading Violation - initial use of WebKit from a secondary thread.
=================================== Start Test (1/1) =======================================
2016-12-19 13:44:33.174 instruments[6404:422865] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:44:34.350 instruments[6412:422912] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:44:35.380 instruments[6418:422973] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:45:15.398 instruments[6442:425184] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:45:16.486 instruments[6448:425266] WebKit Threading Violation - initial use of WebKit from a secondary thread.
Attempting iOS device system log capture via deviceconsole.
2016-12-19 13:45:17.621 instruments[6455:425338] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:45:18.665 instruments[6464:425518] WebKit Threading Violation - initial use of WebKit from a secondary thread.
BundleID was found: com.JDVideo
Run: ["instruments", "-w", "65aa3a56dcd0fcb6b8e4b3dc769bba4baf991562", "-t", "/Applications/Xcode7.3.1.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate", "com.JDVideo", "-e", "UIASCRIPT", "/Users/yefengjun/smart_monkey_result/report_20161219134431/custom.js", "-e", "UIARESULTSPATH", "/Users/yefengjun/smart_monkey_result/report_20161219134431"]
2016-12-19 13:45:24.727 instruments[6472:425685] WebKit Threading Violation - initial use of WebKit from a secondary thread.
Stop iOS system log capture.
2016-12-19 13:45:29.455 instruments[6486:425903] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:45:30.383 instruments[6492:426019] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2016-12-19 13:45:31.429 instruments[6498:426060] WebKit Threading Violation - initial use of WebKit from a secondary thread.
我用 instruments -s devices 命令可以看到我连接的真机,测试包装在真机上用 smart_monkey --list-app 命令并不显示我这个 app。
还请麻烦帮忙看一下吧..谢谢!
@chenhengjie123 楼主你好,请问一下我想进行多个界面的测试怎么做呢?我运行起来只是在一个界面上面进行测试
@ankhkid 你好 我跟你的问题一样 请问你解决了吗