title: How to change the port that Webdriver Firefox connects to localhost?
body: <p>I have a selenium webdriver test, converted to maven project, that I want to run via xvfb on Jenkins.</p>
  <p>There is a problem with display selection, but I would like to try something else and change the port, for example.</p>
  <p>This is the error I get:</p>
  <blockquote>
  <p>org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.</p>
  <p>Firefox console output:</p>
  <p>Error: no display specified</p>
  <p>Error: no display specified</p>
  </blockquote>
  <p>And this is my code:</p>
  <pre class="lang-java prettyprint-override"><code>File ffExe = new File(&quot;/usr/bin/firefox&quot;);
  FirefoxBinary ffox = new FirefoxBinary(ffExe);
  ffox.setEnvironmentProperty(&quot;DISPLAY&quot;, &quot;:21&quot;);
  WebDriver driver = new FirefoxDriver(ffox, null);
  </code></pre>
  <p>So, how can I tell firefox to use another port and which one should I specify?</p>