title: Error message "The method withTagName(String) is undefined for type RelativeLocator" - Selenium 4 java
body: <p>When compiled within Eclipse IDE have an error &quot;The method withTagName(String) is undefined for the type RelativeLocators&quot; while running the test in Selenium-java 4.1.0.
  <img src="https://i.stack.imgur.com/0VoDm.png" alt="Current error" /></p>
  <p>I have followed the post on <a href="https://stackoverflow.com/questions/68834912/error-message-the-method-withtagnamestring-is-undefined-for-the-type-relative">Error message &quot;The method withTagName(String) is undefined for the type RelativeLocators&quot; displayed at compile time</a>
  to import static org.openqa.selenium.support.locators.RelativeLocator.*; <img src="https://i.stack.imgur.com/vZcDs.png" alt="method used" /></p>
  <p>Here are the details of selenium version.<img src="https://i.stack.imgur.com/dIHp4.png" alt="Pom xml selenium version" /></p>