Skip to content

Commit

Permalink
Form handling in htmlunit works correct without any additional tricks
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
rbri authored and barancev committed May 5, 2015
1 parent 14db564 commit f548be9
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,6 @@ public void click() {
// element not visible either
}

if (element instanceof HtmlButton) {
String type = element.getAttribute("type");
if (type == DomElement.ATTRIBUTE_NOT_DEFINED || type == DomElement.ATTRIBUTE_VALUE_EMPTY) {
element.setAttribute("type", "submit");
}
}

HtmlUnitMouse mouse = (HtmlUnitMouse) parent.getMouse();
mouse.click(getCoordinates());

Expand Down Expand Up @@ -209,7 +202,7 @@ private void submitForm(HtmlForm form) {
continue;
}

if (isBefore(submit)) {
if (submit == null) {
submit = element;
}
}
Expand Down Expand Up @@ -248,10 +241,6 @@ private boolean isSubmitElement(HtmlElement element) {
return candidate != null;
}

private boolean isBefore(HtmlElement submit) {
return submit == null;
}

@Override
public void clear() {
assertElementNotStale();
Expand Down

0 comments on commit f548be9

Please sign in to comment.