selenium webdriver - WebElement is an interface - how can methods be called on it successfully? -


since webelement interface, means methods present in webelement interface abstract, i.e. don't have body. also, know cannot access methods of interface directly using reference interface (because methods don't have implementation)

now, consider following code:

webelement button = driver.findelement(//xpath of button); button.click(); 

can explain how possible here access click() method of interface webelement through 'button' nothing reference interface webelement?

the webelement interface implemented androidwebelement, htmlunitwebelement, or remotewebelement.

the click method executed on 1 of these concrete classes (which returned findelement).

see following documentation further details:


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -