初学appium,执行时总提示 ProtocolError: ('Connection aborted.', BadStatusLine("''",))

Traceback (most recent call last):
  File "E:/About_stu/appium_WeChat.py", line 14, in 
    driver=webdriver.Remote("http://127.0.0.1:4723/wd/hub",desired_caps)
  File "D:\Program Files\Python27\lib\site-packages\selenium-3.14.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "D:\Program Files\Python27\lib\site-packages\selenium-3.14.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "D:\Program Files\Python27\lib\site-packages\selenium-3.14.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 319, in execute
    response = self.command_executor.execute(driver_command, params)
  File "D:\Program Files\Python27\lib\site-packages\selenium-3.14.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 376, in execute
    return self._request(command_info[0], url, body=data)
  File "D:\Program Files\Python27\lib\site-packages\selenium-3.14.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 404, in _request
    resp = http.request(method, url, body=body, headers=headers)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\request.py", line 72, in request
    **urlopen_kw)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\request.py", line 150, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\poolmanager.py", line 323, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "D:\Program Files\Python27\lib\site-packages\urllib3\util\retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "D:\Program Files\Python27\lib\site-packages\urllib3\connectionpool.py", line 377, in _make_request
    httplib_response = conn.getresponse(buffering=True)
  File "D:\Program Files\Python27\lib\httplib.py", line 1121, in getresponse
    response.begin()
  File "D:\Program Files\Python27\lib\httplib.py", line 438, in begin
    version, status, reason = self._read_status()
  File "D:\Program Files\Python27\lib\httplib.py", line 402, in _read_status
    raise BadStatusLine(line)
ProtocolError: ('Connection aborted.', BadStatusLine("''",))

分析方法:
百度查了很多资料说是Http,尝试了很多解决方案依然没有解决(也许是我操作方式有问题)
解决方法:
最后发现是因为电脑没有连接wifi(留给自己以后参考)

你可能感兴趣的:(appium)