After clicking a row it opens a new tab and redirects you to it , what I want is after getting redirected to it , is jump back to the original tab Original tab link is = http://localhost:82/receivechecklist.php , after clicking the row it redirects to = http://localhost:82/collection.php?wid=100000000000001
private static By clickFirstInvoice=By.xpath("//span[contains(text(),'Customer 1')]");
driver.findElement(clickFirstInvoice).click();
Thread.sleep(500);
new WebDriverWait(driver,10).until(ExpectedConditions.numberOfWindowsToBe(2));
driver.switchTo().window(driver.getWindowHandles().stream().reduce((f, s) -> s).orElse(null));
System.out.println("Successful in switching to collection tab");
I want to go back to the original tab after clicking the invoice