I have a page that is open in two browser windows and which is communicating user interactions over sockets. If somebody clicks on an element I want it to happen in the other browser. For this I need to know the element that was interacted with.
I have a few options but none of them are 100% guaranteed to work.
- by element name: there can be multiple elements with the same name.
- by id: not all elements have an id
- by class: not all elements have a class and classes aren't unique
- by location: if the website is open in two different browsers the location can be different.
So is there an other way to identify elements that's 100% conclusive?