How to get xpath of only the categories for checkboxes
I am trying to find the xpath / count for all the checkboxes under "Categories". but when I am trying to get xpath/count it is getting me all the checkboxes under "Categories" and under "Brands"
How can I get all checkboxes count under "Categories".
attaching the screenshot for the issue, Appreciate your help.
Please add the element structure for the brand also. Assuming, all elements under Brand and categories are under different levels, the xpath you could use is:
It seems both are in the same level:
i tested below locator:
//li[preceding-sibling::*//div[text()='SHOP BY CATEGORY']/..][following-sibling::*//a[@data-menu-id="10"]/..]
For amazon uk:
https://www.amazon.co.uk/: click the handburger menu and try out your self
so in your case you could use: