WebElement and WebElement Methods in selenium WebDriver


What is WebElement?

WebElement represents HTML DOM(Document object model) element. When HTML document loads into a web browser, it gets converted into a document object.

WebElement is a generic class in selenium webdriver, to convert object into document object.

Following are some of the important WebElement methods :

  • sendKeys(java.lang.charSequence..keysToSend)
    more information here :

https://onecompiler.com/posts/3swcunudm/sample-examples-for-sendkeys-click-and-clear-webelement-methods-in-selenium-webdriver

  • clear()
    more information here :

https://onecompiler.com/posts/3swcunudm/sample-examples-for-sendkeys-click-and-clear-webelement-methods-in-selenium-webdriver

  • click()
    more information here :

https://onecompiler.com/posts/3swcunudm/sample-examples-for-sendkeys-click-and-clear-webelement-methods-in-selenium-webdriver

  • getAttribute(java.lang.String name)

more information here:

https://onecompiler.com/posts/3swcw9m5s/webelement-getattribute-example-in-selenium-webdriver

  • getCssValue(java.lang.String propertyName)

  • getLocation()

  • getSize()

  • getTagName()

  • getText()

  • submit()

  • isDisplayed()

  • isEnabled()

  • isSelected()