我无法单击 HtmlUnit 的按钮,已经通过名称和 ID 尝试过,它没有值,我已经等待但仍然没有。
HtmlButton button = (HtmlButton) page2.getElementById("imbInserir");
try {
button.click();
}catch(Exception e) {
System.out.println("I could not push the button");
e.printStackTrace();
return;
}
}
}
Html 页面按钮:
<input type="image" name="ctl00$ContentPlaceHolderConteudoPagina$dtvFiltragem$imbInserir" id="imbInserir" title="Inserir Apontamento" src="../Imagens/inserir.png">
安慰:
htmlunit.Acesso.main(Acesso.java:74) 处的 java.lang.NullPointerException