O'Reilly logo

Selenium WebDriver Practical Guide by Satya Avasarala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required