---
description: Methods of WebElement
---

# WebElement Methods

The list of methods&#x20;

| Modifier and Type           | Method and Description                                                                                                                       |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| void                        | <p>clear()<br> If this element is a text entry element, this will clear the value.</p>                                                       |
|                             |                                                                                                                                              |
| void                        | <p>click()<br> Click this element.</p>                                                                                                       |
|                             |                                                                                                                                              |
| WebElement                  | <p>findElement(By by)<br> Find the first WebElement using the given method.</p>                                                              |
|                             |                                                                                                                                              |
| java.util.List\<WebElement> | <p>findElements(By by)<br> Find all elements within the current context using the given mechanism.</p>                                       |
|                             |                                                                                                                                              |
| java.lang.String            | <p>getAttribute(java.lang.String name)<br> Get the value of the given attribute of the element.</p>                                          |
|                             |                                                                                                                                              |
| java.lang.String            | <p>getCssValue(java.lang.String propertyName)<br> Get the value of a given CSS property.</p>                                                 |
|                             |                                                                                                                                              |
| Point                       | <p>getLocation()<br> Where on the page is the top left-hand corner of the rendered element?</p>                                              |
|                             |                                                                                                                                              |
| Rectangle                   | getRect()                                                                                                                                    |
| Dimension                   | <p>getSize()<br> What is the width and height of the rendered element?</p>                                                                   |
|                             |                                                                                                                                              |
| java.lang.String            | <p>getTagName()<br> Get the tag name of this element.</p>                                                                                    |
|                             |                                                                                                                                              |
| java.lang.String            | <p>getText()<br> Get the visible text of the element</p>                                                                                     |
|                             |                                                                                                                                              |
| boolean                     | <p>isDisplayed()<br> Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute.</p> |
|                             |                                                                                                                                              |
| boolean                     | <p>isEnabled()<br> Is the element currently enabled or not? This will generally return true for everything but disabled input elements.</p>  |
|                             |                                                                                                                                              |
| boolean                     | <p>isSelected()<br> Determine whether or not this element is selected or not.</p>                                                            |
|                             |                                                                                                                                              |
| void                        | <p>sendKeys(java.lang.CharSequence... keysToSend)<br> Use this method to simulate typing into an element, which may set its value.</p>       |
|                             |                                                                                                                                              |
| void                        | <p>submit()<br> If this current element is a form, or an element within a form, then this will be submitted to the remote server.</p>        |
