In IE new window is opening instead of new tab in selenium web driver whereas same is working chrome

1,787 views
Skip to first unread message

rajesh mehta

unread,
May 17, 2017, 1:30:17 AM5/17/17
to Selenium Users
HI Group Members,

When a link is clicked manually in my application, it opens in new tab in Chrome and IE.However when my script is run, the link opens in a new window in IE instead of new tab. Same script runs as expected in Chrome. Any idea how to get rid of this?

I have used following  DesiredCapabilities   in code. Please revert asap.. 

else if (browser.equalsIgnoreCase("explorer"))
 {
 //String path = ExecutableJar.CDE; //DND For Package file
 //System.setProperty("webdriver.chrome.driver",path); //DND For Package file 
 System.setProperty("webdriver.ie.driver","C:\\\\temp\\AutomationTests_SampleCube\\src\\External_Jars\\libs\\IEDriverServer.exe");
   DesiredCapabilities  dc = DesiredCapabilities.internetExplorer();
   dc.setJavascriptEnabled(true);
   dc.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
   dc.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
   dc.setCapability(InternetExplorerDriver.ENABLE_ELEMENT_CACHE_CLEANUP, true);

   dc.setCapability(InternetExplorerDriver.NATIVE_EVENTS, true);
       
       return new InternetExplorerDriver(dc);
 }

Krishnan Mahadevan

unread,
May 17, 2017, 2:21:30 AM5/17/17
to seleniu...@googlegroups.com

Rajesh,

 

How does it matter if the link opens up in a new tab or a new window ? AFAIK these two are just two different presentations that the browser offers for ease of use for the users.

I don’t think it really matters if it’s a tab or a new window. To the browser and for that matter, to selenium, it’s the same thing.

 

I believe there’s a setting in IE wherein you can have IE always resort to opening new windows as tabs. Maybe its that setting that’s interfering here.

 

All said and done, your selenium script should be agnostic to this because in both the cases, the behavior would be the same w.r.t Selenium.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ce3b87f0-75bc-49ce-abba-71ee7856e99a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seleniumnovic

unread,
May 17, 2017, 9:09:03 AM5/17/17
to Selenium Users
HI Krishnan,

Well, thanks for ur time and patience for this revet. I second on this whatever you have explained but problem which i am facing is little different here. Had to move my control of driver from one tab to another tab upon clicking on some link which result to open a new tab. Now same is working fine chrome and firefox..but in IE it is opening a tab every time manually. However same is not happening whenever IE run by driver. 

Please suggest further what to do. Have tried to add some capabilities and option but no luck so far. 

Thanks 
Rajesh Mehta

⇜Krishnan Mahadevan⇝

unread,
May 17, 2017, 9:34:19 AM5/17/17
to Selenium Users

Am not sure I quite understand the problem. Are you saying that you aren't able to switch to the new tab using switchTo().window() ?



For more options, visit https://groups.google.com/d/optout.
--

Akshat Gupta

unread,
May 29, 2017, 1:08:53 AM5/29/17
to Selenium Users
Hi,

Try to use robot class. There you can press Ctrl + T for opening new Tab.
This is a option which will work. Better options still available.

Thanks.
Akshat

anil....@highradius.com

unread,
Feb 13, 2019, 6:47:10 AM2/13/19
to Selenium Users
Hey Rajesh,

Did you colve this problem?

NOTICE: The information contained in this transmission and any attachments is confidential and is for the use of the intended recipient(s) only. If you have received in error, please notify the sender and delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission.

Hiral Trivedi

unread,
Mar 12, 2019, 3:46:36 AM3/12/19
to Selenium Users
I am also facing same issue with IE browser. Please post e solution if in case you have it today.

anil....@highradius.com

unread,
Mar 12, 2019, 5:17:18 AM3/12/19
to Selenium Users


On Wednesday, May 17, 2017 at 11:00:17 AM UTC+5:30, Seleniumnovic wrote:

anil....@highradius.com

unread,
Mar 12, 2019, 5:20:26 AM3/12/19
to Selenium Users
Hi Hiral,

Could you add the below two lines to your ie browser settings

options.setCapability(CapabilityType.PAGE_LOAD_STRATEGY, "normal");
options.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

Before launching the script ensure clear all existing sessions.

I hope that solves your problem.

Regards,
Anil Kumar

anil....@highradius.com

unread,
Mar 12, 2019, 5:20:56 AM3/12/19
to Selenium Users
Hi Hiral,

Could you add the below two lines to your ie browser settings

options.setCapability(CapabilityType.PAGE_LOAD_STRATEGY, "normal");
options.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

Before launching the script ensure clear all existing sessions.

I hope that solves your problem.

Regards,
Anil Kumar

On Tuesday, March 12, 2019 at 1:16:36 PM UTC+5:30, Hiral Trivedi wrote:
Reply all
Reply to author
Forward
0 new messages