title: Using Selenium WebDriver with Tor
body: <p>Because Tor Browser Bundle is just a patched version of Firefox, it seems that it should be possible to use a <code>FirefoxDriver</code> with Tor Browser. This is what I've tried so far:</p>
  
  <pre><code>String torPath = "C:\\Users\\My User\\Desktop\\Tor Browser\\Start Tor Browser.exe";
  String profilePath = "C:\\Users\\My User\\Desktop\\Tor Browser\\Data\\Browser\\profile.default";
  FirefoxProfile profile = new FirefoxProfile(new File(profilePath));
  FirefoxBinary binary = new FirefoxBinary(new File(torPath));
  FirefoxDriver driver = new FirefoxDriver(binary, profile);
  driver.get("http://www.google.com");
  </code></pre>
  
  <p>This results in a blank Tor Browser page opening with a popup message: <em>Your Firefox profile cannot be loaded. It may be missing or inaccessible.</em></p>
  
  <p>I know that the profile is valid/compatible because I can successfully start the browser and profile with:</p>
  
  <pre><code>binary.startProfile(profile, profilePath, ""));
  </code></pre>
  
  <p>I don't know how to send commands to a browser opened in such a manner, however.</p>
  
  <p>I've found similar questions, but I'm specifically looking for a Java solution, preferably tested on Windows.</p>
  
  <p>I'm using a standalone Selenium library that can be downloaded <a href="http://www.seleniumhq.org/download/" rel="noreferrer">here</a> and the Tor Browser Bundle that can be downloaded <a href="https://www.torproject.org/download/download" rel="noreferrer">here</a>.</p>