selenium2.0的switchTo().frame(0)的问题
然后就能获得另一个iframe里的内容了
请问,switchTo().frame(0)
1:这个方法是什么意思?切换下一个iframe吗?
2:形参里的数值代表什么?
3:如果页面含有多个iframe,我想切换到下下个iframe,是这么写的么switchTo().frame(1)?
4:如果是的话,那么这个iframe切换的顺序是什么?
欢迎各位大神赐教
小弟在此谢过 展开
1、2、3的回答:
你对方法frame(index)的index理解是对的,具体如下:
Select a frame by its (zero-based) index. That is, if a page has three frames,
the first frame would be at index "0", the second at index "1" and the third at
index "2". Once the frame has been selected, all subsequent calls on the
WebDriver interface are made to that frame.
Parameters:
index (zero-based) index
Returns:
This driver focused on the given frame
Throws:
NoSuchFrameException
- If the frame cannot be found
第凳前4的回答:让灶(看下面这个)
jarvi.iteye.com/blog/1450525
By the way: 你说的iframe都没有id,name之类,请枣滑清把这个iframe在firebug里的源码截图上来看一下