额,我分享这个的目的不是想让大家讨论抢票软件本身,只是想让大家开阔一下思维,遇到用常规方法做不了的事情时就突破常规,用非常规方法来解决。
框架/工具用得多很容易局限在它们以内。框架只是辅助工具,如同这里的百度识图一样。我们的价值不是熟练使用各种框架/工具,而是能快速找到合适的方法、采用合适的工具、以尽量快和低成本的方式解决问题。
个人觉得,测试和开发的主要区别就在于测试更需要开阔的眼界和思维,能跳出编程固有的思路来解决问题。这也是我选择做测试的原因之一。
刚刚用 appium 1.3.4.1 的 exe 试了一下(使用 python client):
username = self.driver.find_element_by_id("xxx")
username.send_keys("test")
username.send_keys("abcdefg")
执行完后 username 框的内容为"testabcdefg"
改为:
username = self.driver.find_element_by_id("xxx")
username.send_keys("test")
username.clear()
username.send_keys("abcdefg")
执行完后 username 框的内容为"abcdefg"
@adfghzhang 你可以试试加上 clear() 方法。
从日志上看,有可能是这里出的问题:
Pushing command to appium work queue: ["element:setText",{"elementId":"20","text":"2015-03-20","replace":false,"unicodeKeyboard":true}]
此处的"replace":false
可能会让 sendKeys 在原有字符在不清空的情况下继续输入。
@tspring 能否帮忙让你们组相应组员查查 BOOTSTRAP 这边对于"replace":false
实际是怎么执行的?
我们组这边会看看 1.3.4.1 的 Server 端在
> info: --> POST /wd/hub/session/4adf2a57-f5d7-4c32-9f2d-64621d825d7a/element/20/value {"id":"20","value":["2015-03-20"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"20","text":"2015-03-20","replace":false,"unicodeKeyboard":true}]
这两行日志之间根据什么设定replace
的。
另外,@adfghzhang 能否提供一下你使用的 client 的语言和版本?谢谢。
PS:我这边使用 python 的 Appium-Python-Client==0.11 作为客户端,Appium 1.2.0 作为服务端,真机使用 Android 4.3,使用 send_keys() 方法会清空输入框后再输入。
果断收藏~
赞一个!
robotframework 的测试用例用文本编辑器写确实比较费劲,而且介乎于表格与编程语言之间,编程的写得费劲,手工的表示看不懂。不过优势是根据编写方式的不同有很强的适应性,既可以关键字驱动,也可以数据驱动或者其他驱动方式。
PS:我们项目目前测试框架的 Mobile 部分就是基于 appiumlibrary 的,实际使用过程中会发现它提供的方法远不能满足项目需要,不少方法还得自己写。。。
#9 楼 @myf_1127 inspector 能正常打开的前提是被测应用已经被 appium 打开了。
对应文档:https://github.com/appium/appium-dot-app#inspector--recorder
有点失落很正常,毕竟是自己带领团队做出来的东西,团队成员未经允许就拿走了,换做我也会失落一段时间。
但换个角度想想,随着业务发展,这些旧代码肯定要修改/重构,他最多也就是带走了一个目前可用的工具,工具不改进很快就会被淘汰的。
至于追究责任,这是公司的事情了,你也没必要太操心。
#24 楼 @weamylady 同上,我也不是大神。我目前对 Appium 以外的框架都停留在了解水平。。。
关于第二个解决方案,那个 js 文件的注释不就写了怎么运行嘛:
/*
* Small tool, launching and monitoring ios-web-kit-proxy, and relauching
* on predefined errors.
*
* Usage:
* ./bin/ios-webkit-debug-proxy-launcher.js [args]
* args: ios-webkit-debug-proxy args (they will be passed over)
*
* Example:
* ./bin/ios-webkit-debug-proxy-launcher.js -c <UDID>:27753 -d
*
* Note:
* For iOS8.1 try this first:
* brew install --HEAD ideviceinstaller
*/
就是装了 node.js 后,运行./bin/ios-webkit-debug-proxy-launcher.js [args]
(这里的路径你自己知道怎么改了吧,参数列表请看https://github.com/google/ios-webkit-debug-proxy说明)。如果是 iOS 8.1,先用brew install --HEAD ideviceinstaller
安装 ideviceinstaller 后再运行ios-webkit-debug-proxy-launcher.js
然后建议你完整阅读这里的文档先:
https://github.com/testerhome/appium/tree/master/docs/cn/appium-setup
解决问题建议首先查文档,然后找官方论坛,然后 google,最后发帖。
你需要的是--full-reset
。
请提问关于 appium 的问题前先看看这个帖子:http://testerhome.com/topics/2182
尽量自己解决,解决不了也至少知道具体卡在那里了
你是不是没有把 appium.app 从 dmg 拷到 application 文件夹……
/Volumes/Appium
明显是挂载的 dmg 镜像地址……
如果后面还有Couldn't find ideviceinstaller
错误,请看官方 issue:https://github.com/appium/appium/issues/2276
工作年限不够……
既然是大公司,建议加上公司名称吧。
PS:最后一句 欢迎资讯 应该是 欢迎咨询 吧?
#34 楼 @mingway_hu 谢谢!抱歉那时候没看到……
#7 楼 @lihuazhang 有这功能吗?
我看到首页的帖子貌似每天都在变,最前面的总是最新的。
我觉得有些帖子还是需要置顶的,可以仿照其他论坛把置顶帖做成合集,甚至把某个 wiki 置顶也行。如【安装包】Appium 国内下载地址(百度云盘,已更新至 1.3.6),这个帖子就很值得置顶。
@mingway_hu 可以把我们开源团队最近完成的新的翻译文档链接附上吗?
文档地址:https://github.com/appium/appium/tree/master/docs/cn
谢谢!
#4 楼 @seveniruby 我建议增加置顶帖这个功能,把一些小白经常问的问题放在置顶帖。
你说的功能非常不错!能具体说说吗?应用源代码变更量大吗?
@xuxu 好主意,欢迎各位遇到其它错误后在这里跟帖补充,让新手们更快学会自主解决问题。
#8 楼 @anonymity 最后两行是程序入口。加上这两行就能直接运行这个 py 文件来杀进程了。
#2 楼 @weamylady 估计按照 google 规划,webview 是 chromedriver 来负责的,android 的测试框架专心搞原生应用。
Appium 文档里明确写了 chrome 在 x86 模拟器上除非自己编译,否则是装不上或者存在各种问题的。请用 avd 的 arm 模拟器或真机。
文档地址:
英文原文:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/mobile-web.md
中文译文:https://github.com/testerhome/appium/blob/master/docs/cn/writing-running-appium/mobile-web.cn.md
附上一下我能正常启动的 Log,用的是和你附上的一模一样的代码。appium 版本 1.3.4,mac:10.10.1:
...
info: [debug] Not pre-launching simulator
info: [debug] Not installing to real device since we're on sim
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.1 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 5 (8.1 Simulator)" com.apple.mobilesafari -e UIASCRIPT "/Users/hengjiechen/Library/Application Support/appium/bootstrap/bootstrap-a4a902c9cce7b6cb.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST] Waiting for device to boot...
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"},"isShuttingDown":false},"sessionId":"ac192025-332c-4922-9c67-851dd6c93fa6"}
info: <-- GET /wd/hub/status 200 4.170 ms - 178 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"},"isShuttingDown":false},"sessionId":"ac192025-332c-4922-9c67-851dd6c93fa6"}
info: Instruments is ready to receive commands
info: [debug] Instruments launched. Starting poll loop for new commands.
info: [debug] Setting bootstrap config keys/values
info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
info: [debug] Socket data received (2 bytes)
info: [debug] Socket data being routed.
info: [debug] Sending command to instruments: target = $.target();
au = $;
$.isVerbose = true;
info: [debug] [INST] 2015-03-13 14:44:54 +0000 Debug: evaluation finished
2015-03-13 14:44:54 +0000 Debug: responding with:
info: [debug] [INST] 2015-03-13 14:44:54 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
info: [debug] Socket data received (27 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":true}
info: [debug] Setting initial orientation to PORTRAIT
info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
对比 log 可以发现你第一条和我不一样的 log 为:
info: [debug] [INST STDERR] 2015-03-13 14:47:06.294 instruments[873:31261] WebKit Threading Violation - initial use of WebKit from a secondary thread.
查找 stackoverflow 找到:http://stackoverflow.com/questions/25919234/webkit-threading-violation-initial-use-of-webkit-from-a-secondary-thread-in-ui。 大致解释是这是由 Xcode 6 命令行工具变化引起的。
你去那里看看能否解决你的问题?
PS:这不是 appium 的问题,是 Instruments 启动 Simulator 的问题,请对症下药,不要纠结 appium。
Sorry,刚才下好 drozer 后试了一下,发现你这条命令在我这里运行正常:
drozer Console (v2.3.4)
dz> run app.package.list -f sieve
com.mwr.example.sieve (Sieve)
app.package.list
前后无论是否加单引号都可以正常执行。
因为重现不了你的问题,所以只能帮到这里了。