1

This question already has an answer here:

How can I get the unique id of the element in selenium webdriver.
For example email id creation:
Each time the system creates a unique id for the email id.
How can we use that specific id in selenium webdriver for testing when it is constantly changing ?

marked as duplicate by Alexey R., Bharat Mane, NarendraC, Peter M. - stands for Monica, alecxe Apr 4 '18 at 19:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    What problem are you trying to solve? what is email id? is it id attribute of some element? "Each time its creating" who is that "it"? "and we cannot create a new one with already existing name" what do you mean by "create"? Why are you trying to create something with already existing name?. Please answer all these question. Yet I'm voting to close this one as "unclear what you're asking" – Alexey R. Apr 4 '18 at 9:41
  • 1
    Is this same like- sqa.stackexchange.com/questions/18342/… – Bharat Mane Apr 4 '18 at 13:53
0

When the element ID is dynamic and uniquely generated each time - usually a database ID or the link - your options are:

  • work with designers to have a fixed css ID on the element or a surrounding element
  • use surrounding code elements, ID's and classes to identify the element without using the ID

Not the answer you're looking for? Browse other questions tagged or ask your own question.