-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddtorrent.js
45 lines (36 loc) · 1.02 KB
/
addtorrent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var casper = require('casper').create({
viewportSize: {width: 1280, height: 800},
verbose: true,
logLevel: "error"
});
casper.userAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)')
casper.start('http://admin:[email protected]/Download_manager.htm');
casper.on('popup.created', function() {
this.echo("url popup created : " + this.getCurrentUrl(),"INFO");
});
casper.thenClick('input[value="usb"]',function() {
this.echo('Main USB selected: ');
});
casper.thenClick('#browser1',function() {
this.waitForPopup(/.*/, function(){
this.echo("popup opened");
})
this.withPopup(/.*/, function(){
this.thenClick('a#sd2',function() {
this.capture('screenshot.png')
});
this.thenClick('button[name="ok"]',function() {
this.echo('Pushed OK');
});
});
});
casper.wait(3000, function() {
this.echo("Wait to load");
});
casper.thenClick('button[name="add_task"]',function() {
this.echo('Confirmed');
});
casper.wait(3000, function() {
casper.capture('screenshot2.png');
});
casper.run();