Unable to locate element using xpath

Hi…I am unable to locate the element since the value in xpath is dynamic, by default it takes the first value in the table which is not displayed at all and not the one that i have searched (Independant Test Account REQ1)…What am i doing wrong here? How to deal with such cases?

Xpath.jpg

I understand you want to select the Independant Test Account REQ1 element in the target HTML. How about this XPath?

//div[@id='Account_body']/table[@class='list']/tbody/tr[contains(@class,'dataRow')][1]/th/a

Thanks…It worked only for the first time…Later on same problem happening…Basically the problem is that this value depends on the value entered in Search…However i am getting the first value that is present in the table. The search part works well and required value is displayed but wrong value getting selected on click

but wrong value getting selected on click

I don’t understand what you mean.

this is resolved now…thanks!

Girish Mohite said:

this is resolved now…thanks!

How did you resolve it?