Tuesday, August 28, 2012

java – How to open a new tab in the same browser by using Webdriver

I can open a new window in WebDriver by using Java with JavaScript. I am using Firefox. The code is as follows:



WebDriver driver = new FirefoxDriver();
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(\"function createDoc(){var w = window.open(); w.document.open(); w.document.write(\'<h1>Hello World!</h1>\'); w.document.close();}; createDoc();\");


How can I open a new tab in the same browser by using WebDriver (Selenium 2)?






Rating: 2 out of 5 based on 3 ratings



The post java – How to open a new tab in the same browser by using Webdriver appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/java-how-to-open-a-new-tab-in-the-same-browser-by-using-webdriver.html

No comments:

Post a Comment