public static class SeleniumPlus.WDTimeOut
extends java.lang.Object
This class provides some static methods to set Selenium WebDriver's timeout thread-safely.
Constructor and Description |
---|
WDTimeOut() |
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.WebDriver.Timeouts |
implicitlyWait(long time,
java.util.concurrent.TimeUnit unit)
Set the Web Driver's ImplicitlyWait timeout, the amount of time the driver should wait
when searching for an element if it is not immediately present.
Note:This method is not thread-safe. |
static org.openqa.selenium.WebDriver.Timeouts |
pageLoadTimeout(long time,
java.util.concurrent.TimeUnit unit)
Set the Web Driver's pageLoad timeout, the amount of time to wait for a page load to complete
before throwing an error.
|
static boolean |
resetImplicitlyWait(long timeout,
java.util.concurrent.TimeUnit unit)
Reset the 'Web Driver's ImplicitlyWait timeout' and unlock the 'timeout setting'.
|
static boolean |
resetPageLoadTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Reset the 'Web Driver's PageLoad timeout' and unlock the 'timeout setting'.
|
static boolean |
resetScriptTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Reset the 'Web Driver's JavaScript Execution timeout' and unlock the 'timeout setting'.
|
static org.openqa.selenium.WebDriver.Timeouts |
scriptTimeout(long time,
java.util.concurrent.TimeUnit unit)
Set the Web Driver's Script timeout, the amount of time to wait for an asynchronous
script to finish execution before throwing an error.
|
static boolean |
setImplicitlyWait(long timeout,
java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's ImplicitlyWait timeout' and lock the 'timeout setting'.
|
static boolean |
setImplicitlyWait(long timeout,
java.util.concurrent.TimeUnit unit,
long waitLockTimeout)
Set the 'Web Driver's ImplicitlyWait timeout'
This method is thread-safe. |
static boolean |
setPageLoadTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's PageLoad timeout' and lock the 'timeout setting'.
|
static boolean |
setPageLoadTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
long waitLockTimeout)
Set the 'Web Driver's PageLoad timeout'
This method is thread-safe. |
static boolean |
setScriptTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's JavaScript Execution timeout' and lock the 'timeout setting'.
|
static boolean |
setScriptTimeout(long timeout,
java.util.concurrent.TimeUnit unit,
long waitLockTimeout)
Set the 'Web Driver's JavaScript Execution timeout'
This method is thread-safe. |
public static org.openqa.selenium.WebDriver.Timeouts implicitlyWait(long time, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setImplicitlyWait(long, TimeUnit)
,
setImplicitlyWait(long, TimeUnit, long)
public static org.openqa.selenium.WebDriver.Timeouts pageLoadTimeout(long time, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setPageLoadTimeout(long, TimeUnit)
,
setPageLoadTimeout(long, TimeUnit, long)
public static org.openqa.selenium.WebDriver.Timeouts scriptTimeout(long time, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setScriptTimeout(long, TimeUnit)
,
setScriptTimeout(long, TimeUnit, long)
public static boolean setImplicitlyWait(long timeout, java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's ImplicitlyWait timeout' and lock the 'timeout setting'. This method is thread-safe. If one thread has called this method, it will set a lock and the other threads will have to wait until the first thread unlock by callingresetImplicitlyWait(long, TimeUnit)
. The lock range is within the caller method. See the following example:try{ setImplicitlyWait(timeout, unit); //doSomething(); }catch(Exception e){ }finally{ resetImplicitlyWait(originalTimeout, originalUnit); }
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.resetImplicitlyWait(long, TimeUnit)
public static boolean setImplicitlyWait(long timeout, java.util.concurrent.TimeUnit unit, long waitLockTimeout)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.waitLockTimeout
- long, the timeout to wait for obtaining the lock, in millisecondssetImplicitlyWait(long, TimeUnit)
,
resetImplicitlyWait(long, TimeUnit)
public static boolean resetImplicitlyWait(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setImplicitlyWait(long, TimeUnit)
public static boolean setScriptTimeout(long timeout, java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's JavaScript Execution timeout' and lock the 'timeout setting'. This method is thread-safe. If one thread has called this method, it will set a lock and the other threads will have to wait until the first thread unlock by callingresetScriptTimeout(long, TimeUnit)
. The lock range is within the caller method. See the following example:try{ setScriptTimeout(timeout, unit); //doSomething(); }catch(Exception e){ }finally{ resetScriptTimeout(originalTimeout, originalUnit); }
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.resetScriptTimeout(long, TimeUnit)
public static boolean setScriptTimeout(long timeout, java.util.concurrent.TimeUnit unit, long waitLockTimeout)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.waitLockTimeout
- long, the timeout to wait for obtaining the lock, in millisecondssetScriptTimeout(long, TimeUnit)
,
resetScriptTimeout(long, TimeUnit)
public static boolean resetScriptTimeout(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setScriptTimeout(long, TimeUnit)
public static boolean setPageLoadTimeout(long timeout, java.util.concurrent.TimeUnit unit)
Set the 'Web Driver's PageLoad timeout' and lock the 'timeout setting'. This method is thread-safe. If one thread has called this method, it will set a lock and the other threads will have to wait until the first thread unlock by callingresetPageLoadTimeout(long, TimeUnit)
. The lock range is within the caller method. See the following example:try{ setPageLoadTimeout(timeout, unit); //doSomething(); }catch(Exception e){ }finally{ resetPageLoadTimeout(originalTimeout, originalUnit); }
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.resetPageLoadTimeout(long, TimeUnit)
public static boolean setPageLoadTimeout(long timeout, java.util.concurrent.TimeUnit unit, long waitLockTimeout)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.waitLockTimeout
- long, the timeout to wait for obtaining the lock, in millisecondssetPageLoadTimeout(long, TimeUnit)
,
resetPageLoadTimeout(long, TimeUnit)
public static boolean resetPageLoadTimeout(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- long, the timeout to setunit
- TimeUnit, the timeout's unit, seconds or milliseconds etc.setPageLoadTimeout(long, TimeUnit)
Copyright © SAS Institute. All Rights Reserved.