硒:在同一选项卡中打开链接 [英] Selenium: Open Link in Same Tab

查看:68
本文介绍了硒:在同一选项卡中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Selenium Webdriver单击链接,该链接打开了一个新窗口-我想强制该链接在同一窗口(和同一选项卡)中打开吗?

I am clicking a link via Selenium webdriver and the link opens up a new windows - I want to force the link to open in the same window (and the same tab) is this possible?

在大多数情况下,这种情况并不仅仅发生在特定的链接上.

Most of the time this does not happen only with a specific link..

谢谢

推荐答案

在单击链接之前,将链接的 target 属性更新为 self ,然后单击它.

Before clicking the link update the link's target property to self and then click it.

有关更新属性的信息,请参阅此

For updating the property please refer to this link.

这篇关于硒:在同一选项卡中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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