DEV Community

Shreyas Gosavi
Shreyas Gosavi

Posted on • Updated on

DOUBT !! 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!!

Image description

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 !!!

Top comments (0)