大家好!遇到一個問題,希望大家能指點一下。我搭建好了 Appium 測試 Android 應用的測試環境,在運行 Python 編寫的測試用例時,發現調用 Webdriver.remote 后,沒有任何回應,Appium 的 log 如下:
android python?info: Welcome to Appium v0.15.0 (REV a7b47d73a27074cc928cc5b325e5d4de1b6e5594)
info: Appium REST http interface listener started on 127.0.0.1:4723
info - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"sessionId":null,"desiredCapabilities":{"a
pp-package":"lana.test.hellolana","app":"F:\workspace\HelloLana\bin\HelloLan
a.apk","browserName":"","version":"4.2","device":"Android","app-activity":"lana.
test.hellolana.HelloLanaActivity"}}
info: Using local app from desiredCaps: F:\workspace\HelloLana\bin\HelloLana.apk
info: Creating new appium session 93723c5f-066c-4923-9536-ab582746d37d
info: Starting android appium
debug: Using fast reset? false
info: Preparing device for session
info: Checking whether app is actually present
info: Checking whether adb is present
然后過了十幾分鐘后,Appium 的 log 打印出:POST /wd/hub/session 200 600810ms
測試用例代碼拋出如下異常:
Traceback (most recent call last):
File "F:\Appium\sample-code\examples\python\android_lana0319.py", line 22, in
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 71, in init
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 113, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 162, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 349, in execute
return self._request(command_info[0], url, body=data)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 417, in _request
resp = opener.open(request)
File "C:\Python27\lib\urllib2.py", line 394, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 412, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1170, in do_open
r = h.getresponse(buffering=True)
File "C:\Python27\lib\httplib.py", line 1027, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 371, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
環境配置和代碼參數都多次檢查過了,但是始終沒有找到問題原因。希望大家能幫忙看看,萬分謝謝!
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态