-
Notifications
You must be signed in to change notification settings - Fork 4
/
179.txt
337 lines (252 loc) · 12.2 KB
/
179.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
* 仕様書
[REFS[
- [30] [CITE@en[WebDriver]] ([TIME[2016-04-26 08:11:40 +09:00]] 版) <https://w3c.github.io/webdriver/webdriver-spec.html>
]REFS]
* WebDriver の実装
[35] [[サーバー]]側:
[FIG(short list)[
- [[Selenium]]
- [[ChromeDriver]]
- [[Marionette]]
]FIG]
[36] [[クライアント]]は、世間では [[Selenium]] と[[言語]]依存の専用の[[クライアントライブラリー]]を使うことが多いですが、
[[WebDriver]] は単なる [[Web API]] なので、普通の [[HTTP]]
用[[ライブラリー]]があれば利用できます。
;; [37] しかし定型処理がわずらわしくなりますから、素の [[HTTP]] のまま操作するよりは、
ある程度[[抽象化]]された[[クライアントライブラリー]]は欲しいですね。
* 非互換性
[38] 色々な [[WebDriver]] の実装は、似て非なる[[プロトコル]]を使っています。
[39] [[Selenium]] のサーバーでは[[パス]]の先頭に [CODE[/wd/hub]] が付きます。
[[ChromeDriver]] や [[GeckoDriver]] では[[パス]]全体が [[WebDriver]]
仕様のものと解釈されます。
[40] [[WebDriver]] 仕様上は [[HTTP状態符号]]で正常かエラーかを表しますが、
[[ChromeDriver]] は基本的に [CODE[200]] を使います。
[[応答本体]]の [[JSON]] の [CODE[status]] が [N[0]] なら成功、
それ以外なら何らかのエラーです。
[CODE[value]] が [[JSONオブジェクト]]となり、その [CODE[message]]
に[[人間]]向けのエラーメッセージが入ります。
[TIME[2016-08-12T11:10:35.000Z]]
[41] [[WebDriver]] 仕様上の [[New Session]] では、[[要求本体]]の [[JSONオブジェクト]]の [CODE[capabilities]]
[[JSONオブジェクト]]に [CODE[requiredCapabilities]] と
[CODE[desiredCapabilities]] を指定することになっています。
[[ChromeDriver]] では[[要求本体]]の [[JSONオブジェクト]]に
[CODE[requiredCapabilities]] と [CODE[desiredCapabilities]]
を指定することになっています。 [CODE[desiredCapabilities]] は必須です。
[TIME[2016-08-12T11:25:25.600Z]]
[43] [[WebDriver]] 仕様では[[スクリプト]]の実行は [CODE[/session/{session_id}/execute/sync]]
となっていますが、 [[ChromeDriver]] では [CODE[/session/{session_id}/execute]] です。
[42] [[ChromeDriver]] では [CODE[/status]] を [CODE[GET]] すると[[ビルド環境]]の情報が得られます。
* 用途
[FIG(list)[ [70] [[WebDriver]] を使った [[Webブラウザー]]操作の利用例
- [71] [[Webアプリケーション]]の[[テスト]]
- [75] [[Webブラウザー]]の[[テスト]]
- [72] [[スクレイピング]]
- [76] [[Webアプリケーション]]の定型操作
- [73] [[Webページ]]の[[スクリーンショット]]撮影
- [74] [[画像処理]]や [[3D]] や[[音声]]の汎用処理ツールとしての [[Webブラウザー]]の流用
]FIG]
* 歴史
[1] [CITE[JsonWireProtocol - selenium - A description of the protocol used by WebDriver to communicate with remote instances - Browser automation framework - Google Project Hosting]]
( ([TIME[2011-12-10 10:05:47 +09:00]] 版))
<http://code.google.com/p/selenium/wiki/JsonWireProtocol>
[33] [CITE[JsonWireProtocol - selenium - A description of the protocol used by WebDriver to communicate with remote instances - Browser automation framework - Google Project Hosting]] ([TIME[2016-08-07 23:39:48 +09:00]]) <https://web.archive.org/web/20160205035909/https://code.google.com/p/selenium/wiki/JsonWireProtocol>
[2] [CITE@en[WebDriver]]
( ([TIME[2012-07-09 22:55:39 +09:00]] 版))
<http://www.w3.org/TR/2012/WD-webdriver-20120710/>
[3] [CITE@en[WebDriver]]
( ([TIME[2013-01-16 16:15:31 +09:00]] 版))
<http://www.w3.org/TR/2013/WD-webdriver-20130117/>
[4] [CITE@en[WebDriver]]
( ([TIME[2013-03-07 22:44:44 +09:00]] 版))
<http://www.w3.org/TR/2013/WD-webdriver-20130312/>
[5] [CITE[JsonWireProtocol - selenium - A description of the protocol used by WebDriver to communicate with remote instances - Browser automation framework - Google Project Hosting]]
( ([TIME[2013-10-22 02:13:24 +09:00]] 版))
<https://code.google.com/p/selenium/wiki/JsonWireProtocol>
[6] [CITE[JsonWireProtocol - selenium - A description of the protocol used by WebDriver to communicate with remote instances - Browser automation framework - Google Project Hosting]]
( ([TIME[2014-10-30 06:27:12 +09:00]] 版))
<https://code.google.com/p/selenium/wiki/JsonWireProtocol#Capabilities_JSON_Object>
[7] [CITE@en[WebDriver]]
( ([TIME[2014-11-07 11:04:46 +09:00]] 版))
<https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html>
[8] [CITE[Selenium WebDriver — Selenium Documentation]]
( ([TIME[2015-01-13 13:08:11 +09:00]] 版))
<http://docs.seleniumhq.org/docs/03_webdriver.jsp>
[9] [CITE@en[The Architecture of Open Source Applications: Selenium WebDriver]]
( ([TIME[2013-02-05 12:26:15 +09:00]] 版))
<http://www.aosabook.org/en/selenium.html>
[10] [CITE@en[WebDriver]]
([TIME[2015-08-03 16:17:27 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150803/>
[11] [CITE@en[WebDriver]]
([TIME[2015-08-04 08:21:14 +09:00]] 版)
<https://w3c.github.io/webdriver/webdriver-spec.html>
[12] [CITE@en[WebDriver]]
([TIME[2015-08-04 09:40:50 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150804/>
[13] [CITE@en[WebDriver]]
([TIME[2015-08-05 09:53:35 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150805/>
[14] [CITE@en[WebDriver]]
([TIME[2015-08-08 18:42:00 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150808/>
[15] [CITE[WebDriver now a living standard]]
([TIME[2015-08-05 00:12:26 +09:00]] 版)
<https://sny.no/2015/08/living>
[16] [CITE@en[WebDriver]]
([TIME[2015-08-28 06:56:57 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150827/>
[17] [CITE@en[WebDriver]]
([TIME[2015-09-02 19:16:24 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150902/>
[18] [CITE@en[WebDriver]]
([TIME[2015-09-09 21:28:34 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150909/>
[19] [CITE@en[WebDriver]]
([TIME[2015-09-15 23:41:36 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150915/>
[20] [CITE@en[WebDriver]]
([TIME[2015-09-18 19:01:06 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150918/>
[21] [CITE@en[WebDriver]]
([TIME[2015-09-21 19:57:39 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20150921/>
[22] [CITE@en[WebDriver]]
([TIME[2015-10-26 09:00:16 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20151025/>
[23] [CITE@en[WebDriver]]
([TIME[2015-10-28 14:55:19 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20151028/>
[24] [CITE@en[WebDriver]]
([TIME[2015-10-29 10:40:59 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20151029/>
[FIG(quote)[
[FIGCAPTION[
[25] [CITE@ja[Microsoft Edge 用 WebDriver (Windows)]]
([TIME[2015-11-07 22:14:26 +09:00]] 版)
<https://msdn.microsoft.com/ja-jp/library/mt188085(v=vs.85).aspx>
]FIGCAPTION]
> Microsoft Edge の WebDriver 実装では既存のテストとの下位互換のために、W3C WebDriver 実装と JSON Wire Protocol の両方をサポートします。
]FIG]
[26] [CITE@en-US[Bringing automated testing to Microsoft Edge through WebDriver | Microsoft Edge Dev Blog]]
([TIME[2015-11-07 22:11:03 +09:00]] 版)
<https://blogs.windows.com/msedgedev/2015/07/23/bringing-automated-testing-to-microsoft-edge-through-webdriver/>
[27] [CITE@en-US[Developer Resources : Microsoft Edge Dev]]
([TIME[2015-11-07 22:15:51 +09:00]] 版)
<https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/>
[28] [CITE@en[WebDriver]]
([TIME[2015-11-09 21:41:50 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-webdriver-20151109/>
[29] [CITE@en[WebDriver]]
([TIME[2016-01-20 09:39:43 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-webdriver-20160120/>
[31] [CITE@en[WebDriver]]
([TIME[2016-04-27 01:21:39 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-webdriver-20160426/>
[32] [CITE@en[WebDriver]]
( ([TIME[2016-05-23 21:42:38 +09:00]]))
<https://www.w3.org/TR/2016/WD-webdriver-20160523/>
[34] [CITE@en-US[WebDriver Status - Mozilla | MDN]]
( ([TIME[2016-08-04 17:24:28 +09:00]]))
<https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status>
[44] [CITE@en[WebDriver]]
([TIME[2016-08-30 23:27:25 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20160830/>
[45] [CITE[WebDriver Support in Safari 10 | WebKit]]
([TIME[2016-09-06 00:16:18 +09:00]])
<https://webkit.org/blog/6900/webdriver-support-in-safari-10/>
[46] [CITE@en[WebDriver]]
([TIME[2016-10-13 22:37:03 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161013/>
[47] [CITE@en[WebDriver]]
([TIME[2016-10-20 06:00:23 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161019/>
[48] [CITE@en[WebDriver]]
([TIME[2016-10-22 08:51:18 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161021/>
[49] [CITE@en[WebDriver]]
([TIME[2016-10-26 00:27:09 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161025/>
[50] [CITE@en[WebDriver]]
([TIME[2016-11-01 06:48:14 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161031/>
[51] [CITE@en[WebDriver]]
([TIME[2016-11-15 19:44:51 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161115/>
[52] [CITE@en[WebDriver]]
([TIME[2016-11-16 23:46:53 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161116/>
[53] [CITE@en[WebDriver]]
([TIME[2016-11-30 05:42:32 +09:00]])
<https://www.w3.org/TR/2016/WD-webdriver-20161129/>
[54] [CITE@en[WebDriver]]
([TIME[2017-01-05 23:45:24 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170105/>
[55] [CITE@en[WebDriver]]
([TIME[2017-01-11 00:28:23 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170110/>
[56] [CITE@en[WebDriver]]
([TIME[2017-01-12 01:39:38 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170111/>
[57] [CITE@en[WebDriver]]
([TIME[2017-01-12 23:39:44 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170112/>
[58] [CITE@en[WebDriver]]
([TIME[2017-01-13 19:37:18 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170113/>
[59] [CITE@en[WebDriver]]
([TIME[2017-01-17 05:10:11 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170116/>
[60] [CITE@en[WebDriver]]
([TIME[2017-01-18 07:58:54 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170117/>
[61] [CITE@en[WebDriver]]
([TIME[2017-01-19 05:54:35 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170118/>
[62] [CITE@en[WebDriver]]
([TIME[2017-01-20 07:35:46 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170119/>
[63] [CITE@en[WebDriver]]
([TIME[2017-01-21 07:23:59 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170120/>
[64] [CITE@en[WebDriver]]
([TIME[2017-01-21 20:01:26 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170121/>
[65] [CITE@en[WebDriver]]
([TIME[2017-01-24 00:52:41 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170123/>
[66] [CITE@en[WebDriver]]
([TIME[2017-01-25 03:16:26 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170124/>
[67] [CITE@en[WebDriver]]
([TIME[2017-01-25 22:19:39 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170125/>
[68] [CITE@en[WebDriver]]
([TIME[2017-01-26 18:17:50 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170126/>
[69] [CITE@en[WebDriver]]
([TIME[2017-01-28 02:57:57 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170127/>
[77] [CITE@en[WebDriver]]
([TIME[2017-02-01 06:34:38 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170131/>
[78] [CITE@en[WebDriver]]
([TIME[2017-02-01 21:39:55 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170201/>
[79] [CITE@en[WebDriver]]
([TIME[2017-02-03 02:38:22 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170202/>
[80] [CITE@en[WebDriver]]
([TIME[2017-02-04 07:17:53 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170203/>
[81] [CITE@en[WebDriver]]
([TIME[2017-02-07 05:59:53 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170206/>
[82] [CITE@en[WebDriver]]
([TIME[2017-02-07 22:27:06 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170207/>
[83] [CITE@en[WebDriver]]
([TIME[2017-02-10 07:23:29 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170209/>
[84] [CITE@en[WebDriver]]
([TIME[2017-02-11 01:03:00 +09:00]])
<https://www.w3.org/TR/2017/WD-webdriver-20170210/>