Skip to content

Commit f548be9

Browse files
rbribarancev
authored andcommitted
Form handling in htmlunit works correct without any additional tricks
Signed-off-by: Alexei Barantsev <[email protected]>
1 parent 14db564 commit f548be9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

Diff for: java/client/src/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java

+1-12
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,6 @@ public void click() {
148148
// element not visible either
149149
}
150150

151-
if (element instanceof HtmlButton) {
152-
String type = element.getAttribute("type");
153-
if (type == DomElement.ATTRIBUTE_NOT_DEFINED || type == DomElement.ATTRIBUTE_VALUE_EMPTY) {
154-
element.setAttribute("type", "submit");
155-
}
156-
}
157-
158151
HtmlUnitMouse mouse = (HtmlUnitMouse) parent.getMouse();
159152
mouse.click(getCoordinates());
160153

@@ -209,7 +202,7 @@ private void submitForm(HtmlForm form) {
209202
continue;
210203
}
211204

212-
if (isBefore(submit)) {
205+
if (submit == null) {
213206
submit = element;
214207
}
215208
}
@@ -248,10 +241,6 @@ private boolean isSubmitElement(HtmlElement element) {
248241
return candidate != null;
249242
}
250243

251-
private boolean isBefore(HtmlElement submit) {
252-
return submit == null;
253-
}
254-
255244
@Override
256245
public void clear() {
257246
assertElementNotStale();

0 commit comments

Comments
 (0)