I'm using Selenium 2.53.0 Java, Tor 6.0.4 and Firefox 43. I'm executing tor with firefox by loading the profile.default archive with the Firefoxprofile() and a Firefoxbinary() with firefox.exe. Tor launchs, but it doesn't initiate, it shows two errors: Could not connect to Tor control port and Tor failed to start.
I've followed this post to Using Selenium WebDriver with Tor to set up the Firefox driver.
See below the code. Thanks!
String torPath = "C:\\Users\\Jose Bernhardt\\Desktop\\Tor Browser\\Browser\\firefox.exe";
String profilePath = "C:\\Users\\Jose Bernhardt\\Desktop\\Tor Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default";
File torProfileDir = new File(profilePath);
FirefoxBinary binary = new FirefoxBinary(new File(torPath));
FirefoxProfile torProfile = new FirefoxProfile(torProfileDir);
FirefoxDriver driver = new FirefoxDriver(binary, torProfile);
These are the Exceptions thrown:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Users\Jose Bernhardt\Desktop\Tor Browser\Browser\firefox.exe) on port 7055; process output follows