Right-click on the browser to identify the element driver.find_element(:xpath, "xxxx") An add-on that copies a character string in the format like to the clipboard.
It supports C # Python Ruby Java (you can select the language on the setting screen).
WebDriver Element Locator (download page) https://addons.mozilla.org/ja/firefox/addon/element-locator-for-webdriv/
It's a simple but quite useful tool.