#28 楼 @seveniruby 谢谢了 已经解决了,直接用 WEBVIEW 或者 WEBVIEW_com....就可以,用 WEBVIEW_0 就不行。
#4 楼 @panzhigang 已经搞定了,谢谢啊。
#1 楼 @panzhigang els = self.driver.find_elements_by_xpath('/html/head/title')
print len(els)
print els[0].text
嗯,我换成这样的话获取的 len 是 1.但是 els[0].text 内容为什么是空的呢?
#4 楼 @lihuazhang 我发现 driver.switch_to.context('WEBVIEW') 成功后,手机一直停到当前页面,下一步应该怎么去获取 webview 的内容呢? 是要 browser = webdriver.Chrome() 吗?
#14 楼 @seveniruby 我机器是 4.4.4 的,打印出的 driver.content 是 [u'NATIVE_APP', u'WEBVIEW_com.android.browser', u'WEBVIEW_com.oumg, u'WEBVIEW_com.qihoo.appstore'],但是为什么我执行 driver.switch_to.context('WEBVIEW_0'),为什么还是报 NoSuchContextException: Message: u'No such context found.' ?
#4 楼 @lihuazhang 这个是什么意思呢?是意思 browser=webdriver.Firefox() 这样吗?就像 seleniun 那样? 还是? appium 怎么搭配 webdriver 中的 api 呢?
#8 楼 @lihuazhang 是不是必须 4.4.2 系统以上?
#1 楼 @lihuazhang 需要被测手机的对应虚拟机下载好了才能跑起来吗?
你把登陆封装起来,去调用它。
#6 楼 @seveniruby 那您建议是看那个参数呢?如果用 adb shell dumpsys meminfo 中 Davilk 对应的 Heap
Alloc 靠谱吗?
#10 楼 @monkey这个用 appium 跑到 log 和 automation 的情况一样,都是脚本在跑,但是 app 界面卡死在首个界面,请大神帮忙分析下,使用 xcode5 都是可以跑起来的,但是 xcode6.1.1 就不行了。
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 6b068aca-e2a4-44ee-9c0f-88f057a4ab12
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
parseFileSync()
is deprecated. Use parseStringSync()
instead.
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com. Ace/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com. Ace/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings; assuming it doesn't exist
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/Ace/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/Ace/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js
info: [debug] Reusing dynamic bootstrap: /Users/Ace/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iOS","platformVersion":"8.0"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iOS (8.0 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid a15a5c8e453d2aff23ee73d3627e3691894fc1e8
info: [debug] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id a15a5c8e453d2aff23ee73d3627e3691894fc1e8 --bundle com. Ace
info: [debug] App is installed.
info: [debug] fullReset not requested. No need to install.
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 real device with UDID a15a5c8e453d2aff23ee73d3627e3691894fc1e8
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 a15a5c8e453d2aff23ee73d3627e3691894fc1e8 com. Ace -e UIASCRIPT "/Users/Ace/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-12-14 21:10:12.522 instruments[2025:6403] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod kernel[0] : xpcproxy[938] Container: /private/var/mobile/Containers/Data/Application/1C796F3E-4AA1-45E2-BD54-C13D085CDDF8 (sandbox)
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod Ace[938] : MS:Notice: Injecting: com. Ace Ace
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod locationd[120] : Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod ScriptAgent[939] : MS:Notice: Injecting: com.apple.UIAutomationPlugIn ScriptAgent
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod notification_proxy[281] : 0x303000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:11 Administratorde-iPod notification_proxy[281] : 0x281000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:12 Administratorde-iPod Ace[938] : assertion failed: 12A365: libxpc.dylib + 51955 [84E1BEE3-B897-39DD-9A7B-D061B6B252C5]: 0x7d
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:12 Administratorde-iPod Unknown[938] :
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:12 Administratorde-iPod pasteboardd[941] : MS:Notice: Injecting: (null) pasteboardd
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:12 Administratorde-iPod Ace[938] : registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : img
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 111spring
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_11
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_33
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_21
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_12
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222tutorials_more
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222tutorials_switchingChannel
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_31
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222whitePoint
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: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222bluePoint
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222tutorials_editChannels
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_22
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_13
info: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[938] : 222spring_car
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: [IOS_SYSLOG_ROW ] Dec 14 21:10:13 Administratorde-iPod Ace[93
#1 楼 @michaelian 怎么用 selendroid 模式呢? api 和 appium 有区别吗?
#4 楼 @lifreshman 是的,是真机。