If the hidden object has an ID that is the same as another element, you can use an xpath to find the specific hidden element. Using chrome developer tools and inspect element a lot of the times a hidden object has this attribute
type="hidden" if that is the case you can do something like this for a locator object.
By hiddenObj = By.xpath("//*[@id='idOfYourHiddenElement' and @type='hidden']");
This would get your locator even if the id
idOfYourHiddenElement is used by some other non-hidden element.
If the hidden object does not have that hidden attribute you can use the Chrome Developer tools
Chrome Menu -> More Tools -> Developer Tools and click the
Type this into the console:
As long as chrome is using the right frame, it should find both of your objects. An easy way to find a difference between the two is open up each element and copy paste all attributes into something like notepad++ to auto compare them. Once you find what the difference is you should use that as the second part of your xpath instead of