将属性dom.disable_window_flip
设置为false时,能够为Firefox中的主窗口启用“升高或降低窗口”选项。但是,对于增强器窗口,该选项未启用,当我在主窗口上执行window.focus时,增强器窗口不会进入后台。
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("dom.disable_window_flip",false);
driver = new FirefoxDriver(profile);
augmentedDriver = new Augmenter().augment(driver);
((JavascriptExecutor)driver).executeScript("window.focus()");