I am novice to Java or Selenium.
I just need help to understand one basic question.
Why we assign firefoxdriver instance to WebDriver? WebDriver driver=new Firef
package test.a1;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class testDriver {
public static void main(String[] args)
{
// TODO Auto-generated method stub
String browser="FireFox";
if(browser=="Chrome")
{
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\LL\\chromedriver_win32\\chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://www.gmail.com");
}
else if(browser=="IE")
{
System.setProperty("webdriver.ie.driver","Drivers\\IEDriverServer.exe");
InternetExplorerDriver driver = new InternetExplorerDriver();
driver.get("https://www.gmail.com");
}
else if(browser=="FireFox")
{
FirefoxDriver driver = new FirefoxDriver();
driver.get("https://www.gmail.com");
}
}
}
We can do this ..so kindly let know why ..we are doing this Webdriver driver=new FirefoxDriver();
.