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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -