My project includes Selenium webdriver, JAVA, Maven, TestNG, Jenkins, Allure (reports). I have a few suites of tests with 100+ test cases, and I iterate them through 3 different browsers (the tests run in parallel using TestNG).
There is one test that can't pass unless I am actually watching the window and see the test run.
I will explain: what am I trying to test? our JS developers created a feature that only if the user has focus on the window, then a image slideshow will start to move and change images.
On Firefox and Chrome it pass great- I don't need to see the test. The focus can be on other tabs or browsers, and the driver will emulate everything. On IEdriver its not like that!!
I have tried to add many capabilities to the driver and still nothing (some of them solved me some other issues):
}else if (browser.equalsIgnoreCase("ie")) {
String exeServiceIEdriver = Consts.ieDriverPath;
System.setProperty("webdriver.ie.driver", exeServiceIEdriver);
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability("nativeEvents", false);
ieCapabilities.setCapability("unexpectedAlertBehaviour", "accept");
ieCapabilities.setCapability("ignoreProtectedModeSettings", true);
ieCapabilities.setCapability("disable-popup-blocking", true);
ieCapabilities.setCapability("enablePersistentHover", true);
ieCapabilities.setCapability("ignoreZoomSetting", true);
//ieCapabilities.setCapability("version", "12"); does it work?? don't think so..
ieCapabilities.setCapability("requireWindowFocus", true);
//ieCapabilities.setCapability("browser_version", "9.0"); // Does NOT work. need user agent
ieCapabilities.setCapability("IE_ENSURE_CLEAN_SESSION", true); // Does NOT work. need user agent
ieCapabilities.setCapability("browserAttachTimeout",5000);
ieCapabilities.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS,true);
ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS,true);
ieCapabilities.setCapability(CapabilityType.SUPPORTS_APPLICATION_CACHE,false);
driver = new InternetExplorerDriver(ieCapabilities);
Log.info("\n*** Starting IE Browser ***");