driver.findElement(By.id("Email")).sendKeys("XXXX@gmail.com");
driver.findElement(By.id("Passwd")).sendKeys("password");
driver.findElement(By.id("signIn")).click();
//wait for page to load
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
//this is important to click on any element on gmail page
driver.switchTo().frame("canvas_frame");
//Now , click on compose mail
==========================================================
selenium.clickAt("//div[contains(text(), 'Compose mail')]","50,50");
Hi,i was using SeleniumRC,selenium.clickAt("//div[contains(text(), 'Compose mail')]","50,50");if i use dis also i was not able to get the solution,getting Exception.
ReplyDeleteAfter clicking Compose, I can type to and subject. But I failed to type msg body. How can I type message body of Gmail?
ReplyDeleteHi i have use this selenium.clickAt("//div[contains(text(), 'Compose mail')]","50,50") even after using this command also am not able to invoke compose screen. Is there any sepcific reason please reply asap.
ReplyDeleteThis can be done very easily with Selenium IDE. The code looks like this.
ReplyDelete-----------------------------
Command, Target, Value
setTimeout, 3000,
open, /mail/u/0/?shva=1#inbox?compose=new
click, class=aoD hl
type, //table/tbody/tr[1]/td[2]/div/div/textarea, McKiran@tested.com
.................
-----------------------------
For detailed article, please refer to http://www.seleniumhq.in/2013/04/automatically-login-to-gmail-and-send.html
mm nice post but... when i tried to switch to"canvas_frame" its throwing an error "Unable to locate frame: canvas_frame" you got any other solution for this....
ReplyDeleteHi........I have sent an Emil successfully through selenium automation using Gmail Account Below is the script please find it.....
ReplyDeletedriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.findElement(By.xpath("//div[@id=':jb']/div[@class='z0']/div")).click(); // Compose
selenium.type("//div[@class='wO nr l1']//textarea[@name='to']", "vikramnarlai@gmail.com"); // To
selenium.type("//div[@class='aoD az6']//input[@name='subjectbox']", "Wanted to SAY HI"); // For Subject
selenium.type("//div[@class='Ar Au']/div[@class='Am Al editable LW-avf']", "Hi Vikram");// For Message body
selenium.click("//div[@class='J-J5-Ji']/div[@class='T-I J-J5-Ji aoO T-I-atl L3']"); //send
can any one tell me that how to click on "send" button on gmail using selenium webdriver
ReplyDeletecan anyone tell me that how to click on "Send" button using the cssSelector on gmail (selenium webdriver)
Delete//click SEND button in Gmail
ReplyDeletedriver.findElement(By.xpath("//div[text()='Send']")).click();
can some one tell me how we can compose gmail with label as'social' using selenium?
ReplyDelete