无法滑动屏幕,报错:UiAutomator exited unexpectedly with code 143, signal null

来源:1-10 driver和滑动函数封装结合

慕九州8263646

2019-08-27

日志信息

[Appium] Welcome to Appium v1.7.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“capabilities”:{“firstMatch”:[{“appium:deviceName”:“XEGNW18404002042”,“appium:app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”}]},“desiredCapabilities”:{“deviceName”:“XEGNW18404002042”,“app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“deviceName”:“XEGNW18404002042”,“app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”},null,{“firstMatch”:[{“appium:deviceName”:“XEGNW18404002042”,“appium:app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1566919432173 (23:23:52 GMT+0800 (中国标准时间))
[Appium] Merged W3C capabilities {“firstMatch”:[{“appium:deviceName”:“XEGNW18404… into desiredCapabilities object {“deviceName”:“XEGNW18404002042”,“app”:“D:Bai…
[Appium] Creating new AndroidDriver (v1.37.0) session
[Appium] Capabilities:
[Appium] deviceName: XEGNW18404002042
[Appium] app: D:BaiduNetdiskDownloadmukewang.apk
[Appium] platformName: Android
[BaseDriver] Session created with session id: 3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_181
[ADB] Checking whether adb is present
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[AndroidDriver] Using device: XEGNW18404002042
[ADB] Checking whether adb is present
[ADB] Setting device id to XEGNW18404002042
[BaseDriver] Using local app ‘D:BaiduNetdiskDownloadmukewang.apk’
[AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: [”-P”,5037,"-s",“XEGNW18404002042”,“wait-for-device”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“echo”,“ping”]
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: ‘undefined’ and country: ‘undefined’
[Logcat] Starting logcat capture
[AndroidDriver] Pushing settings apk to device…
[ADB] Getting install status for io.appium.settings
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“list”,“packages”,“io.appium.settings”]
[ADB] App is installed
[ADB] Getting package info for io.appium.settings
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[ADB] Checking whether aapt is present
[ADB] The installed ‘io.appium.settings’ package does not require upgrade (5 >= 5)
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“getprop”,“ro.build.version.sdk”]
[ADB] Current device property ‘ro.build.version.sdk’: 28
[ADB] Device API level: 28
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“dump”,“io.appium.settings”]
[ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“ps”]
[ADB] Device API level: 28
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“appops”,“set”,“io.appium.settings”,“android:mock_location”,“allow”]
[AndroidDriver] Pushing unlock helper app to device…
[ADB] Getting install status for io.appium.unlock
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“list”,“packages”,“io.appium.unlock”]
[ADB] App is installed
[ADB] Getting package info for io.appium.unlock
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“dumpsys”,“package”,“io.appium.unlock”]
[ADB] Checking whether aapt is present
[ADB] The installed ‘io.appium.unlock’ package does not require upgrade (2 >= 2)
[ADB] Getting device platform version
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“getprop”,“ro.build.version.release”]
[ADB] Current device property ‘ro.build.version.release’: 9
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“wm”,“size”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“getprop”,“ro.product.model”]
[ADB] Current device property ‘ro.product.model’: FLA-AL10
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“getprop”,“ro.product.manufacturer”]
[ADB] Current device property ‘ro.product.manufacturer’: HUAWEI
[AndroidDriver] Parsing package and activity from app manifest
[ADB] Checking whether aapt is present
[ADB] Extracting package and launch activity from manifest
[ADB] badging package: cn.com.open.mooc
[ADB] badging act: cn.com.open.mooc.index.splash.MCSplashActivity
[AndroidDriver] Parsed package and activity are: cn.com.open.mooc/cn.com.open.mooc.index.splash.MCSplashActivity
[AndroidDriver] Remote apk path is /data/local/tmp/ad752f3781627681e20bb657ecc49d28.apk
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“ls”,"/data/local/tmp/ad752f3781627681e20bb657ecc49d28.apk"]
[AndroidDriver] Checking if app is installed
[ADB] Getting install status for cn.com.open.mooc
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“list”,“packages”,“cn.com.open.mooc”]
[ADB] App is installed
[AndroidDriver] Apk is already on remote and installed, resetting
[AndroidDriver] Running fast reset (stop and clear)
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“am”,“force-stop”,“cn.com.open.mooc”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“pm”,“clear”,“cn.com.open.mooc”]
[AndroidDriver] Extracting strings from apk D:BaiduNetdiskDownloadmukewang.apk undefined C:Users959AppDataLocalTempcn.com.open.mooc
[ADB] Extracting strings for language: default
[ADB] Device API level: 28
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“getprop”,“persist.sys.locale”]
[ADB] Current device property ‘persist.sys.locale’: zh-Hans-CN
[ADB] No strings.xml for language ‘zh’, getting default strings.xml
[ADB] Reading strings from converted strings.json
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“push”,“C:Users959AppDataLocalTempcn.com.open.moocstrings.json”,"/data/local/tmp"]
[AndroidBootstrap] Watching for bootstrap disconnect
[ADB] Forwarding system: 4724 to device: 4724
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“forward”,“tcp:4724”,“tcp:4724”]
[UiAutomator] Starting UiAutomator
[UiAutomator] Moving to state ‘starting’
[UiAutomator] Parsing uiautomator jar
[UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“push”,“C:Users959AppDataLocalProgramsappium-desktop
esourcesapp
ode_modulesappium
ode_modulesappium-android-bootstrapootstrapinAppiumBootstrap.jar”,"/data/local/tmp/"]
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“ps”]
[ADB] Attempting to kill process 12441
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“kill”,"-0",12441]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“kill”,12441]
[UiAutomator] UiAutomator exited unexpectedly with code 143, signal null
[UiAutomator] Moving to state ‘stopped’
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was ‘UiAUtomator shut down unexpectedly’
[Appium] Removing session e3b22ed2-5a1a-40a6-bae8-ad509ce7abb8 from our master session list
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“am”,“force-stop”,“cn.com.open.mooc”]
[ADB] Getting connected devices…
[ADB] Pressing the HOME button
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“kill”,12441]
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“input”,“keyevent”,3]
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“kill”,12441]
[UiAutomator] Starting UIAutomator
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“cn.com.open.mooc”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false]
[AndroidBootstrap] Cannot shut down Android bootstrap; it has already shut down
[Logcat] Stopping logcat capture
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[UiAutomator] Moving to state ‘online’
[AndroidBootstrap] Android bootstrap socket is now connected
[ADB] Getting connected devices…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“dumpsys”,“window”]
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] Device API level: 28
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“am”,“start”,"-W","-n",“cn.com.open.mooc/cn.com.open.mooc.index.splash.MCSplashActivity”,"-S"]
[ADB] Waiting up to 20000ms for activity matching pkg: ‘cn.com.open.mooc’ and activity: ‘cn.com.open.mooc.index.splash.MCSplashActivity’ to be focused
[ADB] Possible activities, to be checked: ‘cn.com.open.mooc.index.splash.MCSplashActivity’
[ADB] Getting focused package and activity
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘D:BaiduNetdiskDownloadSdkplatform-toolsadb.exe’ with args: ["-P",5037,"-s",“XEGNW18404002042”,“shell”,“dumpsys”,“window”,“windows”]
[ADB] Found package: ‘cn.com.open.mooc’ and fully qualified activity name : ‘cn.com.open.mooc.index.splash.MCSplashActivity’
[Appium] New AndroidDriver session created successfully, session 3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e added to master session list
[BaseDriver] Event ‘newSessionStarted’ logged at 1566919447659 (23:24:07 GMT+0800 (中国标准时间))
[MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“deviceName”:“XEGNW18404002042”,“app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”},“deviceName”:“XEGNW18404002042”,“app”:“D:BaiduNetdiskDownloadmukewang.apk”,“platformName”:“Android”,“deviceUDID”:“XEGNW18404002042”,“platformVersion”:“9”,“deviceScreenSize”:“1080x2160”,“deviceModel”:“FLA-AL10”,“deviceManufacturer”:“HUAWEI”,“appPackage”:“cn.com.open.mooc”,“appWaitPackage”:“cn.com.open.mooc”,“appActivity”:“cn.com.open.mooc.index.splash.MCSplashActivity”,“appWaitActivity”:“cn.com.open.mooc.index.splash.MCSplashActivity”}
[HTTP] <-- POST /wd/hub/session 200 15487 ms - 825
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 18 ms - 100
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 9 ms - 100
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 11 ms - 100
[HTTP] --> POST /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/touch/perform {“sessionId”:“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”,“actions”:[{“action”:“press”,“options”:{“y”:1019,“x”:972}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“y”:1019,“x”:108}},{“action”:“release”,“options”:{}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“y”:1019,“x”:972}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“y”:1019,“x”:108}},{“action”:“release”,“options”:{}}],“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:972,“startY”:1019,“endX”:108,“endY”:1019,“steps”:22}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:972,“startY”:1019,“endX”:108,“endY”:1019,“steps”:22}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: swipe
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,2038]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,2038]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Swiping from [x=972.0, y=1019.0] to [x=108.0, y=1019.0] with steps: 22
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.performTouch() result: true
[HTTP] <-- POST /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/touch/perform 200 442 ms - 76
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 10 ms - 100
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 17 ms - 100
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[HTTP] --> GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size {}
[MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:2038,“width”:1080}
[HTTP] <-- GET /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/window/current/size 200 11 ms - 100
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:2038,“width”:1080}}
[HTTP] --> POST /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/touch/perform {“sessionId”:“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”,“actions”:[{“action”:“press”,“options”:{“y”:1019,“x”:972}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“y”:1019,“x”:108}},{“action”:“release”,“options”:{}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“y”:1019,“x”:972}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“y”:1019,“x”:108}},{“action”:“release”,“options”:{}}],“3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:972,“startY”:1019,“endX”:108,“endY”:1019,“steps”:22}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:972,“startY”:1019,“endX”:108,“endY”:1019,“steps”:22}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: swipe
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,2038]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,2038]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Swiping from [x=972.0, y=1019.0] to [x=108.0, y=1019.0] with steps: 22
[AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/3eb8e1dc-4ff1-451a-82ec-e3b711a41f8e/touch/perform 500 334 ms - 154
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:13,“value”:“The swipe did not complete successfully”}

