Chapter 1. Locating Elements

In this chapter, we will cover:

  • Using browser tools for inspecting elements and page structure
  • Locating an element using the findElement method
  • Locating elements using findElements method
  • Locating links
  • Locating elements by tag name
  • Locating elements using CSS selectors
  • Locating elements using XPath
  • Locating elements using text
  • Locating elements using advanced CSS selectors
  • Using jQuery selectors
  • Locating table rows and cells
  • Locating child elements in a table

Introduction

The success of automated GUI (Graphical User Interface) tests depends on identifying and locating GUI elements from the application under test and then performing operations and verifications on these elements to achieve the test flow. This boils down to the test ...

Get Selenium Testing Tools Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.