2
我成功地能夠在模擬器上設置androiddriver,但我正在努力解決httplib錯誤。以下是在mac上設置android sdk後所執行的步驟。有些時候,當我設置驅動變量時,我會得到錯誤(下面),有時候不會。 driver.get命令也是如此。Androiddriver Python綁定httplib
堆棧跟蹤低於:
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 177, in get
self.execute(Command.GET, {'url': url})
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 163, in execute
response = self.command_executor.execute(driver_command, params)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 349, in execute
return self._request(url, method=command_info[0], data=data)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 396, in _request
response = opener.open(request)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1170, in do_open
r = h.getresponse(buffering=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1027, in getresponse
response.begin()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
別人也有一個解決的辦法的想法?
更新 - 我安裝了舊版本的android服務器apk(正在使用android- 2.32.0之前)。 – qaduderino 2013-04-29 21:32:11
使用android-server-2.21.0.apk [鏈接](https://code.google.com/p/selenium/downloads/detail?name=android-server-2.21.0.apk&can=2&q=)這是正常工作 – qaduderino 2013-04-29 21:39:05
我一直在努力工作。我從來沒有想到apk是這個問題。 – 2013-09-25 17:43:18