title: Selenium Error: BadStatusLine
body: <p>Hi I am new in Selenium Webdriver and I am currently creating a test case for a specific function.</p>
  
  <p>I have a current test case that is already working for another function, but when I include a new test case and run it. I receive an error: <code>BadStatusLine</code>.</p>
  
  <p>Also when I run the individual test case it work perfectly fine, but when I run the whole test I will receive an error: <code>BadStatusLine</code>.</p>
  
  <pre><code>ERROR: test_task_xml (__main__.TestActuserLayouts)
  Test if the task xml is hidden
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "acttemplate_layouts.py", line 25, in setUp
      driver.find_element_by_name("password").submit()
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 84, in submit
      self._execute(Command.SUBMIT_ELEMENT)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 457, in _execute
      return self._parent.execute(command, params)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 231, in execute
      response = self.command_executor.execute(driver_command, params)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 395, in execute
      return self._request(command_info[0], url, body=data)
    File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 426, in _request
      resp = self._conn.getresponse()
    File "/usr/lib/python2.7/httplib.py", line 1051, in getresponse
      response.begin()
    File "/usr/lib/python2.7/httplib.py", line 415, in begin
      version, status, reason = self._read_status()
    File "/usr/lib/python2.7/httplib.py", line 379, in _read_status
      raise BadStatusLine(line)
  BadStatusLine: ''
  </code></pre>
  
  <p>This is the whole test:</p>
  
  <pre><code>    import unittest
  
  
  from selenium import webdriver
  
  
  
  class TestActuserLayouts(unittest.TestCase):
      """Test user functions """
      driver = webdriver.Firefox()
      driver.implicitly_wait(30)
      base_url = "http://samplepage.com"
  
  
      def setUp(self):
          """Base setting before test
          """
          driver = self.driver
          # Login
          driver.get(self.base_url + "/")
          driver.find_element_by_name("user_name").clear()
          driver.find_element_by_name("user_name").send_keys("userme")
          driver.find_element_by_name("password").clear()
          driver.find_element_by_name("password").send_keys("123")
          driver.find_element_by_name("password").submit()
          self.assertEqual(self.base_url + "/userme/inbox/", driver.current_url)
  
      def test_task_xml(self):
          """Test if the task xml is hidden
          """
          driver = self.driver
          # Get page by URL
          driver.get(self.base_url + "/userme/mission/")
          # Get page by URL
          driver.get(self.base_url + "/mission/update/0000000a-0000-0000-0000-000000000000/")
          self.assertEqual(self.base_url + "/mission/update/0000000a-0000-0000-0000-000000000000/", driver.current_url)
          driver.find_element_by_id("discussion-btn").click()
          # Scan browser if Task xml is not present
          self.assertFalse('Task xml' in self.driver.page_source)
  
      def test_task_list(self):
          """Test if the number of task for each mission is null
          """
          driver = self.driver
          #Get page url
          driver.get(self.base_url + "/userme/mission/")
          #Get page url
          driver.get(self.base_url + "/acttemplate/list-all/")
          #Scan browser if the number of task is null
          self.assertEqual(driver.find_element_by_xpath("//tr[3]/td[4]").text != "", True)
  
  
      def tearDown(self):
          """Clear setting after test
          """
          self.driver.close()
  
  
  
  # Run unit test directly
  if __name__ == "__main__":
      unittest.main()
  </code></pre>
  
  <p>While the other test case is a failure. So, I am not really familiar with selenium and I need help to locate this error. Can someone please help me in this issue. Thanks a lot.</p>