Stop trying to automate GMail

1138 views
Skip to first unread message

Jim Evans

unread,
May 8, 2013, 6:37:24 AM5/8/13
to seleniu...@googlegroups.com
It happens time and time again. There are heaps of posts on this list of well-intentioned people trying to automate GMail. Usually, it's one of three scenarios those people are trying to solve.

One scenario is that the poster is trying to learn to use WebDriver and wants a public site to learn against. The problem is that the GMail page is *so* complex, and changes so often, that it's a poor choice for learning. It'll be the source of a ton of frustration for anyone trying to learn.

The other two scenarios are related. Either the application the poster is testing accepts input from email, or sends notifications via email, and they want to validate that functionality. In both cases, the important thing is generating or reading the email messages, not that they be accessed through the GMail website. GMail provides access to the mail store for sending and receiving via raw SMTP and IMAP, respectively. Most languages have libraries to handle these protocols so that you can manipulate the email account for sending and receiving without ever firing up a browser. Use these instead.

Unless you're a Google employee, working on the GMail web client team, then please, for the love of all that's holy, do not, do not, *do* *not* attempt to automate GMail using WebDriver.

Karthik Kulkarni

unread,
May 8, 2013, 6:42:23 AM5/8/13
to seleniu...@googlegroups.com
loved it !!



--
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/msg/selenium-users/-/7peVDuzkNN4J.
For more options, visit https://groups.google.com/groups/opt_out.



David Lai

unread,
May 8, 2013, 3:23:26 PM5/8/13
to seleniu...@googlegroups.com
It's understand able since a vast majority come from a manual tester perspective.  They haven't understand the concepts of APIs and 3rd party libraries.  

If you use QTP or other All in One automation tools, you get a sense of trying to automate things the manual way, than to getting it done in a robust way.


Along the same lines, many people make the mistake of creating set accounts on their test systems to run their tests instead of Fixtures to generate the data.  Then later on find their tests cannot support automatic branching and parallel execution at scale as easily.

Thomas Sundberg

unread,
May 9, 2013, 5:09:55 AM5/9/13
to Selenium Users
On 8 May 2013 12:37, Jim Evans <james.h....@gmail.com> wrote:
> It happens time and time again. There are heaps of posts on this list of well-intentioned people trying to automate GMail. Usually, it's one of three scenarios those people are trying to solve.
>
> One scenario is that the poster is trying to learn to use WebDriver and wants a public site to learn against. The problem is that the GMail page is *so* complex, and changes so often, that it's a poor choice for learning. It'll be the source of a ton of frustration for anyone trying to learn.
>

Does anybody have a reasonable, public site to test against?

I like http://www.yr.no/ but a more complex site might be interesting
after a while.
A given is of course be http://www.seleniumhq.org/

Any other suggestions? Something with complex forms in where the
result of a submit is easy to validate?


/Thomas



> The other two scenarios are related. Either the application the poster is testing accepts input from email, or sends notifications via email, and they want to validate that functionality. In both cases, the important thing is generating or reading the email messages, not that they be accessed through the GMail website. GMail provides access to the mail store for sending and receiving via raw SMTP and IMAP, respectively. Most languages have libraries to handle these protocols so that you can manipulate the email account for sending and receiving without ever firing up a browser. Use these instead.
>
> Unless you're a Google employee, working on the GMail web client team, then please, for the love of all that's holy, do not, do not, *do* *not* attempt to automate GMail using WebDriver.
>
> --
> 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/msg/selenium-users/-/7peVDuzkNN4J.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

Tarun Kumar

unread,
May 9, 2013, 6:47:47 AM5/9/13
to seleniu...@googlegroups.com, t...@kth.se

Tarun Kumar

unread,
May 9, 2013, 6:48:54 AM5/9/13
to seleniu...@googlegroups.com
How do me make this thread sticky?

Jon Valvano

unread,
May 9, 2013, 8:22:47 AM5/9/13
to seleniu...@googlegroups.com
An alternative to hitting someone else's public site for learning there are a couple of options:
1) hit your own company's site
2) use your own testing HTML page.

Create a simple HTML page with Apache you will be able to learn more and get exposure to a wider range of technologies.  Apache is easy to install and run on a local system.  
If you use your own html page the opportunity to learn about various technologies(html, javascript, Apache, Selenium) and have the test page match the real world case you are trying to solve.  In fact w3c has tons of examples you can learn from.

For example our homegrown testing framework has a custom mechanism for waiting for elements to appear on a page.  I wrote a test page has a javascript function that was invoked from a button click which adds a div to a page with a random id.  This was added to our tests of our testing framework and now I have a regression test for the waiting mechanism. 

If you are looking to just learn Selenium, here is a sample HTML that will allow for several types locator practice:
<!DOCTYPE html>
<html>
<body>
<span id="1" name="uno">span1</span>
<span id="2" name="dos">span2</span>
<div id="one" css="one-css">
one
</div>
<div id="two" css="two-css">
two
</div>
<div id="three">
three
</div>
<div id="four">
four
</div>
</body>
</html> 







David

unread,
May 9, 2013, 8:26:32 PM5/9/13
to seleniu...@googlegroups.com
I second using your own company's site for testing. 

