How to switch to a frameset with in a frameset in selenium webdriver with java?

烈酒焚心 提交于 2019-12-25 07:25:39

问题


Most of the answers I found were about switching to a frame within a frameset. Following is the Script.


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!