问题
Most of the answers I found were about switching to a frame within a frameset. Following is the Script.
![](https://i0.wp.com/i.stack.imgur.com/ca3mM.png)
回答1:
There is no need to switching to frameset
.. you can directly switch to frame
As your image description if your frame
structure is like below :-
<frameset>
<frame name = 'frame1'></frame>
<frameset>
<frame name = 'frame2'>
<frame name = 'frame3'>
</frame>
</frame>
</frameset>
</frameset>
and here you want to switch frame name frame3
.. you just switching to this frame as below :-
driver.switchTo().frame('frame2');
driver.switchTo().frame('frame3');
No need to switch frameset
Hope it will help you...:)
回答2:
There is class cast exception while navigating to frame within frame set in Safari browser on MAC OS.
Selenium Server: V 3.4.0 Browser : Safari V 10.10.1 OS : MAC OSX Sierra
回答3:
HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns.
So there is no need to Switch to Frameset you can directly switch to frame inside the frameset.
来源:https://stackoverflow.com/questions/37742631/how-to-switch-to-a-frameset-with-in-a-frameset-in-selenium-webdriver-with-java