fixed #368 - check that a link still exists after click for processing further
Showing
2 changed files
with
5 additions
and
1 deletions
... | @@ -69,6 +69,7 @@ None yet. | ... | @@ -69,6 +69,7 @@ None yet. |
69 | XXXX-XX-XX, v1.0.2 | 69 | XXXX-XX-XX, v1.0.2 |
70 | ------------------ | 70 | ------------------ |
71 | 71 | ||
72 | - fixed [#368](https://github.com/n1k0/casperjs/issues/368) - Remote JS error is thrown when a click target is missing after `click()` | ||
72 | - merged PR [#357](https://github.com/n1k0/casperjs/pull/357) - fire the `input` event after setting input value (required to support [angular.js](http://angularjs.org/) apps) | 73 | - merged PR [#357](https://github.com/n1k0/casperjs/pull/357) - fire the `input` event after setting input value (required to support [angular.js](http://angularjs.org/) apps) |
73 | 74 | ||
74 | 2013-01-17, v1.0.1 | 75 | 2013-01-17, v1.0.1 | ... | ... |
... | @@ -403,7 +403,10 @@ Casper.prototype.click = function click(selector) { | ... | @@ -403,7 +403,10 @@ Casper.prototype.click = function click(selector) { |
403 | this.checkStarted(); | 403 | this.checkStarted(); |
404 | var success = this.mouseEvent('click', selector); | 404 | var success = this.mouseEvent('click', selector); |
405 | this.evaluate(function(selector) { | 405 | this.evaluate(function(selector) { |
406 | document.querySelector(selector).focus(); | 406 | var element = __utils__.findOne(selector); |
407 | if (element) { | ||
408 | element.focus(); | ||
409 | } | ||
407 | }, selector); | 410 | }, selector); |
408 | return success; | 411 | return success; |
409 | }; | 412 | }; | ... | ... |
-
Please register or sign in to post a comment