Skip to content

Commit a4da76b

Browse files
committed
use new setValue instead of setValueAttribute for input elements
1 parent 374eb37 commit a4da76b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.seleniumhq.selenium</groupId>
77
<artifactId>htmlunit-driver</artifactId>
8-
<version>2.61.0</version>
8+
<version>2.62.0-SNAPSHOT</version>
99

1010
<name>htmlunit-driver</name>
1111
<description>WebDriver compatible driver for HtmlUnit headless browser</description>
@@ -14,7 +14,7 @@
1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<selenium.version>3.141.59</selenium.version>
17-
<htmlunit.version>2.61.0</htmlunit.version>
17+
<htmlunit.version>2.62.0-SNAPSHOT</htmlunit.version>
1818
<jetty.version>9.4.46.v20220331</jetty.version>
1919
</properties>
2020

src/main/java/org/openqa/selenium/htmlunit/HtmlUnitKeyboard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void sendKeys(HtmlElement element, InputKeysContainer keysToSend, boolea
7070
// HtmlElement.type doesn't modify the value of a file input element. Special case.
7171
if (element instanceof HtmlFileInput) {
7272
HtmlFileInput fileInput = (HtmlFileInput) element;
73-
fileInput.setValueAttribute(keysSequence);
73+
fileInput.setValue(keysSequence);
7474
return;
7575
}
7676

src/main/java/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public void clear() {
232232
if (htmlInput.isDisabled()) {
233233
throw new InvalidElementStateException("You may only interact with enabled elements");
234234
}
235-
htmlInput.setValueAttribute("");
235+
htmlInput.setValue("");
236236
if (htmlInput instanceof SelectableTextInput) {
237237
((SelectableTextInput) htmlInput).setSelectionEnd(0);
238238
}
@@ -362,6 +362,9 @@ public String getAttribute(String name) {
362362
if (element instanceof HtmlFileInput) {
363363
return ((HTMLInputElement) element.getScriptableObject()).getValue();
364364
}
365+
if (element instanceof HtmlInput) {
366+
return ((HtmlInput) element).getValue();
367+
}
365368
if (element instanceof HtmlTextArea) {
366369
return ((HtmlTextArea) element).getText();
367370
}

0 commit comments

Comments
 (0)