Testing your own custom HTML isn't necessarily effective, especially for beginners. It's time consuming, requires thoughtful planning on what you want to test, or it can end up being too simple & straightforward, or you end up spending too much time building a complex app just to try out Selenium.

Also, if not using for an actual test, I don't recommend use of GMail or Outlook Web Access as a target to learn/evaluate Selenium with. Apps that require an account and using data (need send email, have existing emails, etc.) seems inconvenient & a hassle to prepare and ends up creating junk data just for learning (if not using your own personal account but some test account).

It's better testing sites or apps where you can test functionality anonymously w/o an account and existing data dependencies. So in terms of Google, the Google home page, search engine, Google Maps, and Youtube are better candidates than say GMail.

David

unread,
May 9, 2013, 8:30:23 PM5/9/13
to seleniu...@googlegroups.com
On David Lai's comment, it might help if others in the community perhaps built wrappers to these IMAP, SMTP APIs in various languages (namely Java, .NET/C#, Python, Ruby, PHP, etc.), or document an example tutorial on how to use them with respect to a Selenium test scenario. That way novices, can simply do a plug & play approach borrowing on the example code, and/or use the wrappers and simply plug in their account login info, then call methods to send email, check email, delete email, etc.

Otherwise, the novice community will continue to do as they do now trying to GUI automation GMail and Outlook Web Access.

David Lai

unread,
May 9, 2013, 9:15:21 PM5/9/13
to seleniu...@googlegroups.com
This is what I've been trying to do with Python.  Been writing wrappers and glue code, and as I find things reusable, I'll try to incorporate it into our open source framework.

Mark Collin

unread,
May 10, 2013, 3:55:37 AM5/10/13
to seleniu...@googlegroups.com
Google maps is a good place for beginners to starts learning?  Google maps is one of the more challenging automation exercises and it requires a reasonable amount of JavaScript work to hook into google API's for checking things like Long and Lat, things rendered on the map canvas, etc.

I want some of what you've been smoking :)

Generally Google is a bad place to learn automation IMHO.  Google is constantly updating thier website, they have very effective anti DDOS protection (you will very quickly find yourself shut down for 10 mins if you perform a Google search and then start automatically going through the pages of results) and a lot of their markup is convoluted.

I would suggest a static website for beginners.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/PHCONLScSIcJ.

Gustavo Godoy

unread,
May 10, 2013, 7:16:28 AM5/10/13
to seleniu...@googlegroups.com
please spread this post all around...


"Unless you're a Google employee, working on the GMail web client team, then please, for the love of all that's holy, do not, do not, *do* *not* attempt to automate GMail using WebDriver."
Yes, if you want to test if your application send a email, why automate the client email? Just ensure your application send the email (and you even don't need to use selenium for that) and the responsibility for the email transport its not yours... What if the email don't be delivered for a error on Gmail servers? You fail your test and report your team?

I agree,
Gustavo Godoy

David

unread,
May 10, 2013, 2:47:28 PM5/10/13
to seleniu...@googlegroups.com
Mark,

Sorry if I didn't clarify. My suggestion of Google Maps was not meant as a recommended site for real beginners to learn Selenium. But rather those that want to tackle something challenging besides a static (1990-ish style simple) website or basic HTML forms.

I think finding well known public simple sites (not simple as in look but actual HTML structure) can be hard sometimes, and same is true for finding good public complex sites to test against. I'm sure there are many of each, but to a novice, it might be hard to come up with a list of site candidates w/o due diligence in reviewing the actual site's design & HTML/JS/CSS structure.

robbiewinston

unread,
May 20, 2013, 6:18:44 AM5/20/13
to seleniu...@googlegroups.com
Couldn't agree more with Jim.  Here are some thoughts I had a few months ago;

 
Message has been deleted

Krishnan Mahadevan

unread,
Jun 10, 2013, 4:22:42 AM6/10/13
to Selenium Users
Amit,
I dont think you quite got what Jim was stating.

Jim was hinting at "Why do you need to even attempt to automate GMail" rather than commenting on "Is GMail automation possible or not".

If you have automated all the functionality of GMail, that is pretty good. But what Jim is trying to drive here as a point is.. "Why do you even need to automate GMail. What is the use case you are trying to solve ? Why cant it be better achieved using APIs such as JavaMail".

Those are points to ponder !



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


On Mon, Jun 10, 2013 at 12:56 PM, amit azad <er.az...@gmail.com> wrote:
Completely disagree with your last comment. I have automated all the functionality of Gmail.   

--
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.

David

unread,
Jun 10, 2013, 3:04:10 PM6/10/13
to seleniu...@googlegroups.com
To add to Krishnan's response, and out of curiosity:

Amit,

Do you work for Google? And what reason or requirement led you to automate all of GMail? Unless you worked for Google or had a compelling reason, most people who just need to do some email verification and chose to use GMail would not have automated all of it.

And also, if you've automated all of it, how much of the automation has been robust in that it rarely broke w/o you have to update element locators or UI flow changes from GMail changes.

Again these are all curiosity questions, not starting a debate or anything here.

Regards,
David
Reply all
Reply to author
Forward
0 new messages