-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathselenium-webdriver.node.txt
77 lines (65 loc) · 3.5 KB
/
selenium-webdriver.node.txt
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
┏━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ SELENIUM-WEBDRIVER ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━┛
VERSION ==> #Node module (2.42.0)
#Documentation not finished, because wd.js is better (almost same functionalities, better
#chaining, only compatible with Appium, but no compatible with Protactor)
MAIN OBJECTS ==> # - SW: require("selenium-webdriver")
# - BUILDER: creates the WEBDRIVER
METHODS RETURN ==> #All methods "return VAL..." meaning for FUNC() returns a WPROMISE (Webdriver PROMISE):
# - with VAL as state value
# - If several WPROMISE are ongoing, they are queued. So can't do:
# WEBDRIVER.FUNC().FUNC2()
# But can do:
# WEBDRIVER.FUNC(); WEBDRIVER.FUNC2()
# And it will be queued properly.
WPROMISE.cancel(ERROR) #Rejects WPROMISE
WPROMISE.then(FUNC(VAL),
FUNC2(ERROR))
WPROMISE.thenCatch
(FUNC2(ERROR)) #Same as WPROMISE.then(null, FUNC2)
WPROMISE.thenFinally(FUNC()) #
WPROMISE.isPending() #
SW.promise.defer() #Returns a WDEFERRED. Implements WPROMISE methods
WDEFERRED.promise #Returns WPROMISE
WDEFERRED.fulfill|reject(VAL) #
WDEFERRED.removeAll() #Removes all then() FUNC, FUNC2, etc.
SW.promise.all(WPROMISE_ARR) #Similar to Q
SW.promise.createFlow(FUNC()) #Creates a CONTROLFLOW, i.e. a chain of PROMISE.
#Returns a PROMISE with FUNC() return value as state value.
SW.promise.controlFlow() #Returns CONTROLFLOW
CONTROLFLOW.on
("uncaugthException",
FUNC(ERROR)) #
new require #Returns a SERVER, which allows to start Selenium server from JavaScript.
("selenium-webdriver/remote").#FILE is the server *.jar file.
SeleniumDriver(FILE, OBJ) # - port UINT
# - [jwmA|a]rgs STR_ARR
# - env OBJ
# - stdio: same as Node.js spawn() (déf: "ignore")
SERVER.start() #Returns server URL
SERVER.stop() #
SERVER.kill() #As opposed to stop() (which integrates into current PROMISE flow), it kills immediately.
SERVER.address() #Returns STR
SERVER.isRunning() #
new SW.Builder() #Returns a BUILDER (doesn't use PROMISE)
BUILDER.build() #Returns a WEBDRIVER
BUILDER.withCapabilities
(CAPABILITIES) #Adds CAPAB_OBJ
BUILDER.getCapabilities() #
BUILDER.usingServer(URL) #
BUILDER.getServerUrl() #
BUILDER.usingSession(SESIONID)#Does not seem to be implemented
BUILDER.getSession() #
new SW.Capabilities(CAPAB_OBJ)#Returns a CAPABILITIES
CAPABILITIES.get(VAR) #
CAPABILITIES.set(VAR,VAL) #
CAPABILITIES.has(VAR) #
CAPABILITIES.toJSON() #Returns CAPAB_OBJ
CAPABILITIES.merge(CAPABILIS2)#
SW.Capabilities.android|chrome
|firefox|htmlunit|ie|iphone|
ipad|opera|phantomjs|safari() #Returns CAPABILITIES fulfilling the basic params of those servers.
WEBDRIVER.get(URL) #
WEBDRIVER.getTitle() #Returns STR
WEBDRIVER.quit() #