-
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
#Summary
#Example
Given the following
<html><head><title>testcase</title></head>
<body>
<input type="number" step="0.01" value="0.00" id="decimalField" value="decimalField" />
</body>
</html>
You are unable to set the value of the HtmlNumberInput to set the value to a decimal value.
htmlPage.getElementByName<htmlNumberInput>("decimalField").setValue("0.5");
assertThat(htmlPage.getElementByName<htmlNumberInput>("decimalField").getValue()).isEqualTo("0.5"); // returns 0
This appears to be due to the fact that HtmlNumberInput tries to parse the value as a Long and long doesn't accept decimal values.
#Workarounds
calling setAttributeNs(null, "value", "0.5") works correctly.
#Possible Solutions
- Ignore the value validation completely.
- Try to parse the value as a BigDecimal
- Try to parse the value as a Double.
Metadata
Metadata
Assignees
Labels
No labels