Open mails from Gmail inbox using selenium webdriver using java

Binu picture Binu · Apr 21, 2016 · Viewed 43.8k times · Source

I need to open mails from Gmail inbox using selenium webdriver using java in Eclipse IDE. Is there a way to do this using xpath?

Answer

sonhu picture sonhu · Apr 21, 2016

The ideal way would be to not use selenium to automate gmail but rather use the Gmail API (https://developers.google.com/gmail/api/#how_do_i_find_out_more) to verify the message was successfully sent. If you do not want to learn how to check the messages at the API level I would highly recommend using the HTML version of gmail using this link as the initial url for gmail (https://mail.google.com/mail/?ui=html) using gmail with javascript enabled will make it much harder to have a reliable test script.