Appium UI Inspector无法连接到服务器。我正在使用模拟器

时间:2015-10-01 10:42:39

标签: python-2.7 selenium selenium-webdriver appium

我无法从Appium获取UI检查器进行连接。 我有模拟器运行。我想使用UI Inspector在模拟器上查找浏览器中的元素。 当我点击Appium中的UI检查器时,我收到错误消息:

Failed to connect to server.  Check that it is running

这是我的设置。 从AVD Manager我设置了一个具有以下设置的模拟器:

Platform = 4.3.1, API Level 18, CPU/ABi = ARM(armeabi-v7a), Device = Nexus One, No skin, Ram 512MB

单击“开始模拟器运行”。我从设置中选择了USB调试。

Appium Android设置如下: 勾选使用浏览器,将下拉菜单设置为浏览器 未选中完全重置复选框

Platform version = 4.3 JellyBean ApI Level = 18
Appium version is 14.0

Appium日志如下:

    > Checking if an update is available
> Update not available
> Starting Node Server
> warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
> info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"avd":"1","deviceName":"Android","platformName":"Android","platformVersion":"18","automationName":"Appium","browserName":"Browser"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"Android","browserName":"Browser","platformName":"Android"}}
> info: Client User-Agent string: undefined
> info: Set mode: Proxying straight through to Chromedriver
> info: [debug] Looks like we want chrome on android
> info: [debug] Creating new appium session 76c736ff-0fb3-4a71-9f60-dec4936d04d4
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: [debug] Trying to find 1 emulator
> info: [debug] Getting connected emulators
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: [debug] 1 emulator(s) connected
> info: [debug] Sending telnet command to device: avd name
> info: [debug] Getting running emulator port
> info: [debug] Socket connection to device created
> info: [debug] Socket connection to device ready
> info: [debug] Telnet command got response: 1
> info: [debug] Found emulator 1 in port 5554
> info: [debug] Setting device id to emulator-5554
> info: [debug] Did not launch AVD because it was already running.
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 wait-for-device
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Set chromedriver binary as: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
> info: Set chromedriver binary as: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install "C:\Program Files\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 push "C:\\Program Files\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: C:\Users\OptimusPrime\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.browser -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data","status":0}
> info: [debug] dataDir set to: /data
> info: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: No old chromedrivers seemed to exist
> info: Spawning chromedriver with: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe --url-base=wd/hub --port=9515
> info: [CHROMEDRIVER STDOUT] Starting ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 9515
> Only local connections are allowed.
> info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: Got response with status 200: {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86","name":"Windows NT","version":"6.1 SP1"}}}
> info: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.browser","androidActivity":"com.android.browser.BrowserActivity","androidDeviceSerial":"emulator-5554"}}}
> info: <-- POST /wd/hub/session - - ms - - 
> info: Got response with status 200: {"sessionId":"a865c3c037609e990e2cbc0206e5d4a6","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Wind...
> info: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.browser","androidActivity":"com.android.browser.BrowserActivity","androidDeviceSerial":"emulator-5554"}}}

为什么UI Inspector无法连接? 我想使用UI检查器检查浏览器网页上的元素,以便识别元素定位器。

谢谢, 里亚兹

0 个答案:

没有答案