title: Cannot open Firefox browser selenium automation script - Error: cannot open display: :99 in Jenkins Ubuntu
body: <p>I have a simple automation script written in selenium webdriver. I need to execute this script through Jenkins. So I've configured the job in Jenkins and when tried to execute, I'm unable to open Firefox browser.</p>
  
  <p>The console output is as follows:</p>
  
  <pre><code>Running TestSuite
  org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
  Error: cannot open display: :99
  Failed tests: 
   NewTest.testEasy:25 » WebDriver Failed to connect to binary FirefoxBinary(/usr...
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>@Test
      public void testEasy() {
  //          WebDriver driver = new FirefoxDriver();
          WebDriver driver = null;
          FirefoxBinary binary = new FirefoxBinary(new File("/usr/bin/firefox"));
          binary.setEnvironmentProperty("DISPLAY",System.getProperty("lmportal.xvfb.id",":99"));
          driver = new FirefoxDriver(binary,null);
          driver.get("https://www.google.co.in/?gfe_rd=cr&amp;ei=drM-V8PiHPPI8AevjriQDA&amp;gws_rd=ssl");
  //          String title = driver.getTitle();
  //          AssertJUnit.assertTrue(title.contains("Free Selenium Tutorials"));
  //          System.out.println("TEST");
      }
  </code></pre>