Selenium 2 in .NET framework

Posted: July 7th, 2010 | Author: zacc | Filed under: Examples | Tags: , , , , , , | 16 Comments »

I’m not Dave but you might have met me at one of the London Selenium meets. My name is Zac and I have several years of automated testing experience with Selenium RC in Java and C# and am now intending to be one of the early adopters of Selenium 2 using the .NET version.

Selenium 2 and .NET are up to alpha4 already but thorough examples of code on the internet are a bit thin on the ground so far compared to the Java equivalent. In my time using Selenium RC and now Selenium 2 I have built up a framework to support it.

I consider it to be an intermediate-level framework for using Selenium 2, NUnit and the Page Object model together so some advanced users might find it a bit basic. You may have even seen some of these concepts as snippets on testing blogs around the place. But overall it offers a framework from which to develop an easily maintainable suite of tests using the Page Object model (which is now considered to be the best practice for Selenium 2). If you already have a suite of Selenium tests in flat files that is spiralling in size and you are looking to make it more durable and more efficient then this could suit you.

With this blog post I intend to step through and get you started with this framework.

Read the rest of this entry »


Introducing Zac

Posted: July 7th, 2010 | Author: Dave | Filed under: Introduction | Tags: , | No Comments »

As he’s preparing his first post for SeleniumExamples, it’s probably a good time to introduce Zac! I have worked with Zac in the past and he recently mentioned having some suitable content for this blog. I thought it’d be easiest to just give him an account.

I suspect most of Zac’s contributions will be .Net or C# examples, which is something I have little experience of myself. If you’re also interested in submitting content to the blog, get in touch with details of what you’d like to contribute and a bit about yourself.


Improving Selenium IDE

Posted: July 7th, 2010 | Author: Dave | Filed under: Improvements | Tags: , | 1 Comment »

I’ve been working on a new formatter plugin for Selenium IDE, and along the way I discovered some quirks (not necessarily bugs) in the code. After a few discussions with some of the Selenium community, I decided to get stuck in and see if I couldn’t make some improvements. In the interest of sharing my experiences, here is what I did.

Format header/footer caching
For some reason (still not clear to me) the Selenium IDE formatter headers & footers were cached in two places, the TestCase itself, and also within the Format. I was finding that when switching between my new format and the default HTML, whichever I used first was persisting as the header/footer for the other. This could be fixed by using the Formatter cached header/footer but as I couldn’t see any advantage of caching this content, it seems like an unnecessary and overcomplicated solution. So I removed the caching entirely.

Updating variables in format source
The other main issue I had was when updating the base URL in Selenium IDE the format source is not updated. By removing the caching I’d partially solved this, but it still required the user to switch to another format and back again. Also, changes to variables from the format options pane also need to update the format source. I was able to find the appropriate place to initiate a refresh of the format source.

Setting the initial base URL
Finally, I had an issue where the initial base URL in the format source was not correct. When I tracked down the right place to put this minor fix I found the line I needed was already there but commented out! After a quick check, it appears that the change may have been a mistake, so I brought it back in and ran a few successful tests.

Obviously these changes are fairly significant, so the next release of Selenium IDE (1.0.8) will need to be well tested. At this time there isn’t a build available with these changes, but if you are confident with running a potentially unstable version you can check out from SVN and build Selenium IDE yourself.

Please get in touch if you have any feedback. You can raise any issues you find in the official issue tracker. Please label them as ‘ide’.

Stay tuned for more details on my new formatter – I have a few more issues to work through before I’m ready to release it, and some of these may even involve further improvements to Selenium IDE.


Get a new iPhone with help from Selenium

Posted: June 30th, 2010 | Author: Dave | Filed under: Examples | Tags: , , , , , , | No Comments »

I’ve been looking forward to the iPhone 4 ever since the 3GS was released, as I was in contract at the time and decided to wait another year for whatever Apple decided to release next. Due to unexpected (but very cool) circumstances, I was out of the country on the day Apple released the iPhone 4 and so was unable to queue up for one of the devices, and now due to the demand it’s very difficult to get hold of one. Since getting back to the UK I have been visiting my two nearest O2 stores to check if they have had a delivery, and today they pointed me towards their online stock checker…

So rather than check this manually, I decided to write a couple of small Selenium 2 scripts to check the stock levels at my ‘local’ stores, and to find out all stores that do have the devices. These examples use Java with TestNG (for dataproviders), and Selenium 2.

Read the rest of this entry »


Play Pacman with Selenium 2

Posted: May 25th, 2010 | Author: Dave | Filed under: Challenges, Examples | Tags: , , , , | 27 Comments »

When I saw Google’s recent interactive Pacman doodle to celebrate the game’s 30th anniversary, my first thought was ‘Wouldn’t it be cool to automate playing Pacman using Selenium’. I know – I’m a geek!

Google's Pacman Doodle

Anyway, below is my quick proof of concept using Selenium 2 alpha 4 – the latest version of Selenium 2 is available for download here.

Read the rest of this entry »


Mozilla & LinkedIn using Selenium

Posted: May 20th, 2010 | Author: Dave | Filed under: Events | Tags: | No Comments »

Last night was the May Selenium Users meeting in San Francisco, where Mozilla and LinkedIn presented their use of Selenium. Adam Goucher (Selenium IDE maintainer) was there, and has provided his notes on his blog. It sounds like it was a great event, hopefully there’ll be some videos online soon!


GTAC 2010 Announced

Posted: April 23rd, 2010 | Author: Dave | Filed under: Events | Tags: , , , | 5 Comments »

The Google Test Automation Conference (GTAC) for 2010 has now been announced on the Google Testing Blog. This year the event will be at the Novotel in Hyderabad, India. More details can be found by following updates on the official GTAC website.


Survey Results from London Selenium Users

Posted: April 22nd, 2010 | Author: Dave | Filed under: Events | Tags: , , , , | No Comments »

Before holding the second London Selenium Users meetup we asked several questions of the Selenium users in London:

  1. What is your level of experience with Selenium?
  2. What do you want to know about Selenium 2?
  3. What language would you like to see Selenium 2 demos in?

Below are the slides that I didn’t get time to show at the event.

View more presentations from davehunt82.

In case you can’t see the slides above, the results are repeated below:

What is your level of experience with Selenium?

  1. Beginner: 44%
  2. Intermediate: 46%
  3. Advanced: 10%

What do you want to know about Selenium 2?

  1. New Features: 50%
  2. Migration: 20%
  3. Everything: 20%
  4. Grid: 10%

What language would you like to see Selenium 2 demos in?

  1. Java: 55%
  2. .NET: 26%
  3. Python: 10%
  4. Ruby: 3%
  5. JavaScript: 3%
  6. PHP: 3%

Selenium 2 User Interactions API

Posted: April 22nd, 2010 | Author: Dave | Filed under: Events | Tags: , , , | No Comments »

Here are the slides from Eran Messeri’s talk on the advanced user interactions API that he’s currently working on for Selenium 2.


What does Selenium 2 mean to the average QA?

Posted: April 22nd, 2010 | Author: Dave | Filed under: Events | Tags: , , , | No Comments »

The slides and demos from David Burns’ talk at the second London Selenium Users meetup are now available on his blog.