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