Commit 057c2a04 057c2a04ef4f616ec19800431f3dc0f4c35d633e by Nicolas Perriault

added documentation for Casper#fill()

1 parent 1d73e498
Showing 1 changed file with 26 additions and 0 deletions
......@@ -424,6 +424,32 @@ casper.start('http://www.google.fr/', function(self) {
});
```
### Casper#fill(String selector, Object values)
Fills the fields of a form with given values.
Example:
```javascript
casper.start('http://some.tld/contact.form', function(self) {
self.fill('form#contact-form', {
'subject': 'I am watching you',
'content': 'So be careful.',
'name': 'Chuck Norris',
'email': 'chuck@norris.com',
});
self.click('input[type=submit]');
}).then(function(self) {
self.evaluateOrDie(function() {
return /message sent/.test(document.body.innerText);
}, 'sending message failed');
}).run(function(self) {
self.echo('message sent').exit();
});
```
**WARNING:** Please don't use Casper nor PhantomJS to send spam, or I call the Chuck.
### Casper#repeat(int times, function then)
Repeats a navigation step a given number of times.
......