SHARE
TWEET

Example of Implicit Waits using selenium Webdriver

a guest Dec 14th, 2012 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.concurrent.TimeUnit;
  2.  
  3. import org.openqa.selenium.By;
  4. import org.openqa.selenium.WebDriver;
  5. import org.openqa.selenium.firefox.FirefoxDriver;
  6.  
  7. public class TestExecutionPausing {
  8.  
  9.  
  10.         public static void main(String[] args) {
  11.                  
  12.                 WebDriver myTestDriver = new FirefoxDriver();
  13.                 myTestDriver.get("http://www.scribd.com/");
  14.                 myTestDriver.manage().window().maximize();
  15.                
  16.                 myTestDriver.manage().timeouts().implicitlyWait(1,TimeUnit.SECONDS);
  17.                 myTestDriver.findElement(By.xpath("//*[@id='links']/li[5]/a")).click();
  18.                
  19.                
  20.                
  21.                 System.out.println(myTestDriver.findElement(By.xpath("//*[@id='links']/li[9]/a")).getAttribute("href"));
  22.  
  23.                        
  24.         }
  25.  
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top