package googlechrome;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class gmail {
private Process process;
@Test
public void run() throws Exception{
System.setProperty("webdriver.chrome.driver","C:\\Users\\gwda\\Desktop\\chromedriver.exe");
WebDriver s1 = new ChromeDriver();
s1.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
s1.get("http://www.gmail.com");
s1.findElement(By.xpath("//input[@id='Email']")).sendKeys("mail id");
s1.findElement(By.xpath("//input[@id='Passwd']")).sendKeys("password");
s1.findElement(By.xpath("//input[@id='signIn']")).click();
s1.findElement(By.xpath("//div[@class='T-I J-J5-Ji T-I-KE L3']")).click();
Thread.sleep(3000);
s1.findElement(By.xpath("//textarea[@class='vO']")).sendKeys("ngowda.unilog@gmail.com");
s1.findElement(By.xpath("//input[@name='subjectbox']")).sendKeys("hi");
s1.findElement(By.xpath("//div[@class='Am Al editable LW-avf']")).sendKeys("dear friend," +
" " +
"welcome to send a mail using seenium" +
"using the Auto it for Ataching the File " +
"in Gmail ID will be dynamicaly changing so we have to use only which one static," +
"here i am using the CLASS some where it s also changing, where it s changing we have use another." +
" Regards" +
" NGOWDA" +);
s1.findElement(By.xpath("//div[@class='a1 aaA aMZ']")).click();//sendKeys("supply");
//it is a Auto it code for uploading a file. please use Auto it for upload a file.
process = new ProcessBuilder("C:\\Users\\gwda\\Desktop\\file1.exe",
"C:\\Users\\gwda\\Desktop\\PartListLoader.txt","Open").start();
Thread.sleep(30000);
s1.findElement(By.xpath("//div[contains(text(),'Send')]")).click();
Thread.sleep(3000);
s1.findElement(By.xpath("//div[@class='a1 aaA aMZ']")).click();
s1.close();
}
}
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class gmail {
private Process process;
@Test
public void run() throws Exception{
System.setProperty("webdriver.chrome.driver","C:\\Users\\gwda\\Desktop\\chromedriver.exe");
WebDriver s1 = new ChromeDriver();
s1.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
s1.get("http://www.gmail.com");
s1.findElement(By.xpath("//input[@id='Email']")).sendKeys("mail id");
s1.findElement(By.xpath("//input[@id='Passwd']")).sendKeys("password");
s1.findElement(By.xpath("//input[@id='signIn']")).click();
s1.findElement(By.xpath("//div[@class='T-I J-J5-Ji T-I-KE L3']")).click();
Thread.sleep(3000);
s1.findElement(By.xpath("//textarea[@class='vO']")).sendKeys("ngowda.unilog@gmail.com");
s1.findElement(By.xpath("//input[@name='subjectbox']")).sendKeys("hi");
s1.findElement(By.xpath("//div[@class='Am Al editable LW-avf']")).sendKeys("dear friend," +
" " +
"welcome to send a mail using seenium" +
"using the Auto it for Ataching the File " +
"in Gmail ID will be dynamicaly changing so we have to use only which one static," +
"here i am using the CLASS some where it s also changing, where it s changing we have use another." +
" Regards" +
" NGOWDA" +);
s1.findElement(By.xpath("//div[@class='a1 aaA aMZ']")).click();//sendKeys("supply");
//it is a Auto it code for uploading a file. please use Auto it for upload a file.
process = new ProcessBuilder("C:\\Users\\gwda\\Desktop\\file1.exe",
"C:\\Users\\gwda\\Desktop\\PartListLoader.txt","Open").start();
Thread.sleep(30000);
s1.findElement(By.xpath("//div[contains(text(),'Send')]")).click();
Thread.sleep(3000);
s1.findElement(By.xpath("//div[@class='a1 aaA aMZ']")).click();
s1.close();
}
}
No comments:
Post a Comment