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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745317864a4622300.html
评论列表(0条)