Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java HTML单元按钮单击_Java_Url_Button_Htmlunit - Fatal编程技术网

Java HTML单元按钮单击

Java HTML单元按钮单击,java,url,button,htmlunit,Java,Url,Button,Htmlunit,仍在进行有线登录。单击“登录”按钮仍有一些问题 使用: webClient.getOptions().setJavaScriptEnabled(true); getLogger(“com.gargoylesoftware”).setLevel(Level.OFF); System.setProperty(“org.apache.commons.logging.Log”、“org.apache.commons.logging.impl.NoOpLog”) 按钮如下所示: 输入id=“线路密码登录”

仍在进行有线登录。单击“登录”按钮仍有一些问题

使用:

webClient.getOptions().setJavaScriptEnabled(true); getLogger(“com.gargoylesoftware”).setLevel(Level.OFF); System.setProperty(“org.apache.commons.logging.Log”、“org.apache.commons.logging.impl.NoOpLog”)

按钮如下所示:

输入id=“线路密码登录”class=“按钮白色btn操作 btn登录电子邮件“type=“submit”data bind=“enable: 可以登录\u密码,l10n\u输入:z.string.auth\u帐户\u登录“ 数据uie name=“登录”value=“登录”

我尝试了许多解决方案,以下是一些:

HtmlSubmitInput Button = page1.getHtmlElementById("wire-password-login");
HtmlPage page2 = Button.click();

没有错误,但第2页始终与第1页相同。


如果有帮助,这里是我的输入用户名代码:

HtmlTextInput usernameInput = page1.getHtmlElementById("wire-login-username");
usernameInput.setValueAttribute("Answer42@Kappa.de");
System.out.println(usernameInput.getValueAttribute());
使用HtmlPasswordInput的密码也一样。两个都很好用


-->所以我不知道为什么我的纽扣坏了?有什么提示吗

第2页的Url应该类似于:或app.wire.com

谢谢

HtmlSubmitInput Login = page1.getFirstByXPath("//*[@id='wire-password-login']");
HtmlPage page2 = Login.click();
webClient.waitForBackgroundJavaScript(2000);
System.out.println(page2.getUrl());
HtmlTextInput usernameInput = page1.getHtmlElementById("wire-login-username");
usernameInput.setValueAttribute("Answer42@Kappa.de");
System.out.println(usernameInput.getValueAttribute());