Reliable xpath selection for dropdowns

Is there a reliable way to select elements from a web dropdown using xpath? After clicking a dropdown it appears the best way is to use keyboard arrow commands. Obtained xpath from dropdowns does not seem to work for clicking.

Hi @brian_joseph it depends on the website. Sometimes the structure of the html page allows you to create relative xpaths that work for dropdown menu selection. In other cases you can use keystrokes as a workaround.

There are several plugins that help you build xpaths:

You can also see our Xpath guide for more information.

Can you share the URL of the page to have a look at the dropdown?

Yes I have ChroPath and Xpath helper. I did the Google form assignment using the keyboard for the dropdown. The Xpath works well with all elements including the initial click to the dropdown. I wanted to try to get the dropdown elements with XPath as well but I’ve spent an excessive amount of time with no luck. I tried both add-ons with differently styled Xpaths for the same element.