How do I manage with dynamic id's
I am automating a test case, where I need to fo开发者_开发百科cus 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.
Have you tried this
:
element.onclick = function(){
alert(this.id);
};
Write the same value out to a variable and use that to find the element.
精彩评论