Search code examples
javaeclipseselenium-webdriveridentifier

How do I automate when an object doesn't have any unique identity on that page?


I am automating a pathetically developed web page. One object doesn't have any unique identity. Only option is its LinkText name which unfortunately have multiple objects with that same very name. Could you guys please suggest to me me something?

<a title="Directory" href="javascript:;" style="color: rgb(95, 96, 98);">People</a>

This is that object's inspected element description.

Do use your magic wand if required. Am counting on you all Einsteins!


Solution

  • Did you consider using XPath it might help, something like this: //a[@title='Directory'] [.='People']