admin管理员组文章数量:1419611
I'm having 15 frames in a page where I need to move in and out,
How I can I e to know under which frame i'm in?
e.g From frame1 to frame8 and frame8 to frame12 and so on...
I'm having 15 frames in a page where I need to move in and out,
How I can I e to know under which frame i'm in?
e.g From frame1 to frame8 and frame8 to frame12 and so on...
Share Improve this question asked Jun 16, 2012 at 9:05 Nimeshkumar PrajapatiNimeshkumar Prajapati 412 silver badges11 bronze badges 3- by frame do you mean iframe or div? – jcolebrand Commented Jun 16, 2012 at 9:08
- You can't know which iframe has the focus, and relay that to another iframe. You could potentially track the mouse position based on activity in a frame and associate it with a keyvalue used to load the URL from the master page, but that's terribly convoluted. Whats your intent? – jcolebrand Commented Jun 16, 2012 at 9:11
- 1 wd.switchTo().defaultContent(); //Switching to Sub frame wd.switchTo().frame("canvas_frame"); One frame's out put is an input of another one and so on... – Nimeshkumar Prajapati Commented Jun 16, 2012 at 9:13
1 Answer
Reset to default 4In WebDriver, you explicitly have to switch into a frame or iframe via driver.switchTo().frame()
(or its equivalent in whatever language binding you're using). As such, you should always know which frame or iframe you're in, because you switched to it. If you find you need to keep track of it for some reason, you might try something like adding an object to a list every time you switch to a frame or iframe. You can't switch to a parent or sibling frame in WebDriver, so to navigate to one of those, you'll need use driver.switchTo().defaultContent()
, which will always switch to the top-level frame, and navigate down the hierarchy again.
本文标签: javascriptWeb Driver How to know current frame activenessStack Overflow
版权声明:本文标题:javascript - Web Driver: How to know current frame activeness? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745317864a2653234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论