source: project/wiki/eggref/4/selenium @ 28181

Last change on this file since 28181 was 28181, checked in by Mario Domenech Goulart, 7 years ago

selenium: martup fix

File size: 8.5 KB
Line 
1[[tags: egg selenium]]
2
3== selenium
4
5[[toc:]]
6
7=== Introduction
8
9Chicken bindings for Selenium ([[http://code.google.com/p/selenium|http://code.google.com/p/selenium]])
10
11Very early stages.  Implements the JSON Wire Protocol
12([[http://code.google.com/p/selenium/wiki/JsonWireProtocol|http://code.google.com/p/selenium/wiki/JsonWireProtocol]])
13and the remote and Firefox webdrivers.
14
15Currently the Firefox webdriver requires a profile directory.  You can
16get the data I'm using for the profile at
17[[http://parenteses.org/mario/misc/profile.tar.bz2|http://parenteses.org/mario/misc/profile.tar.bz2]].
18Extract this archive and give its full path to
19{{with-firefox-webdriver}} (see the {{tests/firefox.scm}} file for
20usage example).
21
22'''Warning''': since these bindings are in very early development
23stage, the API is subject to change.
24
25
26=== Author
27
28[[/users/mario-domenech-goulart|Mario Domenech Goulart]]
29
30
31=== Repository
32
33[[https://github.com/mario-goulart/selenium|https://github.com/mario-goulart/selenium]]
34
35
36=== API
37
38==== Session
39
40===== quit!
41<procedure>(quit!)</procedure>
42
43===== capabilities
44<procedure>(capabilities)</procedure>
45
46===== set-implicit-wait-time!
47<procedure>(set-implicit-wait-time! time-ms)</procedure>
48
49
50==== Javascript
51
52===== execute-javascript
53<procedure>(execute-javascript script args)</procedure>
54
55
56===== execute-javascript-async
57<procedure>(execute-javascript-async script args)</procedure>
58
59
60===== javascript-dialog-text
61<procedure>(javascript-dialog-text)</procedure>
62
63
64===== set-javascript-dialog-text!
65<procedure>(set-javascript-dialog-text! text)</procedure>
66
67
68===== dismiss-javascript-dialog!
69<procedure>(dismiss-javascript-dialog!)</procedure>
70
71
72===== accept-javascript-dialog!
73<procedure>(accept-javascript-dialog!)</procedure>
74
75
76==== URLs
77
78===== set-url!
79<procedure>(set-url! url)</procedure>
80
81===== current-url
82<procedure>(current-url)</procedure>
83
84
85
86==== Navigation
87
88===== navigate-forward!
89<procedure>(navigate-forward!)</procedure>
90
91===== navigate-backward!
92<procedure>(navigate-backward!)</procedure>
93
94
95
96==== IME: Input Method Editor
97
98===== ime-available-engines
99<procedure>(ime-available-engines)</procedure>
100
101
102===== ime-active-engine
103<procedure>(ime-active-engine)</procedure>
104
105
106===== ime-activated?
107<procedure>(ime-activated?)</procedure>
108
109
110===== ime-deactivate!
111<procedure>(ime-deactivate!)</procedure>
112
113
114===== ime-activate!
115<procedure>(ime-activate!)</procedure>
116
117
118
119==== Frames & windows
120
121===== focus-frame!
122<procedure>(focus-frame! id)</procedure>
123
124===== focus-window!
125<procedure>(focus-window! id)</procedure>
126
127===== close-window!
128<procedure>(close-window! id)</procedure>
129
130
131===== window-handle
132<procedure>(window-handle)</procedure>
133
134
135===== window-handles
136<procedure>(window-handles)</procedure>
137
138
139==== User input
140
141===== user-input-speed
142<procedure>(user-input-speed)</procedure>
143
144===== set-user-input-speed!
145<procedure>(set-user-input-speed! speed)</procedure>
146
147
148==== Elements
149
150===== active-element
151<procedure>(active-element)</procedure>
152
153
154===== get-element-by-id
155<procedure>(get-element-by-id id)</procedure>
156
157
158===== get-element-by-name
159<procedure>(get-element-by-name name)</procedure>
160
161
162===== get-element-by-class-name
163<procedure>(get-element-by-class-name class-name)</procedure>
164
165
166===== get-element-by-css-selector
167<procedure>(get-element-by-css-selector css-selector)</procedure>
168
169
170===== get-element-by-link-text
171<procedure>(get-element-by-link-text link-text)</procedure>
172
173
174===== get-element-by-partial-link-text
175<procedure>(get-element-by-partial-link-text partial-link-text)</procedure>
176
177
178===== get-element-by-tag-name
179<procedure>(get-element-by-tag-name tag-name)</procedure>
180
181
182===== get-element-by-xpath
183<procedure>(get-element-by-xpath xpath)</procedure>
184
185
186===== element-value
187<procedure>(element-value element)</procedure>
188
189
190===== element-tag-name
191<procedure>(element-tag-name element)</procedure>
192
193
194===== element-text
195<procedure>(element-text element)</procedure>
196
197
198===== select-element!
199<procedure>(select-element! element)</procedure>
200
201
202===== toggle-element!
203<procedure>(toggle-element! element)</procedure>
204
205
206===== click-element!
207<procedure>(click-element! element)</procedure>
208
209
210===== clear-element!
211<procedure>(clear-element! element)</procedure>
212
213
214===== hover-element!
215<procedure>(hover-element! element)</procedure>
216
217
218===== drag-element!
219<procedure>(drag-element! element)</procedure>
220
221
222===== element-enabled?
223<procedure>(element-enabled? element)</procedure>
224
225
226===== element-selected?
227<procedure>(element-selected? element)</procedure>
228
229
230===== element-displayed?
231<procedure>(element-displayed? element)</procedure>
232
233
234===== element-location
235<procedure>(element-location element)</procedure>
236
237
238===== element-location-in-view
239<procedure>(element-location-in-view element)</procedure>
240
241
242===== element-size
243<procedure>(element-size element)</procedure>
244
245
246===== element-css-property-value
247<procedure>(element-css-property-value element)</procedure>
248
249
250===== set-element-value!
251<procedure>(set-element-value! element value)</procedure>
252
253
254===== active-element-send-modifier!
255<procedure>(active-element-send-modifier! key down?)</procedure>
256
257
258===== element-attribute-value
259<procedure>(element-attribute-value element attribute)</procedure>
260
261
262===== same-element?
263<procedure>(same-element? element1 element2)</procedure>
264
265
266===== get-elements-by-class-name
267<procedure>(get-elements-by-class-name class-name)</procedure>
268
269
270===== get-elements-by-css-selector
271<procedure>(get-elements-by-css-selector css-selector)</procedure>
272
273
274===== get-elements-by-id
275<procedure>(get-elements-by-id id)</procedure>
276
277
278===== get-elements-by-name
279<procedure>(get-elements-by-name name)</procedure>
280
281
282===== get-elements-by-link-text
283<procedure>(get-elements-by-link-text link-text)</procedure>
284
285
286===== get-elements-by-partial-link-text
287<procedure>(get-elements-by-partial-link-text partial-link-text)</procedure>
288
289
290===== get-elements-by-tag-name
291<procedure>(get-elements-by-tag-name tag-name)</procedure>
292
293
294===== get-elements-by-xpath
295<procedure>(get-elements-by-xpath xpath)</procedure>
296
297
298
299==== Cookies
300
301===== get-cookies
302<procedure>(get-cookies)</procedure>
303
304
305===== set-cookie!
306<procedure>(set-cookie! name value #!key path domain secure? expiry)</procedure>
307
308
309===== get-cookies-by-name
310<procedure>(get-cookies-by-name name/regex)</procedure>
311
312
313===== get-cookies-by-value
314<procedure>(get-cookies-by-value value/regex)</procedure>
315
316
317===== get-cookies-by-domain
318<procedure>(get-cookies-by-domain domain/regex)</procedure>
319
320
321===== get-cookies-by-path
322<procedure>(get-cookies-by-path path/regex)</procedure>
323
324
325===== cookie-name
326<procedure>(cookie-name cookie)</procedure>
327
328
329===== cookie-value
330<procedure>(cookie-value cookie)</procedure>
331
332
333===== cookie-path
334<procedure>(cookie-path cookie)</procedure>
335
336
337===== cookie-domain
338<procedure>(cookie-domain domain)</procedure>
339
340
341===== cookie-secure?
342<procedure>(cookie-secure? cookie)</procedure>
343
344
345===== cookie-expiry
346<procedure>(cookie-expiry cookie)</procedure>
347
348
349
350
351==== Pages
352
353===== page-source
354<procedure>(page-source)</procedure>
355
356
357===== page-title
358<procedure>(page-title)</procedure>
359
360
361===== refresh-page!
362<procedure>(refresh-page!)</procedure>
363
364
365
366==== Screen
367
368===== screen-orientation
369<procedure>(screen-orientation)</procedure>
370
371
372===== screenshot
373<procedure>(screenshot)</procedure>
374
375
376==== Mouse actions
377
378===== move-mouse-cursor-to!
379<procedure>(move-mouse-cursor-to! #!optional x y element)</procedure>
380
381
382===== click-mouse-button!
383<procedure>(click-mouse-button! #!optional button)</procedure>
384
385
386===== mouse-button-down!
387<procedure>(mouse-button-down!)</procedure>
388
389
390===== mouse-button-up!
391<procedure>(mouse-button-up!)</procedure>
392
393
394===== double-click-mouse-button!
395<procedure>(double-click-mouse-button!)</procedure>
396
397
398==== Firefox webdriver
399
400===== with-firefox-webdriver
401<procedure>(with-firefox-webdriver profile-dir thunk #!key (scheme 'http) (host "127.0.0.1") (port 7055) (path "/hub") (command "firefox") (capabilities '((browserName . "firefox") (javascriptEnabled . #t) (platform . "ANY"))))</procedure>
402
403
404
405==== "Remote" webdriver
406
407===== with-remote-webdriver
408<procedure>(with-remote-webdriver jar-file thunk #!key (scheme 'http) (host "127.0.0.1") (port 4444) (path "/wd/hub") (command "java -jar") (capabilities '()))</procedure>
409
410
411
412=== License
413
414BSD
415
416
417=== Version history
418
419==== Version 0.6
420
421Category changed from {{web}} to {{testing}}
422
423
424==== Version 0.5
425
426Meta file fix (added {{category}} section)
427
428
429==== Version v0.4
430
431Fixed versions in release-info file
432
433
434==== Version 0.3
435
436Minor fixes: fixed version declaration in {{.setup}}.  Unexported
437{{desired-capabilities}}, {{command-executor-host}},
438{{command-executor-port}} and {{command-executor-path}}.
439
440
441==== Version 0.2
442
443Added release-info file
444
445
446==== Version 0.1
447
448Initial release
Note: See TracBrowser for help on using the repository browser.