FirefoxDriver Compatibility with Selenium 2.53
When using Selenium WebDriver 2.53.0 with Firefox 47.0, an error like the following may occur:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.
This issue arises due to the incompatibility of Selenium WebDriver 2.53.0 with Firefox 47.0. The discontinued FirefoxDriver component, which handled Firefox browsing, has been replaced with the need for the geckodriver binary to manage Firefox browsers in Selenium WebDriver 3.0 and later.
Solution:
To address this problem, follow these steps:
System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver");
Alternatively, you can use the WebDriverManager library to simplify the process:
<dependency> <groupId>io.github.bonigarcia</groupId> <artifactId>webdrivermanager</artifactId> <version>5.1.0</version> </dependency>
WebDriverManager.firefoxdriver().setup();
Note:
The above is the detailed content of Why Does Selenium 2.53.0 Encounter a 'NotConnectedException' with Firefox 47.0?. For more information, please follow other related articles on the PHP Chinese website!