seleniumRC中,用java写循环语句怎么写啊?
我用整型变量代替Xpath中的数字为什么不可以? for (int i=0; i<10; i++){sel.click("//button" + i);
}
回复 2# 的帖子
这样写也可以吗?我一般都是sel.click("//button[" + i + "]");
回复 3# 的帖子
you are definitely righ, if the html looks like:<button/>
<button/>
.....
I just gave simple eample to LZ, assume the xml is:
<button1/>
<button2/>
...
Anyway there is not "button" in html. The correct one is "input", so neither of us are correct, hahah.
Sorry for English typing, no Chinese input here.
页:
[1]