title: Selenium test works in local machine, but fails on Jenkins
body: <p>My test works just fine on my machine. However, on Jenkins, I have the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/django/test/utils.py", line 216, in inner
      return test_func(*args, **kwargs)
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/twist/tests/interface/test_hello.py", line 42, in test_login
      open_login_modal_btn.click()
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 75, in click
      self._execute(Command.CLICK_ELEMENT)
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 454, in _execute
      return self._parent.execute(command, params)
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute
      self.error_handler.check_response(response)
    File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 181, in check_response
      raise exception_class(message, screen, stacktrace)
  ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
  Stacktrace:
      at fxdriver.preconditions.visible (file:///tmp/tmpl_3zEO/extensions/fxdriver@googlecode.com/components/command-processor.js:9981)
      at DelayedCommand.prototype.checkPreconditions_ (file:///tmp/tmpl_3zEO/extensions/fxdriver@googlecode.com/components/command-processor.js:12517)
      at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpl_3zEO/extensions/fxdriver@googlecode.com/components/command-processor.js:12534)
      at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpl_3zEO/extensions/fxdriver@googlecode.com/components/command-processor.js:12539)
      at DelayedCommand.prototype.execute/&lt; (file:///tmp/tmpl_3zEO/extensions/fxdriver@googlecode.com/components/command-processor.js:12481)
  </code></pre>
  
  <p>I installed dependencies as it follows:</p>
  
  <pre><code>$ sudo apt-get install xvfb python-pip
  $ sudo pip install pyvirtualdisplay
  </code></pre>
  
  <p>Here is my test code:</p>
  
  <pre><code>class MySeleniumTests(LiveServerTestCase):
      fixtures = ['user-data.json']
  
      def setUp(self):
          self.display = Display(visible=0, size=(800, 600))
          self.display.start()
          group = Group.objects.get_or_create(name="Test")[0]
          user_adm = User.objects.create(username="adm",
                                          is_active=True,
                                          is_staff=True,
                                          is_superuser=True)
          user_adm.set_password("123")
          user_adm.groups.add(group)
          user_adm.save()
          self.selenium.get('%s' % (self.live_server_url))
          self.browser = self.selenium
  
      def tearDown(self):
          self.display.stop()
  
      @classmethod
      def setUpClass(cls):
          super(MySeleniumTests, cls).setUpClass()
          cls.selenium = WebDriver()
  
      @classmethod
      def tearDownClass(cls):
          cls.selenium.quit()
          super(MySeleniumTests, cls).tearDownClass()
  
      @override_settings(DEBUG=True)
      def test_login(self):
          open_login_modal_btn = self.browser.find_element_by_xpath("//a[@class='btn btn-nav']")
          open_login_modal_btn.click()
          # Login info
          username_html_id = "lm-email"
          password_html_id = "lm-password"
          login_value = "adm"
          password_value = "123"
          username = self.browser.find_element_by_id(username_html_id)
          password = self.browser.find_element_by_id(password_html_id)
          # Sending login info
          username.send_keys(login_value)
          password.send_keys(password_value)
          desired_url = self.live_server_url + "/panel/"
          form = self.browser.find_element_by_xpath('//form[@id="login-modal"]')
          form.submit()
          time.sleep(5)
          # Testing if successful login
          # Logging in
          current_url = self.browser.current_url
          self.assertEqual(current_url, desired_url)
  </code></pre>
  
  <p>Are there any clues on how to fix it? Any help on how to debug/fix it will be appreciated! :-)</p>
  
  <p>-- EDIT:</p>
  
  <p>My issue is solved, if you are facing similar problem, take a look at: <a href="https://stackoverflow.com/questions/34562061/webdriver-click-vs-javascript-click">WebDriver click() vs JavaScript click()</a> It was the case in my problem.</p>