Advertisement
SeleniumETrainR

Example and Practise – Print Gmail’s Current space counter o

Dec 21st, 2012
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import org.openqa.selenium.By;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.firefox.FirefoxDriver;
  4.  
  5.  
  6. public class Gmail_space_Counter {
  7.     public static String before = null;
  8.     public static String after = null;
  9.      
  10.     public static void main(String[] args) {
  11.         WebDriver myTestDriver = new FirefoxDriver();
  12.         myTestDriver.manage().window().maximize();
  13.  
  14.         myTestDriver.navigate().to("http://www.gmail.com");
  15.          
  16.        
  17.      
  18.        
  19.         while(true){
  20.             after=myTestDriver.findElement(By.xpath("//*[@id='quota']")).getText();
  21.          
  22.  
  23.             if(!after.equals(before)){
  24.                 System.out.println(after);
  25.                 before=after;
  26.                
  27.             }      
  28.            
  29.         }
  30.  
  31.  
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement