Selenium WebDriver:打开新选项卡而不是新窗口 [英] Selenium WebDriver: Open new tab instead of a new window

查看:114
本文介绍了Selenium WebDriver:打开新选项卡而不是新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Selenium WebDriver.每个链接都在新的浏览器窗口中打开.这对我来说不方便.如何更改它以使其仅在新标签页中打开?

I am using Selenium WebDriver. Every link is opened in a new browser window. It is not convenient for me. How can I change it so that it opens just in new tab?

推荐答案

Selenium 目前没有切换标签的能力.因此,我们强制浏览器在新窗口中打开链接,但由于我们能够切换窗口,我们强制浏览器采用这种方法.这可能会在以后的版本中修复

Selenium has no ability to switch tabs at the moment. Because of this we force the browser to open links in new windows but since we are able to switch windows we force the browser to take the approach. This may be fixed in a later version

这篇关于Selenium WebDriver:打开新选项卡而不是新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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