I want to know if there is any way to distinguish between a new window and a new tab, natively in Selenium.
On my test page there are buttons to open a page in the same window, a new window, or a new tab.
I know how to switch to the new window or tab using window handles, but I cannot distinguish between the two. How do I know if the button opened the link in a new tab, and not a new window?
i.e. in pseudocode (need code for openedInNewWindow() and openedInNewTab())
click(newTabButton);
if (openedInSameWindow()) {
Log.Error("Link opened in same window :(");
} else if (openedInNewWindow()) {
Log.Error("Link opened in new window :(");
} else if (openedInNewTab()) {
Log.Success("Link opened in new tab :)");
} else {
Log.Error("Link didn't open anything :(");
}