如何在同一会话中打开新标签页 [英] How to open a new tab in same session
本文介绍了如何在同一会话中打开新标签页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在同一会话中打开新选项卡,我已经尝试了其他人提供的通用解决方案,但是它不起作用.
How to open a new tab in same session, I have already tried common solution given by others but its not working.
我正在Chrome浏览器中尝试.
I am trying in chrome browser.
我的项目在Java中
推荐答案
要打开 New Blank TAB
,您可以使用以下代码行:
To open a New Blank TAB
you can use the following line of code :
((JavascriptExecutor) driver).executeScript("window.open('','_blank');");
要打开 New TAB with url
,可以使用以下代码行:
To open a New TAB with url
you can use the following line of code :
((JavascriptExecutor) driver).executeScript("window.open('http://facebook.com/');");
这篇关于如何在同一会话中打开新标签页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文