On SeConf 2011 and PyCon 2011
by Eing Ong
On SeConf, this is the first for Selenium and it was sold out with a wait-list. Speakers include creators of Selenium 1, Selenium 2 (WebDriver), and committers to both projects. Three talks I’d like to share are on Page Objects, large-scale web-testing on virtual machines, and Cucumber.
1. Page objects is a design pattern recommended to use with Selenium. Its key implementation is in creating a BasePage that instantiates all the dynamic links, buttons etc. and provides self-verification which eliminates sleeps in the test code. Another key implementation is to heavily use FindBy annotations from LoadableElements class. E.g. @FindBy(name='wikipedia'). Two notable best practices – 1. Use Singleton object for header or frame 2. Avoid XPath as it does not work well in IE or when results are dynamic, instead use JQuery and CSS selector to keep checking the DOM for element that will appear dynamically.
2. Large scale web-testing on virtual machines gives insight to how Google learnt from their mistakes to be able to run 1,000 concurrent browser sessions and 1 million web tests a day. Their initial attempt was a 5 minutes wait before user can use a VM after requesting it. Today, it takes a matter of seconds. The game-changer was to cache the VM so that it can be resumed without restarting. In addition, they implemented a monitor process, update process and Selenium server(s). Speaker concludes by recommending using cloud services as an alternative approach to implementing and maintaining a complex test infrastructure.
3. Cucumber is an interesting natural language testing tool that can be used in conjunction with Selenium. Cucumber uses a testing technique known as BDD or Behavior Driven Development. An example of a test scenario with 2 steps : 1. Given two accounts with positive balances, 2. then I should be able transfer money between these two accounts.
Some issues in using this approach are complexities in parsing natural language using regex (regular expressions), messy directory structure, and difficulty in getting development and business folks to write tests. Despite these shortcomings, Cucumber grows in popularity where Ruby is used.
On PyCon, Python community continues to grow with attendees doubling again this year. Topics are wide ranging from using Python for genome sequencing, client and server side success stories – Dropbox, web framework - Django and mobile applications testing - sounds familiar? :-) Most sessions I attended are deep dive into the code or extreme talks on performance improvements (using PyPy) and code profiling. There is a popular Testing BoF (birds of feathers) on testing and methodologies in the evenings, with lightning talks and general Q&A.
For more details, here are the links to the slides and videos -
Selenium sides - http://www.slideshare.net/search/slideshow?q=seconf+2011&sort=latest
PyCon videos - http://pycon.blip.tv/posts?view=archive&nsfw=dc
Subscribe via RSS