Absolutely refusing anything is unwise. My preference lies with CSS selectors as they are quicker than XPath for locating elements by id or CSS selector. However, the difference in speed is minimal, only a few milliseconds.
XPath does have some capabilities that other locators lack. For instance, it can find an element based on its contained text (excluding A
tags). Nonetheless, I usually opt for CSS selectors when id fails to do the job.
I am not a fan of how many individuals rely solely on XPath for locating elements on websites like Stack Overflow. It sometimes seems excessive and inefficient. Many people simply right-click on an element in the inspector and copy the XPath without considering its fragility. This habit persists due to ease rather than knowledge.
Despite my reservations, I suggest referring to the W3C CSS Selector reference to help you in your search for suitable combinators. Without knowing your HTML structure, it's challenging to recommend specific combinator choices.
https://www.w3.org/TR/selectors/#selectors
https://www.w3.org/TR/selectors/#adjacent-sibling-combinators
After reading the comments on your question, I noticed that you were already aware of the +
combinator. Have you considered using your initial CSS locator alongside the converted XPath string? While I cannot confirm its validity, I have combined the two locators from your code after converting XPath to a CSS selector.
filter-item-edit .dropdown button + ul li.dropdown-list-item