**

代码

**

#coding=utf-8
from appium import webdriver
def get_driver():
capabilities = {
“platformName”: “Android”,
“deviceName”: “XEGNW18404002042”,
“app”: “D:BaiduNetdiskDownloadmukewang.apk”
}
driver = webdriver.Remote(“http://127.0.0.1:4723/wd/hub”,capabilities)
return driver

#获取屏幕的高度
def get_size():
size = driver.get_window_size()
width = size[‘width’]
height = size[‘height’]
return width,height

#向左边滑动
def swipe_left():
#[100,200]
x1 = get_size()[0]/10*9
y1 = get_size()[1]/2
x = get_size()[0]/10
driver.swipe(x1,y1,x,y1)

#向右边滑动
def swipe_right():
#[100,200]
x1 = get_size()[0]/10
y1 = get_size()[1]/2
x = get_size()[0]/10*9
driver.swipe(x1,y1,x,y1)

#向上滑动
def swipe_up():
#[100,200]
x1 = get_size()[0]/2
y1 = get_size()[1]/10*9
x = get_size()[1]/10
driver.swipe(x1,y1,x1,y)

#向下滑动
def swipe_dowm():
#[100,200]
x1 = get_size()[0]/2
y1 = get_size()[1]/10
x = get_size()[1]/10*9
driver.swipe(x1,y1,x1,y)

def swipe_on(direction):
if direction == ‘up’:
swipe_up()
elif direction == ‘down’:
swipe_dowm()
elif direction == ‘left’:
swipe_left()
else:
swipe_right()

driver = get_driver()

swipe_on(‘left’)
swipe_on(‘left’)
swipe_on(‘up’)

写回答

1回答

Mushishi

2019-08-28

告诉你这个没办法编译,你去下载一个最新的appium oython client

0
0

Python主讲移动端自动化测试框架Appium

APP自动化基础知识、po模型、关键字模型、服务自动化、持续集成

1508 学习 · 1333 问题

查看课程