com.thoughtworks.selenium
Class Wait

java.lang.Object
  extended by com.thoughtworks.selenium.Wait

public abstract class Wait
extends java.lang.Object

A utility class, designed to help the user automatically wait until a condition turns true. Use it like this:

new Wait("Couldn't find close button!") {
    boolean until() {
        return selenium.isElementPresent("button_Close");
    }
};

Author:
Dan Fabulich

Nested Class Summary
 class Wait.WaitTimedOutException
           
 
Field Summary
 long intervalInMilliseconds
          The interval to pause between checking; the default is 500 milliseconds
 long timeoutInMilliseconds
          The amout of time to wait before giving up; the default is 30 seconds
 
Constructor Summary
Wait(java.lang.String message)
          Specifies the message we'll use when we fail
Wait(java.lang.String message, long timeoutInMilliseconds)
          Specifies a failure message and a timeout
Wait(java.lang.String message, long timeoutInMilliseconds, long intervalInMilliseconds)
          Specifies a failure message, a timeout, and an interval
 
Method Summary
 void wait(java.lang.String message)
          Wait until the "until" condition returns true or the timeout happens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeoutInMilliseconds

public long timeoutInMilliseconds
The amout of time to wait before giving up; the default is 30 seconds


intervalInMilliseconds

public long intervalInMilliseconds
The interval to pause between checking; the default is 500 milliseconds

Constructor Detail

Wait

public Wait(java.lang.String message)
Specifies the message we'll use when we fail

Parameters:
message - the failure message

Wait

public Wait(java.lang.String message,
            long timeoutInMilliseconds)
Specifies a failure message and a timeout

Parameters:
message - the failure message
timoutInMilliseconds - timeout in milliseconds

Wait

public Wait(java.lang.String message,
            long timeoutInMilliseconds,
            long intervalInMilliseconds)
Specifies a failure message, a timeout, and an interval

Parameters:
message - the failure message
timoutInMilliseconds - timeout in milliseconds
Method Detail

wait

public void wait(java.lang.String message)
Wait until the "until" condition returns true or the timeout happens

Parameters:
message - the failure message


Copyright © 2006 null. All Rights Reserved.