This is the multi-page printable view of this section. Click here to print.
Blog Posts - 2010
- Selenium 2.0 beta 1 Release
- Atoms have come to Selenium IDE
- A Smattering of Selenium #35
- Selenium Conference Survey
- A Smattering of Selenium #34
- A Smattering of Selenium #33
- A Smattering of Selenium #32
- A Smattering of Selenium #31
- A Smattering of Selenium #30
- Selenium 2.0a6 Released
- A Smattering of Selenium #29
- A Smattering of Selenium #28
- A Smattering of Selenium #27
- A Smattering of Selenium #26
- Going Atomic: How
- A Smattering of Selenium #25
- A Smattering of Selenium #24
- A Smattering of Selenium #23
- Going Atomic: Why?
- Selenium at Agile 2010
- Selenium 2.0 backend for running IDE test suite via the Se2 Firefox
- A Smattering of Selenium #22
- How to use Selenium 2 with Maven
- A Smattering of Selenium #21
- The Current Status of Selenium 1 and Selenium 2
- A Smattering of Selenium #20
- GSoC 2010 – Remote Storage
- Selenium 2.0a5 Released
- A Smattering of Selenium #19
- Selenium IDE – Looking back and looking forward
- A Smattering of Selenium #18
- A Smattering of Selenium #17
- A Smattering of Selenium #16
- Selenium Grid 1.0.8 Released
- Selenium IDE 1.0.7 – Now with Drag-and-Drop!
- Selenium Grid 1.0.7 Released
- The Future of Selenium Grid
- Selenium 2.0a3 Released
- Selenium Grid 1.0.6 Released
- Selenium 1.0.3 Released
- Selenium 1.0.2 Released: Firefox 3.6 and Snow Leopard Support
- Welcome to the official Selenium blog!
Selenium 2.0 beta 1 Release
We recently released the first of the betas for Selenium 2. It’s available for Java, C# and Ruby. If you’ve been holding off trying Selenium 2 because of the alpha label, then the biggest improvement you’ll see is with the new WebDriver APIs, but there’s a lot more!
- A promise of relatively stable APIs
- For Firefox only right now, an API for dealing with alerts, prompts and confirms.
- A brand new IE driver.
- Better selenium emulation when using webdriver
- And a better implementation of webdriver’s API backed by the traditional Selenium technology.
- Ubiquitous use of Sizzle for emulating CSS selectors where native CSS selectors aren’t supported
- The advanced user interactions API
- An update to the AndroidDriver’s Android app.
Of course, we’d love this release to be completely bug free, but this is, after all, a beta, so there are some known issues:
- The selenium 1.x emulation using IE is a little flaky.
- The ChromeDriver is not as capable as the others.
- Anything in our bug list.
You can download it from here:
http://code.google.com/p/selenium/downloads/list
You can read the javadocs and the ruby docs.
An obvious question is “When will the beta end?” The short answer is when we’ve implemented the alerts and prompts and advanced user interactions APIs in all supported browsers. We expect there to be some flex in some APIs (removing deprecated methods, and within the advanced user interactions API) but what you have here is basically what you’re going to get when we hit 2.0 final. I have no idea how long this will take, but if you’re interested in helping out, let us know!
Thanks are due to all the committers who have worked so hard to get this code into shape. Thanks are also due to all the people who have taken the time to file bugs, ask for features and participated on the mailing lists. Thank you to you too, for going out and trying this new beta of Selenium 2.
You rock. 🙂
Atoms have come to Selenium IDE
As mentioned in Simon’s Going Atomic: Why? and Going Atomic: How, part of the merging of Selenium and WebDriver is to share common code between the two. And as of the 1.0.10 release of Selenium IDE, this merged code, ‘atoms’ is now included.
Some early users of this release are noticing that this the atom that drives assertAttribute and verifyAttribute is causing their scripts to break. This post explains the ‘why’ and suggests how to fix them as well.
The HTML spec has the notion of a boolean attribute which is one that does something just by being there rather than by its value; checked and selected are two such examples of this. Optionally, you could give these boolean attributes a value that is the same as their name (checked=”checked”) and your page would still validate, but really, the browsers only care that the attribute exist.
Prior to 1.0.10, it was not uncommon for people to do something like
assertAttribute | checkbox@checked | checked
which fetches the value of the checked attribute on the checkbox with the id or name of checkbox and fails the script is the value is not checked.
In 1.0.10 though, that will fail even if it is checked. This is because checked is a boolean attribute and will now return either true or throw an exception saying the attribute doesn’t exist. Redoing the above step check that the boolean attribute is set results in:
assertAttribute | checkbox@checked | true
Thankfully, most of the real-world interaction with boolean attributes is focused on checked, disabled, hidden and selected and in these cases using assertAttribute is not really the right thing to do. Instead, the Selenium API provides wrappers for you to use.
checked | assertChecked(locator), assertNotChecked(locator), verifyChecked(locator), verifyNotChecked(locator) |
disabled | assertEditable(locator), assertNotEditable(locator), verifyEditable(locator), verifyNotEditable(locator) |
hidden | assertVisible(locator), assertNotVisible(locator), verifyVisible(locator), verifyNotVisible(locator) |
selected | assertSelected*(locator, pattern), assertNotSelected*(locator, pattern), verifySelected*(locator, pattern), verifyNotSelected*(locator, pattern) |
Checking for the absence of a boolean attribute that doesn’t have a nice wrapper is a bit of a pain though. In this example I am checking that the boolean attribute multiple is not on the select element with the name elephants.
assertEval | this.browserbot.findElement("css=select[name=elephants]").getAttribute("multiple"); | null
If you find yourself doing this very often, I suggest you wrap it up in a user-extension inside a plugin as something like
assertBooleanAttribute | css=select[name=elephants]@multiple | false
assertBooleanAttribute | css=select[name=elephants]@multiple | true
Hopefully this addresses some of the eventual ‘why the heck did my script break!?!?!’ problems that will no double crop up once Selenium IDE 1.0.10 gets wider distribution.
A Smattering of Selenium #35
(If I wasn’t still recovering from a cold there would be something witty here.)
- We’ll start this week with a cartoon
- So I know I have linked to playing pacman with se 2, but here is a site that explains the ghost behavior. If Google implemented the algorithms properly-ish, then this should be the ticket to crazy high scores. There should be a contest for this…
- Cucumber + Cuke4Duke + Selenium (WebDriver) = Enlightenment is step-by-step instructions for using maven to wire all these things together.
- shell in a box means you can now use Se to automate a unix shell
- How test automation with Selenium or Watir can fail provides two code smells for automation
- UI test smells: if() and for() and files is a bit of a rebuttal with some additional commentary
- Surviving end-to-end-testing… or, using Selenium for fun and profit is a write-up of the XP Day session of the same name
- The first thing that really became obvious to is that the community has to stop thinking about the tools and step back to look at a wider picture of the processes that have evolved over the last decade. Tools are there to assist us with a process, so focusing on tools and not on the process is just causing problems in adoption for new teams. is from Gojko’s article in the December 2010 issue of The Tester. And is extremely important to remember given that this is a tool focused blog
- Missed Øredev? Watch the videos!
- A post from Sauce Labs shows how to put messages in your script runs. Crazy enough, I did something similar.
Selenium Conference Survey
Great news! Thanks to the initiative of our friends at Sauce Labs, we’re finally ready to host the first-ever Selenium Conference. We’re still working out a lot of the details, but so far we’ve decided this first conference will be sometime in April and hosted in San Francisco.
In order to figure out the rest of the details, we’re looking for feedback from the Selenium user community. Please take a moment to fill out the following survey. Your answers will help us properly plan the best possible conference.
Thanks!
A Smattering of Selenium #34
We’ll start this week with the official announcement of ‘Selenium 1.0 Testing Tools: Beginner’s Guide’ being available. Congrats David! (Still waiting for my copy…)
- There is now a DZone ‘refcard’ for Selenium 2. Of course, the reason Se2 is alpha is the API isn’t done with at least one major addition still left so it will be out of date in a month, but still…
- Here is another example of how to do Page Objects in Python
- Client-Side Profiling with Selenium 2 is David’s post about his recent London Selenium User Group talk
- Someone took the time to make a Selenium lens on Squidoo; which is going to get kinda circular once this post shows up on it.
- Why Automated Testing is Broken. Not much of a commentary here other than A-freaking-men. Ok, that was commentary.
- Selenium Toolkit for .NET got a version bump for the first time in a year.
- Driving a Flex Application via Selenium 2 WebDriver shows how to use FlexSelenium and Web Driver together
- RVM is one of the ‘cool kid’ tricks and Continuous Integration with Hudson is one of those things you need to know how to do if you are using it.
- Vagrant appears to take RVM one (or more) steps further
- I keep thinking someone needs to create a Selenium koans site. Inspired by javascript koans and ruby koans
- Launchlist appeals to me somehow. Throw in an API for launching scripts and you have a nice TCM system
- I spent some time figuring out how to integrate Robot Framework with Sauce Labs OnDemand and then wrote about it
- Web Driver for the BlackBerry – did not know that even existed.
- gocept.selenium is another Zope 2/Plone/ZTK integration
- BDD, ATDD and Page Objects was a talk done at SkillsMatter which was recorded
Oh. and I just noticed that this is the Selenium-iversay edition of these things.
A Smattering of Selenium #33
…and here’s the links!
- Henrik Skupin was one of the speakers at the London Selenium Meetup and has written about the night and his talk
- Speaking of which, videos of the talks are now up
- Part of good automation is knowing how to code. So here are some sites that crossed my path this week for that
- Cheezy continues his UI series which takes a detour over to WATIR land, but things are transferable. Introducing a Simple DSL and Default Data
- Functional Automation is an important part of Continuous Delivery. Here is Jez talking about Continuous Delivery — beer in hand. (which to me is the most important concept of the year)
- Acceptance Test-Driven Development with Robot Framework is an excerpt from Practices for Scaling Lean & Agile Development.
- BidiChecker is a tool for checking bidirectional (BiDi) text. So who is going to integrate this into Se?
- Interaction with Flash using FlashSelenium and Javascript – Part 1 starts to show how to use FlashSelenium to interact with Flash-y things.
- Looking for a Selenium job? Have a look at How to get a Rails job. When I have hired, or help people hire, this is very true.
- And finally the whole should-testers-need-to-know-how-to-code conflict bubbled up again somewhat last week. Since this is my list of links: if you are automating, yes; if you are not, then no (but it can’t hurt).
A Smattering of Selenium #32
For those people paying attention to the goings-on in the Selenium world, yes, I am skipping something major until some of the details are worked out and announced. Until then, here are the links I accrued over the week.
- Selenium uses Bamboo for its CI infrastructure. This week saw an upgrade to the latest version so if you want bleeding-edge code, get it here
- The only browser Se has no real traction on right now is the BlackBerry one. But if someone wanted to tackle it, here is a post from Atomic Object on their BlackBerry development environment that would help kickstart things maybe.
- Under the category of ‘let the language deal with things’ is html5lib for python and php which will parse html. Sometimes it is far faster to dump your attribute checks etc. to a native parser than let Se do it.
- Scott Sims has released Selenium Fury upon the Ruby world. Think of it as a Page Factory implementation for Ruby.
- Using Se-IDE and Easyb? Here is a thread on how to use the generated code without modification
- JRuby is one of the better languages to use to write Se scripts in, and here are videos from JRubyConf 2010
- Cheezy is writing a series on UI tests. So far there is How do we keep them from being brittle? and Part Two
- Se2 for JS? Sure, why not. webdriver-js
- Jari release the selenium-webdriver 0.1.0 gem this week. Why the big jump from 0.0.29 to 0.1.0? We’ve merged in the selenium-client gem into the main selenium codebase and now there is a single gem if you want to do 1.x or 2.x scripting.
- Google Refine is just darn cool. I’m not really sure how it plays into automation, but I get the sneaky suspicion it could. Somehow.
- The YUI Test has Se built right in.
A Smattering of Selenium #31
The big news for last week was that I released Se-IDE 1.0.8 to very little fanfare. 1.0.9 should be a week or two and much more important a release.
- Cheesecake! is isn’t nearly as impractical as Pacman, but still adds to the Se2 example bucket.
- The London Se Meetup stuff from last week are starting to appear…
- Some notes from CITCON last week as well. Seems like London was the place to be.
- When designing automation frameworks (internal or external), the list of ways to make it hard to misuse should be kept in the back of your mind.
- Of course your automation is under version control, right? RIGHT?!? What the Commit is rather amusing, if not a scathing satire. (hint: hit refresh)
- Sauce Labs announced the availability of a CI API. But there is nothing to say that you couldn’t integrate their alternative annotation methods outside of CI too.
- Harry Robinson did a session at CAST 2010 on ‘Exploratory Test Automation’ (which I missed; no, not bitter at all..) and I found his slides
- If you are using the hosted Bamboo solution and most of your Se tests need windows, then here are instructions on how to create your own custom elastic agent image
- Here is something fun, do you Hate or Love Se?
- Slate seems like an interesting module for Python folks since it can parse and extract information from PDFs which is often a black hole in automation.
- I continue to maintain that automation is programming (much to the annoyance of the classical black-box tester who is starting out with it) and that perhaps the easiest language to start learning is Python. Learn Python The Hard Way is a new book which looks like an ideal way to learn the language. I haven’t really gone through it to see which parts are more (or less) relevant to automation, but…
- You’re cuking it wrong has lots of tips on how to write Cucumber scripts well.
A Smattering of Selenium #30
I’ve missed a couple weeks due to travel and a complete system lock which meant I lost all the links I had open but not saved. So these are the ones I have recovered.
- I have written a series of posts on how to do parallel execution of tests in JUnit 4 up on the Sauce Labs blog. Part One, Part 2 and Part Three
- Quick start with FitNesse and Selenium is a beginners guide to wiring Selenium and FitNesse together. Though it might have been easier to just use Selenesse
- Meetup: Test Automation Tips, Techniques and Best Practice – Ruby and Java night in NYC, November 8
- Commit 10000 for the Se project. That’s a non-small number
- If you are using Maven 3, you can now use the Selenium Plugin with it now.
- Do Testers Have to Write Code? applies to Se as well.
- Multiple Sessions in Cucumber & Selenium got a fair bit of twitter love and is something I’m seeing clients want/need more and more
- A Set of Principles for Automated Testing is not a bad list. I completely disagree with the second one, and the last one is blatant employer promotion (but is contextually correct).
- RSpec best practices is a similar list which I have less complaint about. The third point is likely the most important one.
- Multiple Sessions in Cucumber & Selenium is a solution for when you are testing something with WebSockets with Cucumber.
- NUnit 2.5.8 is out.
- Dale Emery has released Runtime Suite which is super handy for creating test suites at runtime with JUnit 4. It doesn’t (yet) work with parameterized classes, but is still pretty cool
- Feed4JUnit seems to have don’t some of the legwork for people to do parameterized JUnit scripts. (Yes, I’ve been stuck in Java-land for the last while; why do you ask?)
- As Flex Pilot gets more usage, things are starting to trickle out into the blogs. Automating MyAppInFlex.swf – Useful FlexPilot commands is one of those posts.
Oh, and both 2.0a6 and 2.0a7 have been released. We’re getting closer to the ‘API freeze’ which will mark the end of ‘alpha’ and the start of bug fixing (beta) for the final release.
Selenium 2.0a6 Released
We are extremely pleased to announce the release of Selenium 2.0a6! Head over to the downloads page to get it while it’s hot, or wait just a little bit longer for it to appear in a maven repo near you. The .Net version will also be updated soon too, and the python and ruby libraries have been having smaller, more frequent releases all this time.
You’ll be pleased to hear that the Selenium 1.0 APIs have remained constant, so what’s changed? Here, in no particular order are the major changes you’ll find in 2.0a6:
- Android support: you can now download the APK and run webdriver tests using Android 1.6 to 2.2.
- Firefox 4 support.
- Experimental IE9 support
- New APIs for dealing with HTML5 elements (best implemented, for now, by the mobile webdrivers)
- A richer .Net API
- A move to Sizzle for locating elements using CSS in browsers that don’t have a native API for that.
- Far better support for running your existing Selenium RC tests using WebDriver, helping you make a managed migration to the newer APIs.
There are also lots of nice touches for the more technically inclined, including the ability to re-use instances of FirefoxProfiles, better configurability when requesting a remote webdriver instance, better resource management and more shared code between the Selenium and WebDriver implementations.
Thank you to everyone who has taken the time to report a bug on our issue tracker, or raised problems on one of our mailing lists, or shown up for some of the banter on the IRC channel: without your involvement, the project wouldn’t be half as much fun, and wouldn’t be as capable as it is. Thanks are also due to the development team, who have poured an enormous amount of work into this release (538 revisions in under 90 days, or about 6 check-ins each and every day)
Hope you like it!
A Smattering of Selenium #29
A fair number of links this week. The vast majority of which were buried in annoying airport internet advertising frames…
- This looks like it is Spanish which would normally mean it doesn’t get included but it Integração Selenium e Testlink explains how to integrate Se with TestLink. We, as a community, need to document this sort of thing more.
- JUnit 4 Vs TestNG is a somewhat biased comparison between JUnit 4 and TestNG; but useful none the less.
- Hot on the heels of last week’s SFSE is the announcment of Learn to Test Your SproutCore Apps with Lebowski Framework for the month of October.
- Behaviour Driven Development With JBehave Web 3, Selenium and Maven 2 on OS X Snow Leopard is, aside from very buzzword compliant, the first thing I’ve seen using Se and JBehave.
- Bi-Testual: Coming out of the Software Closet is something a lot of people in automation grapple with. Am I a tester who programs? A programmer who tests? Something entirely new?
- Using Selenese and want to use Sauce OnDemand? Absolute Beginners Guide to Running Sauce RC with HTML Scripts is for you.
- While combing the Sauce Labs blog, I noticed my How To Minimize The Pain Of Locator Breakage has been published.
- Page Objects are ‘in’ to say the least these days. Writing page based tests with selenium in ruby is just enough to get you down the path of page objects in ruby.
- And because we can’t have only one post on Page Objects, Step-by-step selenium tests with page objects, dsl and fun! is in Groovy
- Cheatsheet: Creating mocks in PHPUnit could be useful for those who write Se scripts in PHP
- The talks for GTAC 2010 have been announced. I don’t know what the pool of talks they pulled from was like, but I’m underwhelmed
- I have no idea where SeleniumWiki came from, but there is a fair bit of content there. Not sure how much is original and how much is lifted from other places on the internets — the spidey sense tingles when the title says ‘VB Code’ which seems to imply it is an SEO hunting site.
- Martin Fowler’s DSL book is out Real Soon Now and the first chapter is available online. Most people have been saying ‘build a DSL for your scripts’ for awhile — now we’ll see just how off all our definitions of that were.
- getXpathCount is one of the more powerful commands in Se, but the bulk of people use it ‘wrong’. Effectively using Selenium’s getXpathCount function starts to address that problem.
A Smattering of Selenium #28
So we go from not-enough-stuff-to-do-one to wow-this-will-take-awhile. And we’re off..
- Tellurium is one of the many frameworks that absorb Se and has an article on InfoQ called Introducing the Tellurium Automated Testing Framework which, well, introduces the framework.
- In the first of many Cucumber related posts this week is Sean Grove’s Cucumber Sauce for doing parallel Cucumber runs on the Sauce infrastructure. Might be general enough to use outside of it as well.
- Cuke4Ninja: The Secret Ninja Cucumber Scrolls, aside from outstanding ninja cucumber images, has a dead-tree book’s work of getting starting with Cucumber information.
- I updated the list of plugins for Se-IDE (that I know of) on the Se-HQ download page
- Arquillian is testing framework, developed at JBoss.org, that empowers developers to write integration tests for business objects that are executed inside of an embedded or remote container–options include a servlet container, a Java EE application server or a Java SE CDI environment. Oh, and it has a Selenium (1.x RC and 2.x Se WebDriver) extensions
- The Fall 2010 issue of Methods & Tools has an article on Bromine
- Another piece of Cucumber news is a Skills Matter video of Gojko Adzic and David de Florinier (see Cuke4Ninja able) talking about Cucumber & Selenium 2.0
- If you are doing automation, the right place to be running it is not the IDE but a CI server. Well, perhaps in addition to the IDE… Anyways, here is a post on Setting up a python CI server with Hudson. Now there is no excuse Python kids…
- Parallel Testing should be this year’s automation theme. Here is how to do it in C#.
- …and in PHP (this one, again with a bent to Sauce OnDemand, but…)
- And yet another PHP Sauce integration.
- Selenate is a JS 1.6 runner for Se
- Actionscript Javascript Communication actually shows how the whole ExternalInterface stuff works when talking into Flash/Flex from within Se. I could have used this a year ago…
- Aside from parallel stuff, I think the Decorators and their kin are nice additions to the automation toolkit. Here is one for taking screenshots on test failure in Python
- London is having another meetup on November 3
- The fall 2010 issue of Automated Software Testing Magazine is out. I think its kinda sad that articles on dynamic data generation still need to be written, but the ‘Testing With Reflection’ article seems to be not bad in that the message is ‘automate to learn, not to test’
A Smattering of Selenium #27
Seems I skipped a week, but that’s okay since there hasn’t been much in terms of volume (or maybe my clever search filter is a bit overly clever…).
- The big news I think is that there is now a Se driver for Node.js called Soda. I’m not sure I like the syntax, but I also don’t claim to know Node so it could be idiomatically correct which is more important than my blessing.
- Hot on the heels of the Soda announcement was the announcement that it has built-in support for Sauce Labs’ OnDemand Se-in-the-cloud service
- TestNG is often the java runner of choice for Se (for its built-in parallelization stuff) and it now has a Selenium page right in the official documentation.
- Drupal sites have long used Se to automate maintenance tasks and such, but now there is Drunit which hopes to replace SimpleTest as the way to use PHPUnit and Se-RC in the Drupal community.
- The August SFSE meetup was more of a crowd-sourced content affair with participants voting up questions that they wanted to hear Se inventor Jason Huggins answer. It then turned into a crowd-sourced answer affair with Simon Stewart (Se-WebDriver), Kevin Menard (Se-Grid) and myself (Se-IDE and general opinionated tester) getting dragged in periodically. The video is now online for your viewing enjoyment.
- I’ll be writing about this more this week I’m sure, but Tracking Selenium Commands Using C# and SQL Server 2008 has actually made me rethink my position on what reporting should be coming out of your automation run. No mean feat that.
- Three Keys to Automation is an old article from Bret Pettichord (he of WATIR fame) that somehow crossed my path this week but is as relevant today as it was 10 years ago
- SMW System Testing with Selenium is a wiki page (unsurprisingly) about testing the Semantic MediaWiki with Se including slides from a talk on it. Good to see the world domination plans of becoming the default testing framework on projects progressing so nicely.
- Testers, Orgs, and the demand for Java jobs nicely echos what I say when I am out at clients who are starting out with Se (or automation in general) – Testers don’t need to know how to write the code for your product, but they need to know how to best automate their tools and tests which will require understanding and comfort with code.. Also just as important from a product perspective is Let’s get rid of the titles of ‘developer’ and ‘tester.’.
- Not related to Se directly is Dancer which is the Perl equivalent of Ruby On Rails. If you need a quick site for proof-of-concept or experimentation with Se, this might be the framework for you.
- For the PHP readers, I present a discussion on integrating Se with Behat
A Smattering of Selenium #26
It’s Labour Day here, so this post was written to backdrop of Sponge Bob. In case you were wondering.
- selenium-java-evidence appears to be another logging framework, this time with an emphasis on auditability. Personally, the reports from a CI server should be all that are required, but to each their own…
- taza is an opinionated browser-based test framework
- webdry is a Python (jquery-inspired) wrapper for DRY:er access to the Selenium WebDriver
- Self-testing AppEngine apps with Saucelabs seems like a cool little (if very low level) trick to using Se inside AppEngine
- Sauce Labs released their Getting Started With Selenium guide and is looking for feedback on it
- Need to interact with a web service during a BrowserMob run? Hybrid BrowserMob Scripts explains how to do it.
- Self-Verifying Page Objects is Patrick Wilson-Welsh’s first post in the series patterns that made up his and Dawn‘s Agile 2010 session.
- Felipe is starting to explore Se and TestNG (which is timely for me) starting with Using TestNG to launch your tests (and the Selenium server)
- Hudson create Kohsuke Kawaguchi did a webinar for Sauce Labs on using Hudson with their OnDemand service that was recorded. I haven’t watched it yet, but it looks like it has general Hudson and Se information as well.
- Se’s CSS support got and overhaul this week as Sizzle replaces CSSQuery as the way of finding things via the CSS locator. Sizzle is the CSS engine that powers JQuery.
- JBehave 3.0 has been released – for those who use it
- Simon wrote another technical piece on some of the inner workings for Se2 in Going Atomic: How
Going Atomic: How
This is the second of my technical posts. Again, if you’re interested in the internal workings of Selenium 2, then please skip straight to something else. If you’re interested in how and why we made some of the technical decisions on the project, keep reading….
We left our intrepid heroes in a tight spot: they’d decided to write a shared library of code, to be used by the various webdriver implementations and selenium core, but the requirements for doing this seemed to be at odds with it actually happening.
Fortunately, at about the same time we started down this path, Google Open Sourced the Closure compiler. This is a Javascript compiler that takes as input a set of Javascript files, and which outputs Javascript. It can be configured to either pass the code through untouched into a single file, or it can compile a script aggressively, removing unused code-paths and minifying the output as much as possible. The Closure compiler is used on a lot of Google products, so we know that it’s reliable and consistent.
In order to get the best out of the Closure compiler, we’re writing the atoms using the Closure library. This isn’t as well known as some of the other JS libraries out there, but it’s solid, well tested and is being actively developed. It also features an easy-to-use extension of JsUnit, which makes writing tests a far simpler task than might otherwise be the case, and it has an easy to use mechanism for modularizing code.
So, given that we could compile a single Javascript function (and it’s dependencies) into a minified fragment of JS, we were all set, right? Not quite.
The problem is that the atoms are being extracted from two frameworks that have a different way of viewing the world. As an example, Selenium 1’s “getAttribute” method only returns the value of a particular attribute, whereas WebDriver’s “getAttribute” method will return the value of either a property or an attribute (because sometimes it’s hard to remember whether something is an attribute or a property of an element)
As with all problems in computer science, an extra level of indirection is used to solve this issue.
We’re busy implementing the expected behaviour of both WebDriver’s and Selenium’s API on top of the atoms.
There is, of course, the obvious question about how we get this carefully compressed JS into a driver. One option would be to include the raw Javascript as files in each language binding, and pull them in as required. That’s possible, but it would make each language binding bloated, and would introduce a lot of duplication. The alternative is to push the atoms as far into the driver as possible, and this is what we do. As part of the build process for webdriver, we take the compressed JS and convert it into a form that can be consumed by a particular driver. For example, for the IE driver, we convert them into constants in a C header file. These constants can then be referred to by the driver and converted back into a script than be executed via the same mechanism that is used by “executeScript”.
What do we gain from this seemingly baroque approach? Other than the ability to share the same code between drivers? Many things. The cost of maintenance drops dramatically as we can fix a bug in one place and have that fix be picked up by every driver. Because we’re working in pure JS and just querying the DOM, we can run the unit tests in a browser whilst we’re developing the code. This leads to a very tight feedback cycle. It also makes it easier for developers not familiar with the code to take a look at how we do things, and send us patches (always appreciated!) Finally, we can ensure a consistency of result.
Right, any questions?
A Smattering of Selenium #25
A day late, but that sort of thing happens when you have family.
- I keep telling myself I will document how to incorporate Se launching and result recording in QC, but never seem to find the excuse. Looks like Aaron found the excuse: Finding the API for a DLL, Connecting to HP/Mercury Quality Center from a client side script
- Also from Aaron is a cool Credit Card Generator which has nice id tags which makes for easy Se parsing. Though I would argue that rather than open a new browser for this you send a URL get or similar, but this works as well.
- David continues to post about his employer’s ‘Elastic Build System’ in the context of Se-Grid in Nimble Test Clusters
- Having had, and then mutually cancelling a book deal on Se, its a delight to see Overview of Selenium 1.0 Testing Tools: Beginner’s Guide now available in ‘beta’. Guess you need to finish it now, eh David?
- easy setup for your cucumber scenarios using headless gem run selenium your ci server is in the context of cucumber, but could be easily ported to other things I suspect.
- Another I-switch-to-Se2-and-liked-it post, this time from Ben at Switching from Selenium 1.x to WebDriver/Selenium 2 and HtmlUnit
- howfuckedismydatabase is just plain funny. And who of us hasn’t asked that very question – usually at some less than optimal time
- The September gathering of Chicago ALT.NET is on September 8 and is going to be on Selenium 101.3: Practical Functional Testing Techniques
- Testing Flash With Selenium talks about the standard ExternalInterface stuff, but most important is the last sentence: So, if your app has less functions that needs to tested, you can use this approach, if not, testing manually will be the better option.. Just because you can, doesn’t mean you should (more insight into the life of Selenium consultant…)
- Another framework! This time it is Selena.
- An over-the-should problem-solution post on getting started with Se – FMK vs Selenium. Worth also checking out the ‘Modeling Portfolio’ for the, erm, interesting hairstyles he has tried on himself
- Seems like Yeti and Se should work well together, though I can’t quite figure out why/how. And for those with small kids, the Yeti Stomp might also be familiar.
A Smattering of Selenium #24
A bit late, but I’m in California for a Selenium Developers Meetup and my body doesn’t quite know where it is temporally.
- Don’t forget that tomorrow is the next meeting of the San Francisco Selenium folks which seems to be running a crowd sourced “Let’s stump Jason with our problems” session. Most of the ‘main’ Se folk will be there.
- Test design theory is something that I have yet to really see covered much, so here are three articles on the similar idea of what to test and what to skip.
- Contradiction: Test Everything, but not Accessors? by Ron Jeffries
- don’t test for blocking conditions: an example by Chris McMahon
- Every automated test should do ONE thing really well by Adam Goucher (me)
- Another simple build radiator is just a darn cool re-skinning of Hudson which, while not as fun, is super useful in communicating build status
- Simon started to explain some of the work going on in the guts of Selenium WebDriver in Going Atomic: Why?
- For those people who loiter in the #selenium irc channel, you have likely seen ‘selbot’ in action. If you wondered where it came from you can read the details from Sauce Labs in Introducing selbot
- Atlassian is a pretty big user of Se and has a post called push my buttons which explains the myriad of ways you can send a key in Se 1.x. Which IIRC is one of the major improvements that Se 2 provides.
- The march of Flex Pilot continues and so the blog posts from users are starting to appear including Selenium Testing with Flex Pilot
- I was pleading for help on twitter last week and this cool use of the JUnit 4 @Rule annotation to get screenshots on test failures was provided
- If you are using CruiseControl.NET then Integrating Selenium Tests into CruiseControl.Net via NUnit is likely going to deliver value
- Silverlight UI testing with Selenium and Ruby is the first article I think I have seen on the subject. Of course, my memory isn’t so hot at time…
A Smattering of Selenium #23
I was at Agile 2010 in Orlando last week so missed doing the Smattering, so here is two weeks worth of links.
- There is crazy amounts of power hiding in that there JUnit 4 library – such as @Rule. One usage of them is described here. A useful pattern indeed when doing something like BDD or ATDD
- The next SFSE has been announced; August 24 at LinkedIn. Se creator Jason Huggins will be fielding questions in a Q&A session on steroids.
- While on topic of meetups, Dawn will be presenting about Selenesse at Agile Carolinas also on the 24th
- iCheckWebsite is an accessibility monitoring site which is a niche that I haven’t seen exploited yet. What is interesting is their checklist of what they check for. Looks like a great start for a suite of Se tests.
- Se plays a large part in Continuous Deployment setups, but what I am really interested in is Continuous Delivery. Jez (who literally wrote the book on it) explains the difference between the two.
- One of the better sessions I went to at Agile last week was Mountains to Molehills: A Story of QA that featured some Se content so gets included here.
- Setting up flex testing with selenium – with Selenium Flex API and FlashSelenium
- Selenium 2/Web Driver – the land where Page Objects are king! is the winner of the ‘most twitter love for the last two weeks’ award.
- Samit continues to churn out plugins for Se-IDE, this time with the Log Search Bar Plugin
- The Bromine kids have released a bit of a case study on the Roskilde Festival and CI in Continuous integration of the orange feeling
- Ooo! A completely useless tool competition! – Vote Selenium!
- Web Automation Framework claims to integrate Selenium, TestNG, ReportNG, SimpleXML, Java, Sikuli, Flash-selenium — which is an interesting fruit salad as it lists apples, oranges, bananas and pears when comparing things.
- I hate to pimp my own stuff, but Six Shocking Automation Truths did fairly well from page view perspective. It even spawned a well thought out response/reaction.
- Again, sorry to have my stuff in here, but if you are wondering what Page Objects are (and how to implement them in Python) then my article Page Objects in Python from the August issue of PragPub is what you need.
- Managing Se-Grid machines is a pain (which is why you have companies like Sauce Labs coming into the fray. Another option is to use Copper from GridCentric to have Elastic Build Systems
- One of the Se 2a6 new features was the Web Timings API which David experiments with in Automating the Capture of Web Timings with Selenium 2
- Parallelism is kinda (but not really) solved by Se-Grid, but when you start specing out machines, do you need more threads or cores – and do you know the difference?
- Robot Framework is growing Flash/Flex support; the status of which can be see in this email from the flex-pilot mailing list
Going Atomic: Why?
This is the first in a series of technical posts by me about the internals of Selenium WebDriver. If you’re not interested in technical nitty-gritty, then feel free to step away now.
Still here? Excellent.
Let’s take a step back to just before the Selenium and WebDriver projects merged. There were, very obviously, two separate codebases. Looking closer and with a slightly different perspective, there were more than this. We used the test suites for webdriver to define the behaviour for multiple, largely independent, driver codebases. The IE driver was written in C, the HtmlUnit driver in Java and the Firefox driver is largely Javascript, and so on.
This means that there was a lot of “congruent code”: code that performed the same function but was implemented in a different way. The natural result of this was there was the possibility for behaviour to diverge between drivers. Worse, it meant that when a bug was found, we had to check it in every browser, and it wasn’t certain that an individual could actually fix the code. After all, not everyone is comfortable writing in all the languages we use on the project, or is au fait with all the technologies. For an Open Source project like Selenium, this is a major problem: we rely on a relatively small core of key developers backed up with a far larger team of individuals submitting small changes and fixes. Anything that makes it harder for us to function effectively as a development community is a Bad Thing.
So, we wanted a way off the island; a mechanism that would make it easy to share code between the various drivers and selenium core, that allowed us to fix a bug in one place only and have that fix ripple out to every driver that made use of this mechanism. More importantly, it had to be easy to use, and for someone not familiar with a raft of languages and technologies to quickly get started with.
What would this mechanism look like? Well, there’s a few things that feed into this, but the most important one, was that a majority of the code we’d think of merging was querying the state of the browser (“find an element”, “get the value of this attribute”) and, as Jason Huggins would point out to me at the drop of a hat, the natural language for querying the state of a browser is Javascript. One of the nice things with Javascript is that it’s possible to get a nice, fast development cycle going in it. Just modify a test, save and then hit “refresh” in the browser. That’s kind of attractive. Better still, there are a lot of developers familiar with Javascript.
So, we decided to use Javascript.
Because this shared code was to be composed of the smallest useful fragments of functionality required for browser automation we decided to refer to them as “Browser Automation Atoms”, or “atoms” for short. Rather than write them from scratch, the easiest thing to do was to extract them from the existing code — this is stuff that’s been battle-tested, so we know it’s robust.
There was one very obvious fly in the ointment: not every driver is written in Javascript. Although we have a mechanism available in every browser for executing JS, it’s wildly inefficient to dump an enormous lump of code on to the JS engine of the browser whenever you want to query the DOM. After all, most of the code would not be needed, and not all JS engines have been created equal. Some are blazingly fast. Others, not so much.
It would also be nice to break the code up into manageably-sized modules, rather than being in a single, monolithic file, which implies some clever “module loading” capability. Except this code isn’t always going to be executing inside an environment where writing “script” tags to load additional scripts is possible. You can’t do that in the guts of a firefox extension, though you can load files other ways. However we tie modules together will need to cope with that.
Ah! These opposing requirements: small modules containing the functions we want to use, no extraneous code, and for everything to be in a single file in order to minimize the pain of loading additional modules. That doesn’t sound like a very compatible list. How we resolved those differences is the topic of my next post….
Selenium at Agile 2010
The Selenium project does not have an ‘official’ presence here at Agile as it is seen as a ‘test after’ tool rather than ‘test first’ — even though it provides the magic of the ‘test first’ frameworks… But there is a small, unofficial contingent of recognizable faces around that can help people out and some sessions on it.
Sessions
Why your selenium tests are so dang brittle, and what to do about it – Wednesday, August 11 – 3:30 – 5:00
If you are writing automated through-the-GUI tests for a web application, you are in danger of creating tests that are more expensive to maintain than they are worth. With well-factored Selenium RC tests running in Junit or TestNG, you can keep your abstraction layers or “Lingos” — small bounded bits of slang for discrete parts of the object model — separate, thereby reducing the maintenance costs of your tests, and improving your sanity. Prerequisites include experience with Java or C#, and ideally some *basic* OOD familiarity (inheritance, composition, encapsulation, polymorphism).
Selenium Open Jam – Tuesday, August 10 – 11 – 12
Bring your questions or problems or complaints. We’ll try to ease / solve them.
People
- Dawn Cannan – author of Confessions of a Passionate Tester and maintainer of the .NET version of Selenesse which is a bridge between Selenium and Fitnesse.
- Adam Goucher (me) – maintainer of Selenium IDE and Selenium focused consultant
- Jason Huggins – creator of Selenium and co-founder of Sauce Labs (Selenium in the cloud)
- Patrick Wilson-Welsh – Agile coach and Selenium power user
If you are not succeeding with Selenium, come track down one of us. We might redirect you somewhere else, but eventually we’ll get you sorted out.
Selenium 2.0 backend for running IDE test suite via the Se2 Firefox
The GSoC 2010, it’s a great adventure.
I’m Raynatou, I come from Burkina and do my internship at SERLI. Like all interns in this company the topic of my internship focuses on advanced topics like the integration of WebDriver as backend for Selenium IDE. Selenium IDE is currently built upon Selenium Core for interacting with web pages. Selenium Core has several major limitations, including the inability to fire native events. To avoid these limitations and produce more robust tests, I am investigating Selenium IDE to using WebDriver in place of Selenium Core.
I’m mentored by Eric Allen from SauceLabs, my lead mentor, and by Jérémy Hérault from SERLI, his second but not least ;).
Eric has already done most of this integration earlier this year. The goal of his work is mostly to show what’s possible with Selenium IDE and the Selenium 2.0 Firefox driver. It is based on an asynchronous communication between the Firefox WebDriver extension and Selenium IDE, Se-IDE waiting for that WebDriver says to him that the current command has been passed with success (or not) to call the next command of the current test case (use of callback function). The goal of my mission is to finalize this integration. However, Eric being a crazy man, and he has done it quickly and together we though to another way to do this merge.
Our new thinking is based on a synchronous communication between both of them. To do it, I get the FirefoxDriver instance and play with it like a normal object, by calling its methods. But the behaviour of FirefoxDriver isn’t as simple as I was thinking. JavaScript being a powerfull language (yes, it can make you shiver), I’ve had just to replace some objects (like Response object) and to use a Proxy (and a bit of IoC-like code) to simplify my life and the code to do. You can see my work on GitHub and follow it.
Currently, I think that more than 95% of the Selenium API commands are usable with WebDriver as backend in Selenium IDE. The process was basically to go through the seleniumemulation package and port all of the Java classes into JavaScript methods on the WebDriver class.
Now, I’m working on Unit tests to cover any of the 2.0 work I’ve done. I managed to get all of the Selenium Core tests to run through IDE. I’ve some refactorings to do to optimize the code and add more comments for a bigger comprehension of my work. I have almost finished.
I hope you enjoy what I’m doing and we hope (me and my mentors) that this work can be included in the wave of Selenium 2.
A Smattering of Selenium #22
Happy Simcoe Day. Only a handful of links this week to mention.
- Kevin relaunched Mogotest – see your website the way your users do.
- In a much earlier Smattering I think I linked to an announcement about a Se talk at Boston.rb. Well, here are the slides
- While not directly related to Se, the W3C has released their Unified Validator called, wait for it, Unicorn. So who is going to create the integration that magically sends pages to be validated there?
- ‘Ad Hoc Workflows’ appears to be a plugin for Confluence, and is a user of Se. They released a video last week of their tests in action. (Make sure to have you volume up for the great soundtrack)
- The exploration of Se 2 and Ruby gets even deeper with Adding automation to your Selenium 2.0 tests (Ruby) – oh, and RSpec and Rake.
- Michael guest posted on this blog on How to use Selenium 2 with Maven which was a bit of a mystery as we internally changed how thing work around Maven but forgot to really communicate that.
- Sauce Labs is having a webinar this Thursday on Cloud-Based Web Application Testing for Adobe Flex and Flash. Register now, etc.
- Selenium browser UnitTesting from TeamCity is full of XML and C# that I’m sure would make sense to people familiar to TeamCity
How to use Selenium 2 with Maven
There are several ways to use Selenium 2:
- If you don’t have Selenium 1.x legacy code, you might want to directly use on of the new WebDriver implemenations like ChromeDriver, HtmlUnitDriver, FirefoxDriver, or InternetExplorerDriver which provide a nice, small and easy to learn API.
- If you have Selenium 1.x legacy code, you can still use the well known DefaultSelenium class or the new WebDriverBackedSelenium, which extends DefaultSelenium but uses one of the WebDriver implementations internally.
Whichever option you prefer, if you have want to use Maven, all you need to do is add the following dependency to your pom.xml:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0a5</version>
</dependency>
If you know, that you will only use a certain WebDriver implementation, e.g. the FirefoxDriver, you don’t need to depend on the selenium artifact (which has dependencies to all WebDriver implementations as well as the support classes). Instead you can add the dependency to just the artifact you need, e.g.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.0a5</version>
</dependency>
When using a WebDriver implementation, there is no need to start a Selenium server – the browser will be directly started and remote controlled.
But if you are using DefaultSelenium (or the RemoteWebDriver implementation), you still need to start a Selenium server.
The best way is to download the standalone Selenium server jar and just use it.
Furthermore you can also embed the Selenium server into your own project, if you add the following dependency to your pom.xml:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.0a5</version>
</dependency>
Now you can create a SeleniumServer instance yourself and start it.
Be aware, that the selenium-server artifact has a dependency to the servlet-api-2.5 artifact, which you need to exclude, if your project will be run in a web application container.
Well, I hope that covers everything you need to know on how to use Selenium 2 with Maven.
Michael
A Smattering of Selenium #21
I thought it had been a slow week — until I looked at how many browser windows I had open. I wonder if that was why things were feeling a bit sluggish…
-
Some bits of history from Simon Stewart
- First announcement of Selenium (outside of Thoughtworks)
- First announcement of WebDriver (again, outside of Thoughtworks)
- The ‘merger’ announcement (aka Selenium 2)
-
More history lessons on Cloud Computing Show #35 where Jason recounts the origin of Se (and other stuff)
-
I still maintain that Continuous Deployment to production is near unethical, but a lot of the tricks that companies are using to support it are pretty cool. Continuous Deployment, Code Review and Pre-Tested Commits on Digg4 details some that Digg uses. Only cursory mention of Se, but once you have Se running inside a CI server of some sort, these thoughts become interesting-er.
-
The Kitchen Sink – why not all tests need automating has things like Just because we can automate a test doesn’t mean that we always should. As a consultant, I need to get this point across to clients all the time. Every. Single. Day.
-
At the risk of being too meta, there is now Selendion which looks like it drives Concordian with Se
-
Frank is billing itself as ‘Selenium for iOS’. Except that I believe Se2 already has support for that.
-
Moving on to the second example is part of a series of posts about exploration of Se2 using Ruby. This particular post is the ruby-fication of the second example of the WebDriver tutorial.
-
Debugging XPath and CSS locators with Selenium IDE originated with a question on the RobotFramework-Users mailing list and ended up being a screencast. We should do more of those.
-
Boomerang seems like a project that someone should write a tutorial on integrating with Se
-
Review: TDD Screencasts is a review of Kent Beck’s new TDD Screencast series (I really should buy this). While yes, we typically don’t do TDD using Se for speed reasons, this paragraph resonated and since I do the list, I’m including it.
A great message I got from the screencasts is that your tests should tell a story. You compose that narrative in steps, so as to not trip yourself up. Many times you are probably required to develop against a backend service or directly with a database. So that’s how the story starts. Hello Mr. Database, are you there? May I put something in you?
-
If you are a PHP developer and using NetBeans, then Testing with PHPUnit and Selenium might be of interest.
-
Integrating Selenium Tests into CruiseControl.Net via NUnit is what it claims
-
Avoiding Brittle Element Selection with Selenium2 tackles a constant topic using Se2 — but it can be applied to Se1 as well
The Current Status of Selenium 1 and Selenium 2
In the beginning there was Se1, and it was good. But it could have been better — in ways that WebDriver was starting to be good at. Thus the brilliant idea was hatched to merge the two projects.
And then the confusion began. Let’s see if I can start to address some of it via a ficticious conversation that consolidates the Se-user list and #selenium irc channel.
There are a couple annoying bugs in Se-RC 1.03; when is the 1.0.4 release?
Se-RC 1.0.4 is planned for sometime towards the end of July 2010
I’ve heard rumours that 1.0.4 the to be the final release?
Yes. 1.0.4 is planned on being the final 1.x release
That’s crazy talk! I can’t use a .0 or ‘alpha’ release for my mission critical application
Actually, its not all that crazy — and needs a bit more explanation. Se2 is truly a merger of the two projects, in fact 2.0a1 was literally the Se code from the OpenQA repository and the WebDriver code its Google Code repository merged into a new one. This meant that from the first release of the 2.x series, it has contained 100% of the 1.x code which means 100% backwards compatibility. Later releases in the 2.x series have been driven primarily by evolutions of the code that came from WebDriver, not from Se 1.x.
OK, so 100% of Se 1.x is in 2.x; I get that. But how are you making sure that fixes to one get into the other?
Here is another ‘secret’ — don’t tell anyone, but there hasn’t been any pure 1.x development since the merging of the codebases. Every 1.x release since the merger has really been a 2.x release — but all packaged up to make it look like a 1.x release. This is why observant people have noticed a log message that looks something like 11:09:37.507 INFO – v2.0 [a4], with Core v2.0 [a4] when they start up their 1.x server.
So you’ve been releasing alpha code disguised as a stable release? Jerks!
Woah! Relax! Recall what I said above about it being backwards compatible by default. The ‘alpha’ tag is there because the API for the new code is still being developed and features flushed out. The 1.x code is however, still stable and still production quality.
Alright, I take back calling you folks jerks, but I really don’t like the alpha tag. When will it be out of ‘alpha’?
There is only one or two more features to implement (like handling alerts) in the WebDriver code and some cleanup before the betas start. But hope for a 2.0.0 final by the end of the year. And while we’re on the topic of ‘alpha’ vs. ‘beta’, this the team’s working definitions of each.
- Alpha – APIs can, and likely will change. Possibly in dramatic ways.
- Beta – With the APIs set, make sure they work with the major browsers
‘Major Browsers’ eh, what exactly does that mean?
Right now it means Firefox, Internet Explorer and at least one WebKit based one (Safari or Chrome)
In short… it is a requirement of Se2 that the server be backwards compatible with Se-RC 1.x and that has already been accomplished by building the code from a common source repository. This means that if you are using Se-RC, you can switch out the server for a 2.x one and have no impact on the execution of the scripts. Plus you can start to experiment with the new stuff that came over from WebDriver.
A Smattering of Selenium #20
12 hours late, but I was driving draft horses all day so that’s my excuse and I’m sticking with it. Enjoy. I’m going for a nap.
- The big news this week was the next alpha of Se 2 came out. Time to update those automation machines.
- Like TestNG’s @BeforeClass and @AfterClass but using JUnit4? Using JUnit Nested Suites with Selenium RC to simulate TestNG suite and grouping annotations is a long titled post, but describes how to fake one out to act like the other.
- Also on the topic of TestNG is the announcement of Selenium on TestNG
- The folks at ActiveState did a survey in their community about tooling and Selenium won
- I had to hack DNS a bit for a client’s Se setup to work the other week, but that seems pretty kludgey compared to Selenium Trick: Using a different DNS
- Using ExtJS? According to Testing ExtJS with Selenium Automating UI Tests the trick is to use CSS as your location strategy
- Jason Huggins was interviewed by Matt Heusser in Episode 3 of TWiST
- If you are doing Se, then you are doing code. If you are converting ‘classic’ manual testers to do automation you need to start thinking about Training Testers in how to code…
- While not directly related to Se, Practicing Continuous Integration on Flash Projects: Using Hudson is the wrapup post in a series on doing what it says. If you are doing CI, and of course everyone is, then it needs to be for all parts of your system
- ParkCalc automation – Keyword-driven tests in FitNesse wraps up the series by Markus Gärtner that has been mentioned the last two weeks as well.
- HOWTO: Test JQuery AJAX autocomplete menus with Selenium details something that is fairly common I think.
GSoC 2010 – Remote Storage
What’s new for Selenium this summer ? The GSoC of course !!!!
I’m Jérémy, a french engineer and I work at SERLI, a services company based in France.
I’m working on Selenium since a year and this summer I’m mentoring Aleksejs for the GSoC 2010. I’m helped by David Burns when I’m on vacation or offline. His experience is really useful to me, and David is involved on student supervising regularly.
Aleksejs comes from Latvia in Europe (yes I know you know but perhaps Geography wasn’t your favorite subject at school ;)). His work was initiated by Patrick and myself. We thought to a remote system that allows Selenium users to save and get remote test cases, directly with Selenium, without any other installations like SVN.
What’s better than record a test case with Selenium IDE and save it on your remote storage? what’s better than share your test cases with colleagues without any other installations, just by using Selenium IDE or a Selenium Remote Storage client?
For myself I don’t know what’s better 🙂
Aleksejs has already coded the server side of the remote storage mechanism with all the necessary unit tests. He has also created a web interface to use it directly through the browser. With his work, you can put, get and delete a test case, and you can also browse the directory where test cases are stored. His work has been done in Java, and he used JSON, for data representation for the communication protocol. This system is really simply to use, based on REST technology, you only have to call URLs with the good parameters.
The next step of his work is to create a Se-IDE plugin based on the API done by Adam (thanks to him). This part has to be done in less than a month and I think it’s a hard task, but it’s so cool to write your own plugin. In this case, Aleksejs will use JavaScript, AJAX and XUL technologies. It’s really good to learn a lot of technologies for its own culture, it’s so trainer.
I hope you’re enthousiastic to get this new feature, but wait until October, when the work will be finalized 🙂
Enjoy guys, Aleksejs, David and I are ready to discuss on it if you have any questions. And good luck with the end of this adventure Aleksejs.
Selenium 2.0a5 Released
I’m pleased to announce the release of Selenium 2.0a5, available for immediate download. This release brings a host of changes under the hood, and represents the efforts of many contributors. Highlights include:
- New interfaces for dealing with HTML 5 elements.
- An API for “implicit waits“: quietly waiting until an element is present before continuing with a test. You can use them like this:
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS)
- A revamped Firefox driver.
- More shared code between Selenium and WebDriver.
- You can now pass firefox profiles to the remote webdriver (this includes extensions and proxy settings!)
- Improved .Net bindings: lots of updates to help bring them more in-line with the Java equivalents.
Waiting in the wings for release soon is an AndroidDriver, which opens up the world of testing webapps on Android devices through the Selenium WebDriver API.
If you’re a pythonista or rubyist, you’ve not been left out of this bonaza of new hotness. There have been regular updates for these languages, which can be installed via “easy_install -U selenium” or “gem install selenium-webdriver” depending on your language of choice.
Hopefully the next alpha will be the last before we plunge bravely into the betas. Exciting times are ahead!
A Smattering of Selenium #19
I’ve got a full day of driving ahead of me to go to a client so this is the early-morning (for me) edition of the Smattering post. That of course means there will be an absolute link explosion in about 20 minutes.
- Dave talks about some of the stuff he is doing with Se-IDE in the post Improving Selenium IDE
- Another post on how to deal with file downloads in Se. Mission Impossible no more
- Hue Doj got some tweet love as another possible locator strategy for Se. So who wants to write the integration?
- I’m really starting to enjoy JUnit 4. Ben has been learning about it too and shares Data driven Selenium in JUnit via @Parameters
- Fake.app also got some twitter love. It looks nice, but drag-and-drop script creation and Mac only will ultimately limit its growth capability
- There was a contest around the test management system, TestRail. What is cool though is the API that they have for it that allows external script engines report into it. It’s all about the integrations…
- The Bromine project has released new screencast which showcases Sauce OnDemand and Hudson integration. And it is a really slick integration at that.
- Dawn is interviewed on DZone about Agile testing and SeleNesse (the Se / Fitnesse bridge)
- High level acceptance testing in your PHP applications using Python, Lettuce and Selenium is a mini tutorial on umm, well, High level acceptance testing in your PHP applications using Python, Lettuce and Selenium
- Hudson Ci Server Running Selenium/Webdriver Cucumber In Headless Mode Xvfb is another well named post
- If you are using FarCry, testMXUnit will take a Selenese script and convert it to a format it needs
- Programmatic testing with Selenium and TestNG is a nice post that discusses TestNG, DbUnit, and Cargo
- Se-IDE Plugin: Stored Variables Viewer – This plugin allows you to view these variables when the test is running.
- Another post from Markus Gärtner on a European Weekend Testing session on automation with RobotFramework; this time titled ParkCalc automation – A short reflection
- Syn JS claims to provide proper click events for Se 1.x scripts. It was only soft launched but expect more from these folks in the near future
And lastly, BrowserMob, which was started by Se Core member Patrick Lightbody announced that it has been acquired by Neustar Webmetrics. Congrats! Now stop drinking the champagne and get back to work! 🙂
Selenium IDE – Looking back and looking forward
Its been around six months and three releases since I took the reins of Selenium-IDE. The fundamental change in that time has been the adoption of a plugin model like the fine folks over that Firebug. (We’re also self-hosting it which is big from a project internals perspective.)
Right now, you can add custom user-extensions and formatters, but in the very near future you will be able to add location strategies as well.
So what does the future look like for Se-IDE?
- 1.0.8 – A whack of bug fixes, and maybe the location strategies via plugins
- 1.0.9 – If location strategies doesn’t get into 1.0.8, it will be here. And likely bug fixes.
- 1.0.10 – Remove UI-Element from Se-IDE and make it a plugin
There is also work on reworking the internals of Se-IDE from a synchronous model to an asynchronous through Google Summer of Code. If that is successful and we decide to use it, that will trigger a bump to 1.1.0.
Timelines you ask? Well, when I took over Se-IDE the plan was to do it monthly. That was either naive or overly optimistic so they are starting to stretch a bit. 1.0.8 is going to stretch it some more too. Look for a beta of 1.0.8 towards the end of the month with a final version by mid-August.
I know you are likely wondering what cool, superdidooper features will you be seeing in Se-IDE over the next while? Ummm, well, actually none. At least not from the core Se-IDE. There will be significant pushback on any new ‘feature’ or change that adds something to Se-IDE. If you cannot accomplish your goal through a plugin, then I would consider than an omission in terms of the API.
Thats where we are from the maintainer perspective, but end-users also have sway over this as well to some degree. We’re now using the Google Code Issue Tracker for managing the project. If you bug is not there, there is a significantly smaller chance of it being addressed. And if an issue has a number of stars on it, that is also an indicator we should be looking at it.
Now to hack on locators…
A Smattering of Selenium #18
Not too much this week with various holidays around the world, but still managed to dig some things up.
- Sauce Labs has started a webinar series and recently had one on using Cucumber and OnDemand. Cucumber and Robot Framework like tools are the coming wave of testing tools.
- Another bit of Sauce-ish news is the folks at Rally put up a post on how to get Se 2 scripts in their OnDemand cloud
- If writing Se scripts is ‘programming’, then writing the controlling frameworks is real programming. That means that proper development practices should be followed; such as TDD. If you are new to TDD, then The Prags have released a screencast series by Kent Beck would be helpful. I’ll be getting this one as soon as my to-watch backlog gets under control.
- Re-usable Selenium Testing with GWT has lots of tricks to dealing with GWT widgets — something which comes up a lot on the Se-Users mailing list
And lastly, the Selenium Stack Exchange proposal has progressed to the next level which is getting people to commit to using it. The number of commits is a convoluted formula, but every one counts. If you think the Se-Users mailing list is too crazy, this format might be better for you.
A Smattering of Selenium #17
Here are the posts dealing with Se, and/or automation in general that caught my eye and interest.
- Selenium Unit Test Reuse illustrates one way of iterating through environments and browsers in a script without using Se-Grid. I’ve done similar tricks to this to some success — the problem is usually reporting though, but you are all clever folks so I’m sure you could add it in.
- Adding a custom header is sometimes required when writing a script, but its not really that documented so Kevin wrote How to Perform Basic Authentication in Selenium which combines how to do basic auth and header injection.
- Not running your scripts inside CI yet? Shame on you! Hudson creator Kohsuke Kawaguchi gave a talk at Digg which they recorded. I haven’t watched it yet, but Se gets a mention according to the notes at the bottom.
- Haven’t heard of the HAR (HTTP ARchive) format? Don’t worry, I hadn’t either until a bit of a discussion about the captureNetworkTraffic was had and its future in Se
- The Faker/Sham combination is established in the Ruby (and Perl) world as the way to generate random data of a prescribed format. Anthony has release a similar module for Python with some pythonic twists called Picka (as in ‘Pick a card, any card’ erm, well, name or address actually)
- Looking for an example of Page Objects in C#? I was last week and Dave convienently enough posted a page object pattern tutorial
- Adieu to QTP. Now for a closer look at Selenium makes the list just because it uses ‘QTP’ and ‘Chinese bile farm’ in the same sentence.
- Browsermob opensourced sep4j (which I think stands for ‘Se Parallel for Java’) which is a Collection of utilities for Java-based projects to enable Selenium test parallelization using Selenium Grid or Sauce
Labs. - Richard presented at the LJC Unconference on ‘Agile Acceptance Testing with Cucumber, Cuke4Duke, Groovy & Selenium’ and has posted his slides
- Speaking of acceptance tests, Gojko has a post on the Anatomy of a good acceptance test
- Last thing on acceptance tests for this week is actually multiple things. Markus recently did a Weekend Testers event using RobotFramework and ParkCalc and has started a series of posts about it: Getting Started, ParkCalc automation – Refactoring a data-driven test and ParkCalc automation – Refactoring a keyword-driven test are the first three posts in it. Hopefully there will be more too.
- And I’ll finish with one of my posts from this week which was on how to deal with pesky file downloads in Se. (hint: don’t use Se for downloading files)
A Smattering of Selenium #16
I’m going to start posting the Smattering posts here on the main Selenium blog, hopefully each Monday. For past ones see my personal blog’s archive
- Style Tests using Selenium and Robotframework – With those simple steps we are able to do regression testing on our user interfaces that have strict standards
- Export Selenium IDE scripts for Grails – A plugin which does exactly what the announcement says.
- Selenium XML Formatter – Hurray for plugins!
- TestApi – a library of Test APIs – Seems like it might be useful for people working in .NET land
- BlueDuck Selenium Remote Control – The folks at BlueDuck have packaged a release of Selenium RC with an installer and GUI for controlling options
- Selenium and Hippo CMS – Its not a plugin — locators are next on the pluginification list — but if you are using Hippo CMS and want to use Selenium with it, this custom locator makes the integration easier.
- Checking for JavaScript Errors with Selenium – This is the coolest trick I have seen in quite a while!
- FlexMonkium, Gorilla Logic’s bridge between Selenium and their FlexMonkey product is now available in beta. Yup, its partly a plugin for Se-IDE. (Oh, and their press release has a quote which I think is the first time that has happened…)
- Not to be outdone, Sauce Labs have announced support for Flex and Flash as well. Care to guess how it is implemented? A plugin…
- Working with Joomla? You could recycle their Test Case Methods to automate some of your tasks. Creating product DSL-like helper wrapper things is exactly the right path to take.
- Pyrite – Easy peasy in-browser testing with Selenium (in Ruby)
- Using Sauce Labs OnDemand and Hudson? The is now a plugin for that.
- Lebowski is The test automation framework for SproutCore applications and uses Se at its core.
- Running Selenium Tests on Sauce Labs describes, well, how run Se test in On Demand (in Java).
Selenium Grid 1.0.8 Released
We’re pleased to announce the release of Selenium Grid 1.0.8. This release fixes multithreaded issues with the Selenium Grid hub that appeared randomly under heavy load. If you’ve ever seen a log message about HttpClient being accessed by multiple threads, you definitely want to upgrade. Even if you haven’t, this release is highly recommended for all.
You can download it now or view the changelog. The list of changes is:
- Multi-threaded issue with access to HttpClient has been resolved, fixing random crashes on a heavily loaded grids
Many thanks go out to Chris Gulley for identifying and fixing the problem. As always, patches and bug reports are appreciated:
I mentioned in the release notes for 1.0.7 that barring any major issues, 1.1 would be the next release. This fix was major enough to warrant an intermediate release. We are still planning to put out 1.1 as the next feature release.
If you have any questions about Selenium Grid, please use either the user or the developer list, as is most appropriate for the nature of your question. Ongoing discussion about grid development should take place on the developer list.
Selenium IDE 1.0.7 – Now with Drag-and-Drop!
So its a month later than planned, but Selenium IDE 1.0.7 is now available. The delay was due to some internal build changes and not code, but one of the code changes that is there more than makes up for the delay.
That’s right, drag-and-drop has finally arrived to Se-IDE — though credit lies with Jérémy Hérault for implementing it.
Oh, and if you are Swedish, there is now a localization for you. Yes, a real one. Not just one that makes everything say Bork as was suggested to me. Although a Pirate locale might be arrr-some.
For those with version 1.0.5 or newer, the update will be pushed to you automatically over the next couple days. Those new to Selenium IDE or with 1.0.4 or older will want to install it now.
Other things of note around this release
Selenium Grid 1.0.7 Released
Following up on the Selenium Grid 1.0.6 release, which was mostly a bug fix release, we’re pleased to announce the release of Selenium Grid 1.0.7. This is another bug fix release that focuses primarily on how Selenium Grid handles browser sessions.
You can download it now or view the changelog. The list of changes are:
- Hub now instructs remote controls to shutdown a session if the hub is going to remove it due to being idle for too long
- Added ability to specify timeout period when waiting for remote controls to become available. Now the client can timeout gracefully and decide what it would like to do next
- Handle common case of session ID not being found, either because it timed out or was already closed; rather than raising a NullPointerException we now raise a NoSuchSessionException
- Truncate long command response bodies to 128 characters
- Retry remote control checks up to three times before deciding that a remote control is unreliable or unresponsive. This prevents aggressive unregistration of hosts that are busy or suffer from network issues
As always, patches and bug reports are appreciated:
Barring any critical issues, the next release of Selenium Grid will be 1.1 and will feature an enhanced Web view as well as a status API. After that, we will be moving from GitHub to Google Code to live alongside the other Selenium projects.
If you have any questions about Selenium Grid, please use either the user or the developer list, as is most appropriate for the nature of your question. Ongoing discussion about grid development should take place on the developer list.
The Future of Selenium Grid
As you likely know by now, after years of stewardship Philippe has stepped down as maintainer of Selenium Grid and has named me the new maintainer. In this post, I hope to address the most immediate questions about what this means for the future of Selenium Grid.
Background
I realize many of you may not know who I am. I’ve been using Selenium in some capacity for close to five years now. I love working on open source software and do so primarily through my membership in the Apache Software Foundation and through my GitHub account. I hang out on the #selenium channel with the handle “nirvdrum” and have a personal page that includes some articles I’ve written and other things I’m involved with. Perhaps more importantly, I also rely on Selenium Grid for my latest start-up so I’m very keen on seeing the project mature and evolve.
Project Resources
The new canonical project repository on GitHub is the nirvdrum fork. However, within in the next month or so the project will be migrated from git and GitHub to subversion and the Selenium project on Google Code. As much as I personally prefer GitHub to Google Code, it makes the most sense from a community perspective for all Selenium projects to be hosted in the same location. The move will be made after Selenium Grid stabilizes a bit more. The 1.0.6 release was the first step in that process, but there may be one or two more minor patch releases. After the move, I’ll try to maintain a synchronized mirror of the code on GitHub so those that prefer to develop patches with git can continue to do so.
The canonical issue tracker is the Selenium issue tracker on Google Code. We will not be using either JIRA or GitHub Issues. I’ll try to migrate what I can over to the new tracker, but if I miss anything, please re-open the issue over there.
Project Evolution
Selenium Grid currently only works with Selenium 1.x, and consequently the 1.x compatibility interface in Selenium 2. There is currently no support for WebDriver. However, I fully intend to steer the product in that direction, while maintaining support for existing Selenium Grid installations (i.e., based on Selenium 1.x).
Since the project is moving to Google Code, all of the existing Selenium committers will have the ability to commit to the codebase. This should make the project’s evolution a much more collaborative effort. I’ll kickstart the process and likely lead the development effort, but the role of maintainer will be diminished (in a positive way) by allowing the entire core team equal access to the project.
Others are welcome to chime as well. Selenium Grid development discussion will be taking place on the Selenium developers list. Please continue to use the Selenium users list for usage and support inquiries.
Selenium 2.0a3 Released
Selenium 2.0a3 has been released and can be downloaded from the Selenium project site. This is a major update to 2.0 and all users are encouraged to update. The new features include:
- An improved remote protocol.
- Updating the version of HtmlUnit used to 2.7.
- Improved support for simulating user interactions with the browser via native events on Linux.
- Better support for Firefox 3.6.
- Bug fixes
The .Net, Python and Ruby bindings will be updated soon, as will the maven artefacts.
The next release will be Selenium 2.0a4, and it is planned to include the following when it is released in late May:
- Android support
- A new API to support writing tests involving complex user interactions.
- Far more integration of the underlying architecture.
Selenium Grid 1.0.6 Released
Following up on the Selenium Grid 1.0.5 release, which added self-healing features to ease grid management, we’re pleased to announce the release of Selenium Grid 1.0.6. This is a bug fix release for 1.0.5 with some minor new additions.
You can download it now or view the changelog. The summary of changes are:
- Fixed some concurrent modification issues that may have resulted in NullPointerExceptions
- Fixed issue with shutting down workers with Rakefile
- Added PID file support for hub and worker started via Rakefile, making it easier to use a process monitor such as monit
In case you missed the announcement, Philippe is no longer maintaining Selenium Grid. We thank him for his years of effort and helping the project get to where it is today. This is my first release as the new Selenium Grid maintainer. I will be getting out a new post shortly that lays out the future for the project [UPDATE: The promised post is live]. In the meanwhile, please note the new location of several key resources:
If you have any questions about Selenium Grid, please use either the user or the developer list, as is most appropriate for the nature of your question. Ongoing discussion about grid development should take place on the developer list. We look forward to hearing what you think about how we can improve the project.
Selenium 1.0.3 Released
Hot off the heals of 1.0.2, we’re releasing Selenium Remote Control 1.0.3. You can download it now.
There is no functional difference between this version and 1.0.2, other than it is packaged up a little nicer and we’ve clarified the relationship between selenium-server and the client drivers. That is: we are not releasing new client drivers with future 1.x releases. The reason is that we locked down the API in version 1.0.1 and so there is no need to push out the same code each time. As such, when you download 1.0.3, you’ll see all the client drivers are labeled version 1.0.1, which is expected.
This release also is zipped up in a way that is compatible with all operating systems. The 1.0.2 release had some reported issues on Windows that have been fixed.
Finally, we also had many requests from Maven users. While we no longer use Maven to build Selenium, we are including pom releases for both the standalone server (ie: selenium-server.jar) and the “coreless” server (ie: selenium-server-coreless.jar). We hope they will be in the central repository shortly.
Selenium 1.0.2 Released: Firefox 3.6 and Snow Leopard Support
Today we’re happy to announce that Selenium Remote Control 1.0.2 has been released. While most of our efforts are on Selenium 2.0, we understand that there are millions of Selenium users that still need the 1.x line supported. That’s why we’ve said from the start that our goal is make 2.x 100% backwards compatible with 1.x. And that’s why we’re releasing a new version of Selenium RC today.
In addition to many bug fixes, the biggest improvements in this version are support for both Firefox 3.6 and OS X Snow Leopard.
Welcome to the official Selenium blog!
Since we moved away from Clearspace for our forums, it’s time we also did the same for our blogging platform. As such, the new location for the official Selenium blog will now be:
http://seleniumhq.wordpress.com
We hope to be much better about posting news, tips, and tricks here going forward.