close existing tab and new tab in selenium java code example Example: selenium close current tab driver.close();