[英]Selenium IE Driver opens new window instead of a new tab on window.open()
[英]In IE new window is opening instead of new tab in selenium web driver manager
我们开发了 selenium 脚本,用于自动化测试我们的 web 应用程序,以便在新选项卡中打开一些子链接。 在 Internet Explorer 浏览器中执行这些脚本时,我们观察到它们在新的 window 而不是新选项卡中打开。
但是这些 selenium 脚本在使用 Google chrome 和 Microsoft Edge 浏览器进行测试时运行良好。 我们是否缺少要在 Internet Explorer 浏览器中完成的任何设置。 你能帮助我们解决这个问题吗?
在 C# 中。 或者,您可以使用 SendKeys CTRL+T 打开一个新选项卡,将页面正文用作定位器参考:
而不是((IJavaScriptExecutor)driver).ExecuteScript("window.open()")
//将在 InternetExplorer 中打开一个新的 window
我使用driver.FindElement(By.TagName("body")).SendKeys(Keys.Control + "t");
//将在 InternetExplorer 中打开一个新选项卡
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.