I have been trying to solve this issue, but I've had no luck in the past 3 hours. All I need now is using Selenium to open website in Chrome, but it just doesn't work. I tried using GeckoDriver, too, but it just throws a different kind of exception. All software involved are up-to-date. I even tried disabling my WiFi and using cellular data (I thought the connection was blocked by the firewall), but it doesn't work, either. If someone can help me I will be really appreciated! I have seen some similar questions on stackoverflow, but none of the answers work.
Here's my code:
package bot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Terminator {
public static void main(String[] aaaa) {
System.setProperty("webdriver.chrome.driver", "/Users/myName/Documents/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
}
}
And this is the runtime exception thrown:
Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 22038 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:14.666Z' System info: host: 'myName-MacBook-Air.local', ip: 'fe80:0:0:0:14b0:2df0:4281:99d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '1.8.0_65' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192) at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at bot.Terminator.main(Terminator.java:10) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:22038/status] to be available after 20005 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187) ... 9 more Caused by: java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:205) at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:147) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75) ... 10 more