farooq basha
2017-01-21 16:44:52 UTC
Hi All,
First of all I am quite new to selenium,I have a question which I think
would be answered by the experts over here.
WebDriver obj = new ChromeDriver();
perfectly fine as WebDriver is the interface and it is implemented by many
classes and ChromeDriver is one among them,so it's perfeclty valid to
assign the reference variable to the implementing class and we can access
the methods which are define in the interface.
but
WebElement var= driver.findElement(By.id("value"));
var.method();
So I am confused with the above statement as "WebElement is the interface"
and it's reference variable is not assigned to any of it's implementing
class.
We are just assigning it to the other interface and we are able to access
the methods of WebElement.
Can someone help me out with this.
Thanks in advance
First of all I am quite new to selenium,I have a question which I think
would be answered by the experts over here.
WebDriver obj = new ChromeDriver();
perfectly fine as WebDriver is the interface and it is implemented by many
classes and ChromeDriver is one among them,so it's perfeclty valid to
assign the reference variable to the implementing class and we can access
the methods which are define in the interface.
but
WebElement var= driver.findElement(By.id("value"));
var.method();
So I am confused with the above statement as "WebElement is the interface"
and it's reference variable is not assigned to any of it's implementing
class.
We are just assigning it to the other interface and we are able to access
the methods of WebElement.
Can someone help me out with this.
Thanks in advance
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e2a5299b-580f-4695-ad1a-fe5c26321ae2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e2a5299b-580f-4695-ad1a-fe5c26321ae2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.