I'm trying to log in to a site with htmlunit, but whenever I try to type in the password field, it just becomes blank.
It works perfectly fine with the username field, but no matter what I try I can't get the password field to work. Does anyone know what the problem could be here? I'm able to type in both fields no problem, if I disable Javascript.
Target site = https://www.paragonclient.com/login?bnc=1&rsn=noOb&fromProt=&lng=
public static void main(String[] args) {
try (WebClient webClient = new WebClient(BrowserVersion.CHROME)){
HtmlPage page = webClient.getPage("https://www.paragonclient.com/login?bnc=1&rsn=noOb&fromProt=&lng=");
//final HtmlTextInput usernameInput = page.getHtmlElementById("Sentry_email");
final HtmlInput passwordInput = page.getHtmlElementById("Sentry_password");
final DomElement loginButton = page.getElementById("Sentry_button");
System.out.println(page.asText());
passwordInput.type("test2");
System.out.println(page.asText());
} catch (Exception e) {
e.printStackTrace();
}
}
Output (Notice how the password placeholder doesn't get replaced with what I typed)
1st print
Member Login
E-mail Address
Password
Log In
.
2nd print
Member Login
E-mail Address
Log In