I am unable to launch Firefox browser(53) using selenium webdriver (3.11) The code works well with Chromedriver but gives exception with Firefox.
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class CNN { public static void main(String[] args) { WebDriver driver = new ChromeDriver(); driver.get("http://www.cnn.com"); String text =driver.findElement(By.xpath("//*[@id='intl_homepage1-zone-1']/div[2]/div/div[1]/ul/li[1]/article/a/h2")).getText(); System.out.println(text); } } This is the exception that i am getting:-
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:5542 Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:08.638Z'