I am automating a test case, where I need to focus on a link, then I have to click on a element say element id looks like //table[@id='562']/tbody/tr/td[2]/img, but the value inside quotes that is 562 is keep changing how can i find out and click that element. Please can any body help me.
views:
40answers:
2
A:
Have you tried this:
element.onclick = function(){
alert(this.id);
};
digitalFresh
2010-07-09 13:29:39
sorry am not getting how to use this can u explain me more clearly.. thank u
nagaraja
2010-07-12 04:45:49
A:
Write the same value out to a variable and use that to find the element.
Andy Robinson
2010-07-09 13:32:06
Thank u andy. but the problem is, in this test case am going to upload a file and those files arranged row wise. i have to search that document and click that elmenent mentioned above but once i uploaded a document it may come in any row and the id attribute contain any value. There is no order for the value.So i cant predict the value.. so is there any other solution... please..
nagaraja
2010-07-12 04:51:37