Selenium WebDriver - WebElement CommandsBefore proceeding with this section, first we should know the basic terminology related to web elements in WebDriver. What is Web Element?The term web element refers to a HTML element. The HTML documents are composed of HTML elements. It consists a start tag, an end tag and the content in between. For instance, a HTML element is written as: "<tagname> content </tagname>" In WebDriver, we have several commonly used web element commands and actions. The following screenshot displays the eclipse web element command panel. Note: To get the web element object, we have to write the statement as:Here, the UserName is the value of the id attribute, used as a unique identification for the desired web element. Given are some of the most commonly used WebElement commands for Selenium WebDriver. 1. Clear CommandMethod: Command: Code snippet: 2. Sendkeys CommandMethod: Command: Code snippet: 3. Click CommandMethod: Command: Code snippet: 4. IsDisplayed CommandMethod: Command: Code snippet: 5. IsEnabled CommandMethod: Command: Code snippet: 6. IsSelected CommandMethod: Command: Code snippet: 7. Submit CommandMethod: Command: Code snippet: 8. GetText CommandMethod: Command: Code snippet: 9. GetTagName CommandMethod: Command: Code snippet: 10. getCssValue CommandMethod: Command: 11. getAttribute CommandMethod: Command: Code snippet: 12. getSize CommandMethod: Command: Code snippet: 13. getLocation CommandMethod: Command: Code snippet:
Next TopicWebDriver - Browser Commands
|