我无法在Google Chrome中使用硒打开新标签 [英] I can't open the NEW TAB in google Chrome Using selenium
本文介绍了我无法在Google Chrome中使用硒打开新标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我打开新标签页的行
this is my line to open the new tab
driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
推荐答案
((JavascriptExecutor)driver).executeScript("window.open();");
此JavaScript代码为Chrome浏览器打开了一个新标签.
This JavaScript code opens a new tab for the Chrome browser.
这篇关于我无法在Google Chrome中使用硒打开新标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文