Gmail automation

174 views
Skip to first unread message

p.magist...@gmail.com

unread,
Dec 18, 2014, 5:13:27 AM12/18/14
to seleniu...@googlegroups.com
i want to automate gmail gui, everything is fine (i can type  the addesses in the "To" text area and
Type the subject to the "Subject" input ) but i cannot get to body text area and type anything 

Could you help me ? 

Cheers,
Maciej

CH!NN@ K

unread,
Dec 19, 2014, 4:08:36 AM12/19/14
to seleniu...@googlegroups.com
Hi Magisterka, It is working for me To and Subject input fields. Refer this link for gmail automation : http://techlearn.in/content/sikuli-and-selenium-scripts-composing-mail-gmail-using-selenium

---
Thanks & Regards,
Purushotham Karimbedu,
Druapl Developer and QA Engineer,
Website for Selenium : http://techlearn.in


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2360eeff-6131-457c-92db-e50fbf092089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ripon Al Wasim

unread,
Dec 19, 2014, 4:22:02 AM12/19/14
to seleniu...@googlegroups.com
Hi Machiej,

what code did you try for that?

ripon

--

Bharat Pottipareddy

unread,
Dec 19, 2014, 4:27:44 AM12/19/14
to seleniu...@googlegroups.com
Hi Machiej,

"CK Editor" recognition is tough with selenium. You may need to integrate with robotium or some other 3rd party tool to perform action on it.

Regards,
Bharat.P

Krishnan Mahadevan

unread,
Dec 21, 2014, 1:10:30 AM12/21/14
to seleniu...@googlegroups.com
Maciej,
Why would you want to automate the Gmail GUI ?
Unless and until you are actually part of the google team that is responsible for building gmail application itself, I don’t see any reason why you should resort to taking a UI route for interacting with gmail mails, instead of resorting to using libraries such as JavaMail and access the emails via APIs. IMO that is going to give you a lot more better control with respect to what sort of operations you would want to do with respect to mails.

My 2 cents !

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


Dan Franko

unread,
Dec 21, 2014, 3:57:30 PM12/21/14
to seleniu...@googlegroups.com
Pretty sure the gmail interface isn't using the CKEditor.  Anyway, there's really no need to access gmail via the GUI and it's much easier to access it via IMAP.

Andreas Tolfsen

unread,
Dec 22, 2014, 4:50:48 AM12/22/14
to seleniu...@googlegroups.com
Please heed to Krishnan's advice here. There are absolutely no good
reasons you'd want to run an automation script against GMail.

pranab singh

unread,
Dec 22, 2014, 11:54:14 PM12/22/14
to seleniu...@googlegroups.com

Check your xpath and use send keys..it works for mine..

--

Rajeev Prabhakaran Nair

unread,
Dec 26, 2014, 2:39:46 AM12/26/14
to seleniu...@googlegroups.com
Gmail page consist of dynamic webelements, you have to use xpath / css path carefully to meet the requirements.

I have used below xpath locator to identify the body.

driver.findElement(By.xpath("//div[contains(@class,'gmail_default')]"));

its working fine for me.

R

mr. Selenide

unread,
Dec 26, 2014, 4:19:50 PM12/26/14
to seleniu...@googlegroups.com
Hi Maciej!
Here is a working sample project for testing GMail:

You can checkout and run it locally with a few minutes.
Feel free to share your feedback.

четверг, 18 декабря 2014 г., 12:13:27 UTC+2 пользователь p.magist...@gmail.com написал:

mr. Selenide

unread,
Dec 27, 2014, 3:07:04 AM12/27/14
to seleniu...@googlegroups.com
Good morning!

I have recorded a short video demonstrating how GMail test works:

https://vimeo.com/115448433


четверг, 18 декабря 2014 г., 12:13:27 UTC+2 пользователь p.magist...@gmail.com написал:
i want to automate gmail gui, everything is fine (i can type  the addesses in the "To" text area and

Gopi Prasadreddy

unread,
May 25, 2017, 10:47:22 AM5/25/17
to Selenium Users
public static void main(String[] args) throws InterruptedException 
{
System.setProperty("webdriver.chrome.driver", "C:\\Users\\gopi\\Downloads\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
//System.setProperty("webdriver.Firefox.Firefoxdriver", "C:\\Users\\gopi\\Downloads\\geckodriver-v0.16.1-win64(1)");

//WebDriver driver = new FirefoxDriver();
driver.get("https://mail.google.com"); 
driver.findElement(By.id("identifierId")).sendKeys("XXXXXXX");
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div[2]/form/div[2]/div/div[2]/div[1]/content/span")).click();
Thread.sleep(4000);
 //driver.findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div[2]/form/div[2]/div/div/div[1]/div/div[1]/div/div[1]/div/div[1]/input")).sendKeys("XXXXXXXXX");
driver.findElement(By.xpath("//*[@id='password']/div[1]/div/div[1]/input")).sendKeys("XXXXXXX");
Thread.sleep(4000);
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div[2]/form/div[2]/div/div/div[2]/div[1]/content/span")).click();
Thread.sleep(20000);
//compose button
driver.findElement(By.xpath("//*[@id=':xy']/div/div")).click();
Thread.sleep(4000);
//to address
driver.findElement(By.id(":13l")).sendKeys("XXX...@gmail.com");
Thread.sleep(4000);
//subject
driver.findElement(By.id(":135")).sendKeys("TEST");
Thread.sleep(15000);
// for text
driver.findElement(By.xpath("html/body/div[14]/div/div/div/div[1]/div[3]/div[1]/div[1]/div/div/div/div[3]/div/div/div[4]/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div/div[1]/div[2]/div[1]/div/table/tbody/tr/td[2]/div[2]/div")).sendKeys("this is gopiprasad sending text mail");
Thread.sleep(4000);
// file add
// driver.findElement(By.id(":14y")).click();
// driver.findElement(By.id("_hf1")).click();
 
Thread.sleep(4000);
//select file
//driver.findElement(By.xpath("desktop")).sendKeys("C:\\Users\\gopi\\Desktop\\interwiew");
//Thread.sleep(4000);
driver.findElement(By.id(":12v")).click();
Thread.sleep(10000);
driver.findElement(By.xpath("//*[@id='gb']/div[1]/div[1]/div[2]/div[4]/div[1]/a/span")).click();
Thread.sleep(4000);
driver.findElement(By.id("gb_71")).click();
Thread.sleep(4000);
Reply all
Reply to author
Forward
0 new messages