Selenium 4 Relative Locator Examples

A few Selenium 4 relative locator examples in Ruby language

Zhimin Zhan
5 min readNov 11, 2021

--

This article is included in my “How to in Selenium WebDriver” series.

Relative locators, introduced in Selenium 4, provide a new way to find element(s) based on the position of another element. There are five locators:

  • left

--

--

Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.