WebElements

A web page is comprised of many different HTML elements, such as buttons, links, a body, labels, forms, and so on, that are named WebElements in the context of WebDriver. Together, these elements on a web page will achieve the business functionality. For example, let's look at the HTML code of the login page of a website.

<html>
  <body>
    <form id="loginForm">
      <label>Enter Username: </label>
      <input type="text" name="Username"/>
      <label>Enter Password: </label>
      <input type="password" name="Password"/>
      <input type="submit"/>
    </form>
    <a href="forgotPassword.html">Forgot Password ?</a>
  </body>
</html>

In the preceding HTML code, there are different types of WebElements such as <html>, <body>, <form>, <label>, <input>, and <a>, which together ...

Get Selenium WebDriver Practical Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.