© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
S. ShuklaPractical WebDriverIOhttps://doi.org/10.1007/978-1-4842-6661-8_2

2. Web Locators

Shashank Shukla1  
(1)
Mandla, India
 
Now that you have your framework installed, and the first test case is successfully running, let’s proceed to the next logical step. In this chapter, you learn how to locate the elements of a web page to interact with them. You also learn different locator strategies and how WebdriverIO uniquely uses them. The chapter discusses the following.
  • Taking a screenshot of an identified element

  • ID locator

  • Class locator

  • Name locator

  • Tag name locator

  • Link text locator

  • Partial link text locator

  • Element with certain text locator

  • CSS query selector locator ...

Get Practical WebDriverIO: Learn to Automate Effectively Using WebDriverIO APIs 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.