I am new to selenium and started learning it yesterday by watching few videos. I have a doubt regarding how this piece of code works. Please explain.
// I am creating a Object reference for the FirefoxDriver class
FirefoxDriver f=new FirefoxDriver();
//findElementByClassName method is available in FirefoxDriver class. i Can understand this.
f.findElementByClassName("Email").sendKeys("abc");
How does sendkeys("abc") work? Is it also a method of FirefoxDriver class? I however know that it enters "abc" in the test field. I just wanted to know how it can be used here.
I have tried the same piece of code in a different way. Here, how can the WebElement Class being used along with firefoxDriver class?
FirefoxDriver f=new FirefoxDriver();
WebElement ex= f.findElementByClassName("Email");
ex.sendKeys("abc");
Both these pieces of codes do the required work correctly, but how do they work?