Identifying Dynamic Link
I am facing a problem while trying to identify the following link
<a onclick="post_value('0000100101AUTO_17001')" href="#">0000100101AUTO_17001</a>
The text '0000100101AUTO_17001' changes with the value input in previous steps.
Now I am trying to identify it using (I am waiting for the element to get visible)
But this is throwing a timeout exception even when the link is visible on the screen.
Is there something that I am doing wrongly or any other way to identify this link.
I think you're better off using xpath,
But the real solution is tell your devs to add an id or other locator to it. You never want to tie your identification to text or a specific implementation detail (as I did with the xpath). This makes the automation code less maintainable. It would be a simple template change to just add id='something', or data-automationid='something', to the template to make objects easy to identify.
Last edited by dlai; 10-16-2013 at 11:59 AM.
Thanks David it worked. I have asked the dev team to include ID locator for all the tags in future builds. Lets hope that they listen and also act, so that my life is easy.