-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path键盘基础操作演示脚本.js
77 lines (55 loc) · 1.81 KB
/
键盘基础操作演示脚本.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* 小瓶RPA演示demo,具体api请查看*流程开发文档*
* 官网:https://rpa.pbottle.com/
* 流程开发文档:https://gitee.com/pbottle/pbottle-rpa/wikis/pages
*/
const pbottleRPA = require('./pbottleRPA')
console.log("=== 键盘操作测试 ===");
console.log(Date());
pbottleRPA.setDefaultDelay(0); //手动管理操作延时
pbottleRPA.tts('开始运行小瓶RPA键盘操作演示脚本。... 快捷键 :Ctrl+shift+Q 可手动退出')
//延迟5秒
pbottleRPA.wait(12)
let resolution = pbottleRPA.getResolution()
console.log('当前电脑屏幕分辨率', resolution)
pbottleRPA.tts(`当前电脑屏幕分辨率: ${resolution.w} 乘以 ${resolution.h}`)
pbottleRPA.wait(6)
pbottleRPA.tts('准备打开网页浏览并用快捷键进入全屏,5秒后开始')
pbottleRPA.wait(10)
//用浏览器打开网址
pbottleRPA.openURL('https://rpa.pbottle.com?from=demo')
pbottleRPA.wait(3)
pbottleRPA.moveAndClick(50,500)
pbottleRPA.tts('缩放页面')
pbottleRPA.keyTap('ctrl + -')
pbottleRPA.keyTap('ctrl + -')
pbottleRPA.keyTap('ctrl + -')
pbottleRPA.keyTap('ctrl + =')
pbottleRPA.keyTap('ctrl + =')
pbottleRPA.keyTap('ctrl + =')
pbottleRPA.wait(1)
pbottleRPA.keyTap('f11')
pbottleRPA.wait(2)
pbottleRPA.tts('翻页查看')
pbottleRPA.keyTap('page down')
pbottleRPA.wait()
pbottleRPA.keyTap('page down')
pbottleRPA.wait()
pbottleRPA.keyTap('page down')
pbottleRPA.wait()
pbottleRPA.tts('翻页回来')
pbottleRPA.keyTap('page up')
pbottleRPA.wait()
pbottleRPA.keyTap('page up')
pbottleRPA.wait()
pbottleRPA.keyTap('page up')
pbottleRPA.wait(2)
pbottleRPA.tts('收藏我们吧,十分感谢')
pbottleRPA.keyTap('ctrl + d')
pbottleRPA.wait(1)
pbottleRPA.keyTap('enter')
pbottleRPA.wait(2)
pbottleRPA.keyTap('f11')
pbottleRPA.tts('演示结束')
console.log("准备结束脚本");
pbottleRPA.exit("脚本结束")