0

I am using IE11 for my selenium tests. I Am clicking on a link which when done manually opens up the link on a new tab. When I am trying to do the same thing with Selenium, it does not open the link on a new tab rather, it opens up on a new window.

Is there a way to force IE to click and open the link on a new tab?

I am able to achieve the same with Firefox and Chrome, but with IE, as soon as the link is clicked, it opens on a new window rather than a new tab.

if (BROWSER_TYPE.equals("IE")) {    
    Utility.log(this.getClass().getName(),Level.INFO,"Browser type is IE downloading firefox driver is required.");
    WebDriverManager webDriverManagerObject = WebDriverManager.iedriver();
    webDriverManagerObject.targetPath(DRIVER_DOWNLOAD_PATH);
    if(!DRIVER_VERSION.equals("latest")) {      
        WebDriverManagerObject = webDriverManagerObject.version(DRIVER_VERSION);
    }
    Utility.log(this.getClass().getName(),Level.DEBUG,"Launching IE Browser");
    webDriverManagerObject.setup();
    driver = new InternetExplorerDriver();  
}

Expected Result: Clicking on the Link should open the page on a new tab on the same window in IE

Actual result: Clicking on the Link opens the page on a new window rather than a new tab.

Stephan T.
  • 5,843
  • 3
  • 20
  • 42
  • if you just want to test functionality what is the issue, you just need to use window handles in selenium to operate on next window which open – Shubham Jain Aug 29 '19 at 06:57
  • Functionality is not what we are looking to test out here. We are doing benchmarks tests for performance against different browser and want to replicate the same user action on different browser. Hope that answers your question! any suggestions on the workaround would be highly appreciated – Mera Bharat Mahaan Aug 29 '19 at 07:09
  • You'll want to set the default behavior for opening new windows/tabs. Tools>Internet Options>Settings... – pcalkins Aug 29 '19 at 18:29
  • @MeraBharatMahaan Could you able to find solution for this? – Dinesh Oct 28 '19 at 19:46

0 Answers0