开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