에뮬레이터에서 androiddriver를 성공적으로 설정할 수 있었지만 httplib 오류를 해결하는 데 어려움이 있습니다. 다음은 Mac에서 android sdk를 설정 한 후 취한 조치입니다.Androiddriver Python Bindings httplib
1. ./adb devices, which returned emulator-5554
2. ./adb emulator-5554 -s forward tcp:8080 tcp:8080
3. visited http://localhost:8080/wd/hub/status in my browser and received a { status: 0 }
4. In the python shell (tried this on both python 2.7 & 2.6), I did:
>> from selenium import webdriver
>> from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
>> driver = webdriver.Remote("http://localhost:8080/wd/hub", webdriver.DesiredCapabilities.ANDROID)
>> driver.get("http://www.google.com")
일부 경우 드라이버 변수를 설정할 때 오류가 발생하며 때로는 오류가 발생합니다. driver.get 명령에서도 마찬가지입니다.
스택 트레이스는 다음과 같습니다 :
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-server apk를 설치했습니다 (android- 2.32.0 전에). – qaduderino
with android-server-2.21.0.apk [link] (https://code.google.com/p/selenium/downloads/detail?name=android-server-2.21.0.apk&can=2&q=) 이것은입니다. 잘 작동합니다. – qaduderino
나는 하루 종일 작동하도록 노력해 왔습니다. APK가 문제라는 것이 나에게는 결코 발생하지 않았다. –