The HTML element below is part of a form:
<input id="code" type="text" name="code" placeholder="Enter code here" autocomplete="off"/>
I would like to pass a string to this element. I do not know how to pass a string without a value attribute.
The HTML element below is part of a form:
<input id="code" type="text" name="code" placeholder="Enter code here" autocomplete="off"/>
I would like to pass a string to this element. I do not know how to pass a string without a value attribute.
You can try to pass the string to the input by using setText()
method:
HtmlTextInput input = (HtmlTextInput) page.getElementById("code");
input.setText("your_text");
or type()
method:
HtmlTextInput input = (HtmlTextInput) page.getElementById("code");
input.type("your_text");