title: Setup PhantomJS from JSON using WebDriver in Java
body: <p>When running plain PhantomJS a config.json can be set which sets some options. How I can setup PhantomJS with JSON file when using the Selenium WebDriver? </p>
  
  <p>I have this:</p>
  
  <pre><code>DesiredCapabilities caps = new DesiredCapabilities();
  caps.setJavascriptEnabled(true);
  caps.setCapability("takesScreenshot", false);
  caps.setCapability(
          PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
           "/usr/local/bin/phantomjs");
  driver = new PhantomJSDriver(caps);
  </code></pre>