Warm tip: This article is reproduced from serverfault.com, please click

Open a new tab using JavascriptExecutor of selenium in Internet Explorer

发布于 2018-07-21 11:38:21

I am using

((JavascriptExecutor) driver).executeScript("window.open();");

to open a new tab. It works fine in Chrome using selenium driver but not in IE, any suggestions? Thanks

Have tried this also: but no luck

 ((JavascriptExecutor) driver).executeScript("window.open('http://www.google.com','_blank');");
Questioner
Rahul
Viewed
0
Rahul 2018-07-22 21:15:12

Answering if anyone gets the same issues

Step 1:

Internet Options > General Tab > Click on Settings > Click on Tabs > Select When Pop-up is encountered to Always open pop-ups in a new tab

Step 2:

Now go to Privacy and Add website to allow popups from