I am unable to switch to the 'current active tab' in Chrome using WebDriver. I have tried the following:
We can switch to tab, however we do not know which one is the current active selected tab
driver.switchTo().activeElement()
however it is of no helpdriver.switchTo().Window("")
, doesn't workSet<String> allWindowHandles = driver.getWindowHandles();
for (String windowHandle : allWindowHandles) {
if (!windowHandle.equals(<cannot get the active selected window handle>)) {
driver.switchTo().window(windowHandle);
}
}
However getting the current active selected tab handle is the issue.