Internet Explorer 11 - Open links in new tab instead of new window

931 views
Skip to first unread message

Dieter Da

unread,
Oct 23, 2017, 5:27:12 AM10/23/17
to Selenium Users
Hi guys,

when I run Selenium tests (written in Java) with the Internet Explorer, opening a link (e.g. via <a>-Tag or clickable <div>) always creates a new window instead of a new tab.

I already set the respective option in the Internet Options to open links in new tabs, but it does not work.
However, when I use the Internet Explorer without Selenium to open the same link, it works and the link is opened in a new tab.

As a result of this, I think that the Internet Explorer Driver resets this option somehow, but I do not know how to prevent it from doing so.
Do I have to set a specific capability or something like that?

Thanks in advance!



Selenium Version:
 - 3.6.0

Internet Explorer:
 - Version: 11.953.14393.0
 - Update-Version: 11.0.40 (KB4012204)
 - Architecture: 32bit

Operating System:
 - Windows 10 Enterprise

Jim Evans

unread,
Oct 23, 2017, 5:58:22 AM10/23/17
to Selenium Users
No, you cannot set this in the IE driver. Help me understand why it’s important to use new tabs instead of windows. There is no difference between a page opened in a window vs. a tab. Is it merely aesthetics?

Dieter Da

unread,
Oct 23, 2017, 7:06:18 AM10/23/17
to Selenium Users
I have to run the tests in fullscreen mode, because I take screenshots while performing the test and compare them afterwards with reference screenshots, so all menubars etc. have to be hidden.
In order to activate fullscreen mode, I send F11 to the webpage. When I open a link in fullscreen mode, the browser opens a new window (which is not in fullscreen mode), so I have to send another F11 key after closing the old window.
This solution basically works, but IE opens the new window randomly (in around 5% of the time) directly in fullscreen mode. When I then send my F11 key to basically activate fullscreen mode, I deactivate it instead and the test fails.

That's why I wanted to open a link in a new tab in hope that the new tab is already in fullscreen mode, so that I can circumvent this "bug" and do not have to send an F11 key everytime I switch the window.

Tibor Fodor

unread,
Feb 2, 2018, 10:38:56 PM2/2/18
to Selenium Users
Hello Jim,
I also have problems with IE WebDriver, that I am unable to open new tab, but always new window will be opened.
I use web automation to prepare web pages to help tester person to make his/her manual check.
There are about 10-15 pages that I prepare that contains useful information for the tester person.
It is difficult for the tester person to switch over all the windows they are opened for one test.
It would be much more convenient to have all these related pages as tabs in one window.
I assume a lot of people faces the same problem with IE tabs vs. window.
It would be useful to mention this constraint in the driver's documentation!
Regards,
Tibor 

adhow

unread,
Dec 17, 2019, 4:16:43 AM12/17/19
to Selenium Users
I have a suite of tests that I run against our work site.
I have to validate that the site works in Chrome, Firefox, Edge, and IE11 for support.
If IEDriver opened in a new tab when the link is clicked (like it does in the actual browser) then I wouldn't have to write a special set of tests just for IE.
Also, this can be good for replicating default site/browser behavior.
Reply all
Reply to author
Forward
0 new messages