atm i´m working on a "hobby-project" with the private communication tool Wire. https://app.wire.com/auth/#login
I tried to log on my Wire-Account with HTML UNIT. I "think" i got some code-problem with the Login-Button. Below I've attached the full code.
public static void submittingForm() throws Exception {
//webClient Options
final WebClient webClient = new WebClient(BrowserVersion.CHROME);
webClient.getOptions().setRedirectEnabled(true);
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setUseInsecureSSL(true);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getCookieManager().setCookiesEnabled(true);
webClient.getOptions().setJavaScriptEnabled(false);
// Load HtmlPage
final HtmlPage page1 = webClient.getPage("https://app.wire.com/auth/#login");
System.out.println(page1.getTitleText());
System.out.println(page1.getForms());
// Load Form.
HtmlForm form = page1.getFirstByXPath("//form[@id='login-method-password']");
// Login-Data
HtmlTextInput usernameInput = page1.getHtmlElementById("wire-login-username");
usernameInput.setValueAttribute("blibalub@bli.de");
System.out.println(usernameInput.getValueAttribute());
HtmlPasswordInput passwordInput = page1.getHtmlElementById("wire-login-password");
passwordInput.setText("bliablubi");
System.out.println(passwordInput.getValueAttribute());
DomElement button = (DomElement) form.getFirstByXPath("//*[@id='wire-password-login']");
HtmlPage page2 = (HtmlPage) button.click();
System.out.println(page2.getForms()); // HERE same output like above page1
}
Code seems to work but page1 and page2 are the same.
Here is a "Warning" Output:
*PM com.gargoylesoftware.htmlunit.html.InputElementFactory createElementNS
INFORMATION: Bad input type: "tel", creating a text input*