Using selenium, I am initializing a firefox
driver but, the chrome
driver is initialized and chrome
browser is opened.
Had I configured default settings anywhere? What could be the problem..Sorry for the dumb question.But, I got no clues.Please help.
Here goes my code,
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Aon
{
public static WebDriver driver;
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:/Users/ranganah/Downloads/Softwares/Selenium/geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://www.google.co.in");
System.out.println(driver.getTitle());
System.out.println(driver.getCurrentUrl());
driver.findElement(By.name("q")).sendKeys("Hari");
driver.findElement(By.name("q")).sendKeys(Keys.ENTER);
System.out.println(driver.getTitle());
System.out.println(driver.getCurrentUrl());
driver.close();
driver.quit();
}
}
For the screen shot: https://postimg.org/image/ncyg2o9l5/