fixes #92 - form submit fails when form element doesn't have method field
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -517,7 +517,7 @@ Casper.prototype.fill = function fill(selector, vals, submit) { | ... | @@ -517,7 +517,7 @@ Casper.prototype.fill = function fill(selector, vals, submit) { |
517 | if (submit) { | 517 | if (submit) { |
518 | this.evaluate(function(selector) { | 518 | this.evaluate(function(selector) { |
519 | var form = __utils__.findOne(selector); | 519 | var form = __utils__.findOne(selector); |
520 | var method = form.getAttribute('method').toUpperCase() || "GET"; | 520 | var method = (form.getAttribute('method') || "GET").toUpperCase(); |
521 | var action = form.getAttribute('action') || "unknown"; | 521 | var action = form.getAttribute('action') || "unknown"; |
522 | __utils__.log('submitting form to ' + action + ', HTTP ' + method, 'info'); | 522 | __utils__.log('submitting form to ' + action + ', HTTP ' + method, 'info'); |
523 | form.submit(); | 523 | form.submit(); | ... | ... |
-
Please register or sign in to post a comment