Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Gmail Sign-in through Selenium Webdriver

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.04k
    Comment on it

    Hello all, this is script for Gmail Sign-in through Selenium Webdriver by using xpath as a locator. I have use xpath in locating HTML elements. Xpath can be easily generate from Firebug.

    public class loginuser {
        public static void main(String[] args) 
    {
    
                WebDriver driver = new FirefoxDriver();
    
          driver.manage().timeouts().implicitlyWait(1, TimeUnit.MINUTES);//Wait
    
          driver.get("www.gmail.com");
    
          //Login
                driver.findElement(By.xpath("//*[@id='Email']")).sendKeys("Username");
          driver.findElement(By.xpath("//*[@id='Passwd']")).sendKeys("password");
          driver.findElement(By.xpath("//*[@id='signIn']")).click();
    
          driver.close();
    
           // Quit the driver
            driver.quit();
               }
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: