java - Unable to switch focus to newtab/window in Internet Explorer using Selenium Webdriver -
the problem here is, i'm unable focus new tab/window both, instead focus remains in first one. please help.
driver=new internetexplorerdriver(); driver.findelement(by.cssselector("body")).sendkeys(keys.control +"t"); //driver.findelement(by.cssselector("body")).sendkeys(keys.control +"n"); (string winhandle : driver.getwindowhandles()) { driver.switchto().window(winhandle); } driver.get("https://google.com/");
the ie driver doesn't support enumeration of tabs within window. additionally, webdriver in general doesn't support automating "manually" opened tabs, opened control+t
. specific drivers may support functionality, it's not globally supported part of api contract.
the vast majority of times users attempting "manually open new tab, switch it, , automate it," use case isn't entirely thought through. since decline state why want perform action, opposed starting new driver instance in new window, it's impossible speculate course of action ought taking.
Comments
Post a Comment