SHARE
TWEET

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

SeleniumETrainR Dec 21st, 2012 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
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
 
Top