我用htmlunit.如果没有属性'value',我如何设置文本输入的值?
<input type="text" onkeypress="test();" id="id" name="name" class="ttt">
Run Code Online (Sandbox Code Playgroud)
我尝试了这个,但没有
((HtmlTextInput) portfolios.getHtmlElementById("id")).setText("text");
((HtmlInput) portfolios.getHtmlElementById("id")).setTextContent("text");
((HtmlInput) portfolios.getHtmlElementById("id")).setAttribute("value", "text");
Run Code Online (Sandbox Code Playgroud)
请帮忙!
小智 9
HtmlInput intputBox = (HtmlInput)portfolios.getHtmlElementById('id');
intputBox.setValueAttribute("text");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9489 次 |
| 最近记录: |