返回到Selenium中的父框架 [英] Moving back to parent frame in Selenium

查看:313
本文介绍了返回到Selenium中的父框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要移回Selenium中的父框架, 使用driver.switchTo().parentFrame();.在我的示例网站中,我还使用driver.switchTo().defaultContent();实现了相同的功能.

For moving back to parent frame in Selenium, driver.switchTo().parentFrame(); is used. In my example website, I achieved same functionality using driver.switchTo().defaultContent(); also.

这两者之间在功能上有什么区别吗?

Is there any functional difference between these two:

- driver.switchTo().parentFrame();
- driver.switchTo().defaultContent();

在引用HTML文档中的框架时,父框架"和默认内容"是否不同?请解释.

While referring to frames in a HTML document, are "Parent Frame" and "Default Content" different? Please explain.

推荐答案

在一定程度上确实有所不同. 假设您有一个页面,其中页面三"在一个框架二"内,而另一帧一"在里面,考虑到您位于框架三"中,这是最里面的...

It does have difference to an extent. Suppose you have a page having frame 'three' inside a frame 'two' inside another frame 'one', considering that you are on the frame 'three' which is inner most...

driver.switchTo().parentFrame();-这会将焦点移回到帧二". driver.switchTo().defaultContent();-这会将焦点移回到第一个帧所在的主要(默认)内容.

driver.switchTo().parentFrame(); - This will shift focus back to frame 'two'. driver.switchTo().defaultContent(); - This will shift focus back to main (default) content in which frame 'one' lies.

我希望这会有所帮助.谢谢!

I hope this was helpful. Thanks !

这篇关于返回到Selenium中的父框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