selenium-webdriver 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/chrome/src/extension/background.js +19 -14
- data/chrome/src/extension/manifest-nonwin.json +1 -2
- data/chrome/src/extension/manifest-win.json +1 -2
- data/chrome/src/rb/lib/selenium/webdriver/chrome/bridge.rb +5 -1
- data/common/src/js/abstractcommandprocessor.js +0 -33
- data/common/src/js/asserts.js +2 -2
- data/common/src/js/by.js +2 -0
- data/common/src/js/command.js +130 -36
- data/common/src/js/future.js +42 -23
- data/common/src/js/localcommandprocessor.js +0 -1
- data/common/src/js/testrunner.js +9 -16
- data/common/src/js/webdriver.js +225 -254
- data/common/src/js/webelement.js +76 -197
- data/common/src/rb/lib/selenium/webdriver/driver.rb +4 -0
- data/common/src/rb/lib/selenium/webdriver/element.rb +4 -0
- data/firefox/src/extension/components/badCertListener.js +186 -0
- data/firefox/src/extension/components/firefoxDriver.js +7 -16
- data/firefox/src/extension/components/nsCommandProcessor.js +10 -9
- data/firefox/src/extension/components/utils.js +5 -5
- data/firefox/src/extension/components/webdriverserver.js +5 -0
- data/firefox/src/extension/components/wrappedElement.js +10 -6
- data/firefox/src/rb/lib/selenium/webdriver/firefox/bridge.rb +11 -12
- data/firefox/src/rb/lib/selenium/webdriver/firefox/extension_connection.rb +2 -2
- data/firefox/src/rb/lib/selenium/webdriver/firefox/profile.rb +2 -1
- metadata +3 -4
- data/chrome/src/extension/toolstrip.html +0 -28
- data/common/src/js/wait.js +0 -199
data/common/src/js/webelement.js
CHANGED
@@ -23,8 +23,6 @@ limitations under the License.
|
|
23
23
|
goog.provide('webdriver.WebElement');
|
24
24
|
|
25
25
|
goog.require('goog.array');
|
26
|
-
goog.require('goog.math.Coordinate');
|
27
|
-
goog.require('goog.math.Size');
|
28
26
|
goog.require('webdriver.By.Locator');
|
29
27
|
goog.require('webdriver.By.Strategy');
|
30
28
|
goog.require('webdriver.Command');
|
@@ -90,12 +88,9 @@ webdriver.WebElement.UUID_REGEX =
|
|
90
88
|
webdriver.WebElement.findElement = function(driver, locator) {
|
91
89
|
var webElement = new webdriver.WebElement(driver);
|
92
90
|
locator = webdriver.By.Locator.checkLocator(locator);
|
93
|
-
var command =
|
94
|
-
setParameters(locator.type, locator.target)
|
95
|
-
|
96
|
-
webElement.getId().setValue(response.value);
|
97
|
-
});
|
98
|
-
driver.addCommand(command);
|
91
|
+
var command = driver.addCommand(webdriver.CommandName.FIND_ELEMENT).
|
92
|
+
setParameters(locator.type, locator.target);
|
93
|
+
webElement.getId().setValue(command.getFutureResult());
|
99
94
|
return webElement;
|
100
95
|
};
|
101
96
|
|
@@ -113,20 +108,18 @@ webdriver.WebElement.findElement = function(driver, locator) {
|
|
113
108
|
* @see webdriver.By.Locator.createFromObj
|
114
109
|
*/
|
115
110
|
webdriver.WebElement.isElementPresent = function(driver, locator) {
|
116
|
-
var isPresent = new webdriver.Future(driver);
|
117
111
|
var callback = function(response) {
|
118
112
|
// If returns without an error, element is present.
|
119
|
-
|
113
|
+
response.value = !response.isFailure;
|
120
114
|
// Go ahead and clear the error.
|
121
115
|
response.isFailure = false;
|
122
116
|
};
|
123
117
|
locator = webdriver.By.Locator.checkLocator(locator);
|
124
|
-
|
118
|
+
return driver.addCommand(webdriver.CommandName.FIND_ELEMENT).
|
125
119
|
setParameters(locator.type, locator.target).
|
126
120
|
setSuccessCallback(callback).
|
127
|
-
setFailureCallback(callback)
|
128
|
-
|
129
|
-
return isPresent;
|
121
|
+
setFailureCallback(callback).
|
122
|
+
getFutureResult();
|
130
123
|
};
|
131
124
|
|
132
125
|
|
@@ -141,12 +134,11 @@ webdriver.WebElement.isElementPresent = function(driver, locator) {
|
|
141
134
|
*/
|
142
135
|
webdriver.WebElement.findElements = function(driver, locator) {
|
143
136
|
locator = webdriver.By.Locator.checkLocator(locator);
|
144
|
-
|
137
|
+
driver.addCommand(webdriver.CommandName.FIND_ELEMENTS).
|
145
138
|
setParameters(locator.type, locator.target).
|
146
139
|
setSuccessCallback(function(response) {
|
147
|
-
var ids = response.value.split(',');
|
148
140
|
var elements = [];
|
149
|
-
for (var i = 0, id; id =
|
141
|
+
for (var i = 0, id; id = response.value[i]; i++) {
|
150
142
|
if (id) {
|
151
143
|
var element = new webdriver.WebElement(driver);
|
152
144
|
element.getId().setValue(id);
|
@@ -155,7 +147,6 @@ webdriver.WebElement.findElements = function(driver, locator) {
|
|
155
147
|
}
|
156
148
|
response.value = elements;
|
157
149
|
});
|
158
|
-
driver.addCommand(command);
|
159
150
|
};
|
160
151
|
|
161
152
|
|
@@ -171,24 +162,22 @@ webdriver.WebElement.findElements = function(driver, locator) {
|
|
171
162
|
* @see webdriver.By.Locator.createFromObj
|
172
163
|
*/
|
173
164
|
webdriver.WebElement.prototype.isElementPresent = function(locator) {
|
174
|
-
var isPresent = new webdriver.Future(this.driver_);
|
175
165
|
var callback = function(response) {
|
176
166
|
// If returns without an error, element is present.
|
177
|
-
|
167
|
+
response.value = !response.isFailure;
|
178
168
|
// Go ahead and clear the error (if any).
|
179
169
|
response.isFailure = false;
|
180
170
|
};
|
181
171
|
locator = webdriver.By.Locator.checkLocator(locator);
|
182
|
-
|
172
|
+
return this.driver_.addCommand(webdriver.CommandName.FIND_CHILD_ELEMENT).
|
183
173
|
setParameters({
|
184
174
|
'id': this.getId(),
|
185
175
|
'using': locator.type,
|
186
176
|
'value': locator.target
|
187
177
|
}).
|
188
178
|
setSuccessCallback(callback).
|
189
|
-
setFailureCallback(callback)
|
190
|
-
|
191
|
-
return isPresent;
|
179
|
+
setFailureCallback(callback).
|
180
|
+
getFutureResult();
|
192
181
|
};
|
193
182
|
|
194
183
|
|
@@ -206,16 +195,14 @@ webdriver.WebElement.prototype.isElementPresent = function(locator) {
|
|
206
195
|
webdriver.WebElement.prototype.findElement = function(locator) {
|
207
196
|
var webElement = new webdriver.WebElement(this.driver_);
|
208
197
|
locator = webdriver.By.Locator.checkLocator(locator);
|
209
|
-
var command =
|
198
|
+
var command = this.driver_.
|
199
|
+
addCommand(webdriver.CommandName.FIND_CHILD_ELEMENT).
|
210
200
|
setParameters({
|
211
201
|
'id': this.getId(),
|
212
202
|
'using': locator.type,
|
213
203
|
'value': locator.target
|
214
|
-
}).
|
215
|
-
setSuccessCallback(function(response) {
|
216
|
-
webElement.getId().setValue(response.value);
|
217
204
|
});
|
218
|
-
|
205
|
+
webElement.getId().setValue(command.getFutureResult());
|
219
206
|
return webElement;
|
220
207
|
};
|
221
208
|
|
@@ -230,26 +217,23 @@ webdriver.WebElement.prototype.findElement = function(locator) {
|
|
230
217
|
*/
|
231
218
|
webdriver.WebElement.prototype.findElements = function(locator) {
|
232
219
|
locator = webdriver.By.Locator.checkLocator(locator);
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
response.value = elements;
|
251
|
-
}, this);
|
252
|
-
this.driver_.addCommand(command);
|
220
|
+
this.driver_.addCommand(webdriver.CommandName.FIND_CHILD_ELEMENTS).
|
221
|
+
setParameters({
|
222
|
+
'id': this.getId(),
|
223
|
+
'using': locator.type,
|
224
|
+
'value': locator.target
|
225
|
+
}).
|
226
|
+
setSuccessCallback(function(response) {
|
227
|
+
var elements = [];
|
228
|
+
for (var i = 0, id; id = response.value[i]; i++) {
|
229
|
+
if (id) {
|
230
|
+
var element = new webdriver.WebElement(this.driver_);
|
231
|
+
element.getId().setValue(id);
|
232
|
+
elements.push(element);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
response.value = elements;
|
236
|
+
}, this);
|
253
237
|
};
|
254
238
|
|
255
239
|
|
@@ -278,7 +262,7 @@ webdriver.WebElement.prototype.getId = function() {
|
|
278
262
|
* @private
|
279
263
|
*/
|
280
264
|
webdriver.WebElement.prototype.createCommand_ = function(name) {
|
281
|
-
return
|
265
|
+
return this.driver_.addCommand(name, this);
|
282
266
|
};
|
283
267
|
|
284
268
|
|
@@ -286,8 +270,7 @@ webdriver.WebElement.prototype.createCommand_ = function(name) {
|
|
286
270
|
* Adds a command to click on this element.
|
287
271
|
*/
|
288
272
|
webdriver.WebElement.prototype.click = function() {
|
289
|
-
|
290
|
-
this.driver_.addCommand(command);
|
273
|
+
this.createCommand_(webdriver.CommandName.CLICK);
|
291
274
|
};
|
292
275
|
|
293
276
|
|
@@ -343,18 +326,14 @@ webdriver.WebElement.prototype.click = function() {
|
|
343
326
|
webdriver.WebElement.prototype.sendKeys = function(var_args) {
|
344
327
|
var command = this.createCommand_(webdriver.CommandName.SEND_KEYS);
|
345
328
|
command.setParameters.apply(command, arguments);
|
346
|
-
this.driver_.addCommand(command);
|
347
329
|
};
|
348
330
|
|
349
331
|
/**
|
350
332
|
* Queries for the tag/node name of this element.
|
351
333
|
*/
|
352
334
|
webdriver.WebElement.prototype.getTagName = function() {
|
353
|
-
|
354
|
-
|
355
|
-
setSuccessCallback(name.setValueFromResponse, name);
|
356
|
-
this.driver_.addCommand(command);
|
357
|
-
return name;
|
335
|
+
return this.createCommand_(webdriver.CommandName.GET_TAG_NAME).
|
336
|
+
getFutureResult();
|
358
337
|
};
|
359
338
|
|
360
339
|
|
@@ -371,12 +350,9 @@ webdriver.WebElement.prototype.getTagName = function() {
|
|
371
350
|
* Future.
|
372
351
|
*/
|
373
352
|
webdriver.WebElement.prototype.getComputedStyle = function(cssStyleProperty) {
|
374
|
-
|
375
|
-
var command = this.createCommand_(webdriver.CommandName.GET_VALUE_OF_CSS_PROPERTY).
|
353
|
+
return this.createCommand_(webdriver.CommandName.GET_VALUE_OF_CSS_PROPERTY).
|
376
354
|
setParameters(cssStyleProperty).
|
377
|
-
|
378
|
-
this.driver_.addCommand(command);
|
379
|
-
return value;
|
355
|
+
getFutureResult();
|
380
356
|
};
|
381
357
|
|
382
358
|
|
@@ -385,22 +361,9 @@ webdriver.WebElement.prototype.getComputedStyle = function(cssStyleProperty) {
|
|
385
361
|
* @param {string} attributeName The name of the attribute to query.
|
386
362
|
*/
|
387
363
|
webdriver.WebElement.prototype.getAttribute = function(attributeName) {
|
388
|
-
|
389
|
-
var command = this.createCommand_(webdriver.CommandName.GET_ATTRIBUTE).
|
364
|
+
return this.createCommand_(webdriver.CommandName.GET_ATTRIBUTE).
|
390
365
|
setParameters(attributeName).
|
391
|
-
|
392
|
-
// If there is an error b/c the attribute was not found, set value to null
|
393
|
-
setFailureCallback(function(response) {
|
394
|
-
// TODO(jmleyba): This error message needs to be consistent for all
|
395
|
-
// drivers.
|
396
|
-
if (response.value == 'No match') {
|
397
|
-
response.isFailure = false;
|
398
|
-
response.value = null;
|
399
|
-
value.setValue(null);
|
400
|
-
}
|
401
|
-
});
|
402
|
-
this.driver_.addCommand(command);
|
403
|
-
return value;
|
366
|
+
getFutureResult();
|
404
367
|
};
|
405
368
|
|
406
369
|
|
@@ -409,11 +372,8 @@ webdriver.WebElement.prototype.getAttribute = function(attributeName) {
|
|
409
372
|
* this instance.
|
410
373
|
*/
|
411
374
|
webdriver.WebElement.prototype.getValue = function() {
|
412
|
-
|
413
|
-
|
414
|
-
setSuccessCallback(value.setValueFromResponse, value);
|
415
|
-
this.driver_.addCommand(command);
|
416
|
-
return value;
|
375
|
+
return this.createCommand_(webdriver.CommandName.GET_VALUE).
|
376
|
+
getFutureResult();
|
417
377
|
};
|
418
378
|
|
419
379
|
|
@@ -422,11 +382,8 @@ webdriver.WebElement.prototype.getValue = function() {
|
|
422
382
|
* or trailing whitespace.
|
423
383
|
*/
|
424
384
|
webdriver.WebElement.prototype.getText = function() {
|
425
|
-
|
426
|
-
|
427
|
-
setSuccessCallback(text.setValueFromResponse, text);
|
428
|
-
this.driver_.addCommand(command);
|
429
|
-
return text;
|
385
|
+
return this.createCommand_(webdriver.CommandName.GET_TEXT).
|
386
|
+
getFutureResult();
|
430
387
|
};
|
431
388
|
|
432
389
|
|
@@ -434,8 +391,7 @@ webdriver.WebElement.prototype.getText = function() {
|
|
434
391
|
* Selects this element.
|
435
392
|
*/
|
436
393
|
webdriver.WebElement.prototype.setSelected = function() {
|
437
|
-
|
438
|
-
this.driver_.addCommand(command);
|
394
|
+
this.createCommand_(webdriver.CommandName.SET_SELECTED);
|
439
395
|
};
|
440
396
|
|
441
397
|
|
@@ -443,31 +399,8 @@ webdriver.WebElement.prototype.setSelected = function() {
|
|
443
399
|
* @return {webdriver.Future} The size of this element.
|
444
400
|
*/
|
445
401
|
webdriver.WebElement.prototype.getSize = function() {
|
446
|
-
|
447
|
-
|
448
|
-
setSuccessCallback(function(response) {
|
449
|
-
var wh = response.value.replace(/\s/g, '').split(',');
|
450
|
-
response.value = new goog.math.Size(wh[0], wh[1]);
|
451
|
-
size.setValue(response.value);
|
452
|
-
});
|
453
|
-
this.driver_.addCommand(command);
|
454
|
-
return size;
|
455
|
-
};
|
456
|
-
|
457
|
-
|
458
|
-
/**
|
459
|
-
* Parses a response of the form "$x $y" into a {@code goog.math.Coordinate}
|
460
|
-
* object.
|
461
|
-
* @param {webdriver.Future} future The Future to store the parsed result in.
|
462
|
-
* @param {webdriver.Response} response The response to parse.
|
463
|
-
* @private
|
464
|
-
*/
|
465
|
-
webdriver.WebElement.createCoordinatesFromResponse_ = function(future,
|
466
|
-
response) {
|
467
|
-
var xy = response.value.replace(/\s/g, '').split(',');
|
468
|
-
response.value = new goog.math.Coordinate(
|
469
|
-
Number(xy[0]), Number(xy[1]));
|
470
|
-
future.setValue(response.value);
|
402
|
+
return this.createCommand_(webdriver.CommandName.GET_SIZE).
|
403
|
+
getFutureResult();
|
471
404
|
};
|
472
405
|
|
473
406
|
|
@@ -475,32 +408,8 @@ webdriver.WebElement.createCoordinatesFromResponse_ = function(future,
|
|
475
408
|
* @return {webdriver.Future} The location of this element.
|
476
409
|
*/
|
477
410
|
webdriver.WebElement.prototype.getLocation = function() {
|
478
|
-
|
479
|
-
|
480
|
-
setSuccessCallback(
|
481
|
-
goog.bind(webdriver.WebElement.createCoordinatesFromResponse_, null,
|
482
|
-
currentLocation));
|
483
|
-
this.driver_.addCommand(command);
|
484
|
-
return currentLocation;
|
485
|
-
};
|
486
|
-
|
487
|
-
|
488
|
-
/**
|
489
|
-
* @param {webdriver.Future} newLocation Future to store the new location in
|
490
|
-
* when the command is complete.
|
491
|
-
* @param {number} x Horizontal distance to drag this element.
|
492
|
-
* @param {number} y Vertical distanct to drag this element.
|
493
|
-
* @param opt_addToFront
|
494
|
-
* @private
|
495
|
-
*/
|
496
|
-
webdriver.WebElement.prototype.addDragAndDropCommand_ = function(
|
497
|
-
newLocation, x, y, opt_addToFront) {
|
498
|
-
var command = this.createCommand_(webdriver.CommandName.DRAG_ELEMENT).
|
499
|
-
setParameters(x, y).
|
500
|
-
setSuccessCallback(
|
501
|
-
goog.bind(webdriver.WebElement.createCoordinatesFromResponse_, null,
|
502
|
-
newLocation));
|
503
|
-
this.driver_.addCommand(command, opt_addToFront);
|
411
|
+
return this.createCommand_(webdriver.CommandName.GET_LOCATION).
|
412
|
+
getFutureResult();
|
504
413
|
};
|
505
414
|
|
506
415
|
|
@@ -511,9 +420,9 @@ webdriver.WebElement.prototype.addDragAndDropCommand_ = function(
|
|
511
420
|
* @return {webdriver.Future} The new location of the element.
|
512
421
|
*/
|
513
422
|
webdriver.WebElement.prototype.dragAndDropBy = function(x, y) {
|
514
|
-
|
515
|
-
|
516
|
-
|
423
|
+
return this.createCommand_(webdriver.CommandName.DRAG_ELEMENT).
|
424
|
+
setParameters(x, y).
|
425
|
+
getFutureResult();
|
517
426
|
};
|
518
427
|
|
519
428
|
|
@@ -532,13 +441,11 @@ webdriver.WebElement.prototype.dragAndDropTo = function(webElement) {
|
|
532
441
|
|
533
442
|
var toLocation = webElement.getLocation();
|
534
443
|
var thisLocation = this.getLocation();
|
535
|
-
|
536
|
-
this.driver_.callFunction(goog.bind(function() {
|
444
|
+
return this.driver_.callFunction(function() {
|
537
445
|
var delta = goog.math.Coordinate.difference(
|
538
446
|
toLocation.getValue(), thisLocation.getValue());
|
539
|
-
this.
|
540
|
-
}, this)
|
541
|
-
return newLocation;
|
447
|
+
return this.dragAndDropBy(delta.x, delta.y);
|
448
|
+
}, this);
|
542
449
|
};
|
543
450
|
|
544
451
|
|
@@ -547,15 +454,12 @@ webdriver.WebElement.prototype.dragAndDropTo = function(webElement) {
|
|
547
454
|
* enabled, as dictated by the {@code disabled} attribute.
|
548
455
|
*/
|
549
456
|
webdriver.WebElement.prototype.isEnabled = function() {
|
550
|
-
|
551
|
-
var command = this.createCommand_(webdriver.CommandName.GET_ATTRIBUTE).
|
457
|
+
return this.createCommand_(webdriver.CommandName.GET_ATTRIBUTE).
|
552
458
|
setParameters('disabled').
|
553
459
|
setSuccessCallback(function(response) {
|
554
460
|
response.value = !!!response.value;
|
555
|
-
|
556
|
-
|
557
|
-
this.driver_.addCommand(command);
|
558
|
-
return futureValue;
|
461
|
+
}).
|
462
|
+
getFutureResult();
|
559
463
|
};
|
560
464
|
|
561
465
|
|
@@ -563,27 +467,17 @@ webdriver.WebElement.prototype.isEnabled = function() {
|
|
563
467
|
* Determines if this element is checked or selected; will generate an error if
|
564
468
|
* the DOM element represented by this instance is not an OPTION or checkbox
|
565
469
|
* INPUT element.
|
566
|
-
* @return {webdriver.Future} Whether this
|
567
|
-
* selected.
|
470
|
+
* @return {webdriver.Future} Whether this element is checked or selected.
|
568
471
|
* @private
|
569
472
|
*/
|
570
|
-
webdriver.WebElement.prototype.isCheckedOrSelected_ = function(
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
setParameters(attribute).
|
579
|
-
setSuccessCallback(function(response) {
|
580
|
-
response.value = !!response.value;
|
581
|
-
value.setValue(response.value);
|
582
|
-
});
|
583
|
-
this.driver_.addCommand(getAttrCommand, true);
|
584
|
-
}, this);
|
585
|
-
this.driver_.addCommand(command, opt_addToFront);
|
586
|
-
return value;
|
473
|
+
webdriver.WebElement.prototype.isCheckedOrSelected_ = function() {
|
474
|
+
return this.driver_.callFunction(function() {
|
475
|
+
this.createCommand_(webdriver.CommandName.GET_TAG_NAME);
|
476
|
+
return this.driver_.callFunction(function(response) {
|
477
|
+
var attribute = response.value == 'input' ? 'checked' : 'selected';
|
478
|
+
return this.getAttribute(attribute);
|
479
|
+
}, this);
|
480
|
+
}, this);
|
587
481
|
};
|
588
482
|
|
589
483
|
|
@@ -610,13 +504,10 @@ webdriver.WebElement.prototype.isChecked = function() {
|
|
610
504
|
* @return {webdriver.Future} The new checked/selected state of this element.
|
611
505
|
*/
|
612
506
|
webdriver.WebElement.prototype.toggle = function() {
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
}, this);
|
618
|
-
this.driver_.addCommand(command);
|
619
|
-
return toggleResult;
|
507
|
+
return this.driver_.callFunction(function() {
|
508
|
+
this.createCommand_(webdriver.CommandName.TOGGLE);
|
509
|
+
return this.driver_.callFunction(this.isCheckedOrSelected_, this);
|
510
|
+
}, this);
|
620
511
|
};
|
621
512
|
|
622
513
|
|
@@ -625,8 +516,7 @@ webdriver.WebElement.prototype.toggle = function() {
|
|
625
516
|
* will that form.
|
626
517
|
*/
|
627
518
|
webdriver.WebElement.prototype.submit = function() {
|
628
|
-
this.
|
629
|
-
this.createCommand_(webdriver.CommandName.SUBMIT));
|
519
|
+
this.createCommand_(webdriver.CommandName.SUBMIT);
|
630
520
|
};
|
631
521
|
|
632
522
|
|
@@ -635,8 +525,7 @@ webdriver.WebElement.prototype.submit = function() {
|
|
635
525
|
* will clear its {@code value}.
|
636
526
|
*/
|
637
527
|
webdriver.WebElement.prototype.clear = function() {
|
638
|
-
this.
|
639
|
-
this.createCommand_(webdriver.CommandName.CLEAR));
|
528
|
+
this.createCommand_(webdriver.CommandName.CLEAR);
|
640
529
|
};
|
641
530
|
|
642
531
|
|
@@ -644,18 +533,8 @@ webdriver.WebElement.prototype.clear = function() {
|
|
644
533
|
* @return {webdriver.Future} Whether this element is currently displayed.
|
645
534
|
*/
|
646
535
|
webdriver.WebElement.prototype.isDisplayed = function() {
|
647
|
-
|
648
|
-
|
649
|
-
setSuccessCallback(function(response) {
|
650
|
-
// TODO(jmleyba): FF extension should not be returning a string here...
|
651
|
-
if (goog.isString(response.value)) {
|
652
|
-
futureValue.setValue(response.value == 'true');
|
653
|
-
} else {
|
654
|
-
futureValue.setValue(response.value);
|
655
|
-
}
|
656
|
-
});
|
657
|
-
this.driver_.addCommand(command);
|
658
|
-
return futureValue;
|
536
|
+
return this.createCommand_(webdriver.CommandName.IS_DISPLAYED).
|
537
|
+
getFutureResult();
|
659
538
|
};
|
660
539
|
|
661
540
|
|