You can try the following:
- Switch to the new opened tab.
- Close the current windows (in this case, the new tab).
-
Switch back to the first window.
browser.getAllWindowHandles().then(function (handles) { browser.driver.switchTo().window(handles[1]); browser.driver.close(); browser.driver.switchTo().window(handles[0]); });