@@ -317,6 +317,9 @@ interface Timeouts {
317
317
* <p>
318
318
* Increasing the implicit wait timeout should be used judiciously as it will have an adverse
319
319
* effect on test run time, especially when used with slower location strategies like XPath.
320
+ * <p>
321
+ * If the timeout is negative, not null, or greater than 2e16 - 1, an error code with invalid
322
+ * argument will be returned.
320
323
*
321
324
* @param time The amount of time to wait.
322
325
* @param unit The unit of measure for {@code time}.
@@ -336,6 +339,9 @@ interface Timeouts {
336
339
* <p>
337
340
* Increasing the implicit wait timeout should be used judiciously as it will have an adverse
338
341
* effect on test run time, especially when used with slower location strategies like XPath.
342
+ * <p>
343
+ * If the timeout is negative, not null, or greater than 2e16 - 1, an error code with invalid
344
+ * argument will be returned.
339
345
*
340
346
* @param duration The duration to wait.
341
347
* @return A self reference.
@@ -359,72 +365,84 @@ default Duration getImplicitWaitTimeout() {
359
365
* @deprecated Use {@link #setScriptTimeout(Duration)}
360
366
*
361
367
* Sets the amount of time to wait for an asynchronous script to finish execution before
362
- * throwing an error. If the timeout is negative, then the script will be allowed to run
363
- * indefinitely .
368
+ * throwing an error. If the timeout is negative, not null, or greater than 2e16 - 1, an
369
+ * error code with invalid argument will be returned .
364
370
*
365
371
* @param time The timeout value.
366
372
* @param unit The unit of time.
367
373
* @return A self reference.
368
374
* @see JavascriptExecutor#executeAsyncScript(String, Object...)
375
+ * @see <a href="https://www.w3.org/TR/webdriver/#set-timeouts">W3C WebDriver</a>
376
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
369
377
*/
370
378
@ Deprecated
371
379
Timeouts setScriptTimeout (long time , TimeUnit unit );
372
380
373
381
/**
374
382
* Sets the amount of time to wait for an asynchronous script to finish execution before
375
- * throwing an error. If the timeout is negative, then the script will be allowed to run
376
- * indefinitely .
383
+ * throwing an error. If the timeout is negative, not null, or greater than 2e16 - 1, an
384
+ * error code with invalid argument will be returned .
377
385
*
378
386
* @param duration The timeout value.
379
387
* @return A self reference.
380
388
* @see JavascriptExecutor#executeAsyncScript(String, Object...)
389
+ * @see <a href="https://www.w3.org/TR/webdriver/#set-timeouts">W3C WebDriver</a>
390
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
381
391
*/
382
392
default Timeouts setScriptTimeout (Duration duration ) {
383
393
return setScriptTimeout (duration .toMillis (), TimeUnit .MILLISECONDS );
384
394
}
385
395
386
396
/**
387
397
* Gets the amount of time to wait for an asynchronous script to finish execution before
388
- * throwing an error. If the timeout is negative, then the script will be allowed to run
389
- * indefinitely .
398
+ * throwing an error. If the timeout is negative, not null, or greater than 2e16 - 1, an
399
+ * error code with invalid argument will be returned .
390
400
*
391
401
* @return The amount of time to wait for an asynchronous script to finish execution.
392
402
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
403
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
393
404
*/
394
405
default Duration getScriptTimeout () {
395
406
throw new UnsupportedCommandException ();
396
407
}
397
408
398
409
/**
399
- * @deprecated Use {@link #pageLoadTimeout(Duration)}
400
- *
401
- * Sets the amount of time to wait for a page load to complete before throwing an error.
402
- * The timeout value specified should be a positive number.
403
- *
404
410
* @param time The timeout value.
405
411
* @param unit The unit of time.
406
412
* @return A Timeouts interface.
413
+ * @see <a href="https://www.w3.org/TR/webdriver/#set-timeouts">W3C WebDriver</a>
414
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
415
+ * @deprecated Use {@link #pageLoadTimeout(Duration)}
416
+ *
417
+ * Sets the amount of time to wait for a page load to complete before throwing an error.
418
+ * If the timeout is negative, not null, or greater than 2e16 - 1, an error code with
419
+ * invalid argument will be returned.
407
420
*/
408
421
@ Deprecated
409
422
Timeouts pageLoadTimeout (long time , TimeUnit unit );
410
423
411
424
/**
412
425
* Sets the amount of time to wait for a page load to complete before throwing an error.
413
- * If the timeout is negative, page loads can be indefinite.
426
+ * If the timeout is negative, not null, or greater than 2e16 - 1, an error code with
427
+ * invalid argument will be returned.
414
428
*
415
429
* @param duration The timeout value.
416
430
* @return A Timeouts interface.
431
+ * @see <a href="https://www.w3.org/TR/webdriver/#set-timeouts">W3C WebDriver</a>
432
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
417
433
*/
418
434
default Timeouts pageLoadTimeout (Duration duration ) {
419
435
return pageLoadTimeout (duration .toMillis (), TimeUnit .MILLISECONDS );
420
436
}
421
437
422
438
/**
423
439
* Gets the amount of time to wait for a page load to complete before throwing an error.
424
- * If the timeout is negative, page loads can be indefinite.
440
+ * If the timeout is negative, not null, or greater than 2e16 - 1, an error code with
441
+ * invalid argument will be returned.
425
442
*
426
443
* @return The amount of time to wait for a page load to complete.
427
444
* @see <a href="https://www.w3.org/TR/webdriver/#get-timeouts">W3C WebDriver</a>
445
+ * @see <a href="https://www.w3.org/TR/webdriver/#dfn-timeouts-configuration">W3C WebDriver</a>
428
446
*/
429
447
default Duration getPageLoadTimeout () {
430
448
throw new UnsupportedCommandException ();
@@ -673,27 +691,6 @@ interface Window {
673
691
*/
674
692
void setPosition (Point targetPosition );
675
693
676
- /**
677
- * Get the size of the current window. This will return the outer window dimension, not just
678
- * the view port.
679
- * <p>
680
- * See <a href="https://w3c.github.io/webdriver/#get-window-rect">W3C WebDriver specification</a>
681
- * for more details.
682
- *
683
- * @return The current window size.
684
- */
685
- Dimension getSize ();
686
-
687
- /**
688
- * Get the position of the current window, relative to the upper left corner of the screen.
689
- * <p>
690
- * See <a href="https://w3c.github.io/webdriver/#get-window-rect">W3C WebDriver specification</a>
691
- * for more details.
692
- *
693
- * @return The current window position.
694
- */
695
- Point getPosition ();
696
-
697
694
/**
698
695
* Maximizes the current window if it is not already maximized
699
696
* <p>
0 commit comments