The following are some of the methods provided by the WebElement class to interact with textboxes and textareas elements during the execution of a script:
- boolean isEnabled(): Indicates if an element is enabled or not.
- java.lang.String getAttribute(java.lang.String name): Gets the current value of a given attribute of an element. This is very useful for getting the contents of text areas, text boxes, and input elements.
- java.lang.String getText(): Returns the visible inner text of an element. If the element has subelements, it will return a string with no spaces.
- void sendKeys(java.lang.CharSequence… keysToSend): Simulates typing into an element.
- boolean isDisplayed(): Indicates if an element is visible or not.