I would like to automate the authentication process in https://appleid.apple.com/ using java webdriver selenium, but html elements of the form doesn't loaded in the DOM
to my knowledge, Selenium webdriver interpret the markup as a browser does. And It apply the CSS styles, run the JavaScript and the dynamically rendered content be added to the DOM
Why HTML elements are not loaded in the DOM ?
How can I proceed, to fix it and load all elements in the DOM, exactly like a browser ?
N.B : https://appleid.apple.com/ website use Mustache.JS (logic-less template)
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless", "--disable-gpu", "--window-size=1920,1200", "--ignore-certificate-errors");
WebDriver driver = new ChromeDriver(options);
driver.get("https://appleid.apple.com/");
waitForPageLoadComplete(driver, 30);
//can't found input name element
WebElement inputName = driver.findElement(By.id("account_name_text_field"));
System.out.println(driver.getPageSource());
}