We have a an Automated suite that runs via Jenkins in a windows 10 machine (static slave). When executing we started encountering problems where in certain iFrames are not loading when running our scenario in headless mode via Jenkins. If we connect to the windows machine and execute the script in normal mode (with head) then it works completely fine. What could be the problem here ?
iframe:
<iframe _content-tfg-456="" heightadjustment="40" id="iframe-src" src="https://samplelink" style="height: 83.828px;"></iframe>
Chrome Driver options: (Added most of the options for debugging this issue)
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--test-type");
chromeOptions.addArguments("--lang=en_US");
chromeOptions.addArguments("--ignore-certificate-errors");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("disable-popup-blocking");
chromeOptions.addArguments("disable-infobars");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-setuid-sandbox");
chromeOptions.addArguments("--disable-notifications");
chromeOptions.addArguments("--verbose");
chromeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
chromeOptions.setExperimentalOption("useAutomationExtension", false);
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--screenshots");
chromeOptions.addArguments("--user-agent=Chrome/90.0.4430.93");
//chromeOptions.addArguments("--remote-debugging-port=9222");
chromeOptions.addArguments("--window-size=1920,1080");
Map<String, Object> chromePrefernces = new HashMap<String, Object>();
chromePrefernces.put("credentials_enable_service", false);
chromePrefernces.put("profile.password_manager_enabled", false);
chromeOptions.setExperimentalOption("prefs", chromePrefernces);
return new ChromeDriver(chromeOptions);