[Tutor] Learning Python through automating web application testing.

wrw at mac.com wrw at mac.com
Sat Dec 15 15:34:48 CET 2012


On Dec 7, 2012, at 5:46 PM, marcusw4988 at hotmail.co.uk <worthez at googlemail.com> wrote:

> Hello all,
> 
> I'm new to posting on mailing lists so hopefully I've picked the correct one for my question(s).
> 
> A little about my programming experience first.
> 

[byte]

> Because of this fear I've never admitted I've got a ready made project just waiting for me to tackle...........
> 
> Until now!
> 
> I would like to learn to automate the testing of a http(s) web site/applications but feel slightly overwhelmed by this task so would like to ask for some initial guidance. 
> 

Wow (!) welcome the wonderful world of Python.  I have several comments - but let me start (with apologies) by encouraging you to think about another initial project.  Others may well disagree with me (and I'd welcome that), but from my point of view, your choice (although by starting small can probably be done with relatively little of YOUR python code to call libraries), does require a deeper understanding of several parallel (pun intended) aspects of programming for web, ssh, sockets, python, your OS, and your chosen python libraries than you may realize.

Just to mention one - simulation of pounding on the test site by several users will require multi-processing from a pool of parallel jobs.  The standard Python library has the tools to handle this, but it isn't an easy subject for someone new to programming to get your mental arms wrapped around.  I'm not familiar with the Chun book, so my worries may be completely misplaced (and if so, I apologize), but if you aren't really comfortable yet with OOP, and class definitions that start with '__init__(self…)' - this project isn't a good place to start.

You can get some feel for your level of achievement by looking at urllib, urllib2, and httplib in the python standard documentation  (and maybe looking at beautifulsoup (either BS3 or BS4).  Then, if you want to go ahead - the kind of questions you will be coming up with are probably better addressed on the more general python-list at python.org discussion group.  (There are lots of folks here to read both, so you won't need to cross post.) 

> These are some of questions that I have.
> 
> How do I go about this? 
> 
> Where do I start?  
> 
> There's just so much out there to help with learning Python I'm experiencing information overload!  
> 
> How do I stop myself from trying to run before I can walk?
> 

My suggestion would be to pick a project that yields something useful around your house or apartment (flat?) or a single-function utility that would be useful to you (maybe some sort of backup utility that is customized for the way you work).

> In a perfect world a step by step guide, in automating web tests, using Python is what I'm after but failing that(!) which sites/forums/mailing lists are of particular interest to someone who would like to learn Python programming initially through automating web tests?  (By web tests, to begin with, I mean automated regression testing of a site by multiple users)
> 

When you get to the point of actually starting to tackle this - there is one more question you need to answer before you start.  Are you trying to check for correct functionality at all branch points when users respond appropriately, or are you wanting to check for possible ways the site can be crashed by users typing garbage or attempting to attack the site?  The latter is a MUCH more complex project.

Sorry to sound so discouraging (and as I said, others may have much more encouraging suggestions for ways to approach this),
-Bill

> At work we use Selenium and Java so I'm aware that Selenium comes with a Python driver.  Would that be a good place to start?
> 
> Apologies if I'm not supposed to ask more than one question per mail but these are all closely related and could be thought of as "newbie struggling to see the wood/forest for the trees!"
> 
> Many thanks for your help
> 
> Regards
> Marcus
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list