Use of Relative-Locator to find the element ..

Note : We can find the location of the element with the id-name but just wanted to know how can we access with the help of relative-locators!!

Hello just wanted to know how to access the ‘X’ button from the side menu with the help of "Relative-locators’ using Selenium in java.

For that page login to this sample web-page for testing. Link : https://www.saucedemo.com/

I have tried it with near, above functions By class-name “bm-item-list” but the driver could not locate it.

Appreciate your help !!!

Hello Shreyas,

Please find the doc below on how to user relative locators in selenium

Thanks

1 Like