Saturday, 10 October 2015

FIRST SELENIUM WEB DRIVER PROGRAMME FOR GMAIL APPLICATION



package aa;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class a {

            public static void main(String[] args) throws InterruptedException {
                        WebDriver wd= new FirefoxDriver();
                        wd.get("http:gmail.com");
                        wd.findElement(By.xpath(".//*[@id='Email']")).sendKeys("akhilreddyhyd@gmail.com");
                        wd.findElement(By.xpath(".//*[@id='Passwd']")).sendKeys("venkanna143");
                        wd.findElement(By.xpath(".//*[@id='signIn']")).click();
                        Thread.sleep(5000);
                        wd.findElement(By.xpath(".//*[@id=':b7']/div/div")).click();
                        Thread.sleep(5000);
                        wd.findElement(By.xpath(".//*[@id=':14i']")).sendKeys("akhilreddyhyd@gmail.com");
                        wd.findElement(By.xpath(".//*[@id=':161']")).sendKeys("Hi h r u");
                        wd.findElement(By.xpath(".//*[@id=':16i']")).click();
                        Thread.sleep(5000);
                        wd.findElement(By.xpath(".//*[@id='gbgs4d']/span[2]")).click();
                        wd.findElement(By.xpath(".//*[@id='gb_71']")).click();
            }

}

No comments:

Post a Comment