Home > Automation Testing > automate gmail login process using Selenium

automate gmail login process using Selenium

This post was most recently updated on August 6th, 2019

Code to automate gamil login, send email and attachment.

To use below code need to replace username password with actual values.

Selenium code to send email using gmail by performing UI Operations. Below code will perform operations like

1) Launch chrome browser
2) Open Gmail URL
3) Enter Email ID and Password
4) Navigate to INBOX
5) Click on Compose email and enter details with attachment
6) Send email.


To attach a file send the full path of file in input WebElement

This Article is TAGGED in , , . BOOKMARK THE permalink.

Babita Sahu
Automation Software Test Engineer. Skills : Selenium , STLC , Java, Manual Testing , UI / UX Testing

3 thoughts on “automate gmail login process using Selenium

  1. Hi Babita,

    Thanks for your post… This approach is being blocked by gmail to log into my mailbox. Do you have the gmail reset api request for token generation and refresh the token please?

Leave a Reply

Your email address will not be published.

seventy two ÷ eighteen =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">