We used the code below to get input fields on https://login.microsoftonline.com page:
String msOnlineLoginURI = "https://login.microsoftonline.com";
String loginFormId = "i0281";
String emailInputId = "i0116";
String submitButtonId = "idSIButton9";
final WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED);
webClient.setRefreshHandler(new ImmediateRefreshHandler());
webClient.setCookieManager(new CookieManager());
webClient.getOptions().setRedirectEnabled(true);
webClient.getOptions().setJavaScriptEnabled(true);
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
HtmlPage page = webClient.getPage(msOnlineLoginURI);
webClient.waitForBackgroundJavaScript(5000);
if (page.getElementById(loginFormId) != null) {
HtmlEmailInput emailInput = (HtmlEmailInput) page.getElementById(emailInputId);
HtmlSubmitInput submitInput = (HtmlSubmitInput) page.getElementById(submitButtonId);
}
And it used to work just fine up until now. For some reason the input elements can't be located, however form element is there.
Tried using latest version 2.35.0. Same story
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too