Archive for November, 2011


Selenium – Red Badgers use of the Open Source Web Testing Tool not the Chemical Element!

by Brendan Meade

All software development companies have a requirement to continually ensure the quality of their product, this becomes more difficult as a product grows and the need for changes to the system evolve. Changes including; functional improvements, code patches or system configuration changes. This area of quality control is commonly maintained by the Test Team (QA Team) in the form of Regression Testing.

To complete the continuous task of regression testing of our functional deliverables, we here at Red Badger are avid fans of Selenium, the web application test tool. Selenium is an open source set of tools that allow a wide range of users, from the novice to the seasoned user to create automated test scripts. Selenium has grown over the years to form a huge international user base, which in turn has spawned a huge source of obtainable knowledge online and also in printed word form.

Selenium IDE code format selectionThe set of tools provided by Selenium include: Selenium IDE – Implemented as Firefox add-on, Selenium IDE allows the user to record each step as they manually navigate around a website, and then replay the actions, thus creating an automated script. More commonly used by beginners to Selenium as little or no coding experience is necessary to get started. The scripts are recorded in HTML and then using one of the best attributes of the tool, the user can select which software language to output the script. However, I would not recommend this method when designing test suites which may have any number of conceivable test cases – as the strength of a well designed framework and test suite requires a more manageable and configurable solution.

Selenium Server is the solution! Selenium Server has many names; Selenium Remote Control (RC) (also known as Selenium 1.0), Selenium 2.0 and Selenium WebDriver. Don’t be put off by the different naming conventions seen throughout the web. I’m not going to discuss where these different names have come from as I would rather tell you about the power of the component!

Selenium Server Overview DiagramAs can be seen in this diagram Selenium Server sits between the test scripts and the specified browsers. It automatically launches and kills browsers and acts as a HTTP proxy for web requests. In addition Selenium Server contains a magnitude of client libraries to support your favourite programming languages including; C#, Java, Perl, PHP, Python and Ruby.

At Red Badger we have a close relationship between the Development and Test teams, and hence chose to script the Selenium framework and test scripts in the same language that the development team are proficient in using; therefore C# forms the foundation of our robust NUnit framework using Microsoft Visual Studio as our dedicated IDE.

MS Visual Studio C Sharp FrameworkTo configure Visual Studio to use NUnit and Selenium client libraries the user must ‘Add Reference’ to the project solution. This is very simply done by pointing VS towards the .dll files of NUnit and Selenium.

Selenium Standalone Server is then initialised to interact with NUnit and the specified browser. Selenium Standalone Server is written in Java so Java must be installed on every machine that you wish to run the test scripts on.

Simply start Selenium Standalone Server with the following command in CMD:

C:\selenium>java -jar selenium-server-standalone-2.6.0.jar

Selenium Standalone Server

The Selenium official website documentation is impressively detailed and gives a great overview on each component and its abilities. The download section has all the latest stable releases and for each of the components out lined above and used daily here in Red Badgers automation framework. I would recommend keeping your Selenium Standalone Server and Selenium Client Server on the same version and updated regularly as the community works hard to improve this excellent tool set all the time.

Lessons Learned!

Shooting a moving target is never easy!

Writing automation scripts to test an ever changing data set always requires some serious thought and planning. As you will have learned by now, Xpaths are used to pin point elements within the website in order for Selenium to carry out the test actions. Building strong and efficient Xpaths are key to ensuring that your test scripts have a long lasting life, and in turn will reduce rework required overall on your test suite.

Firebug is an excellent Firfox add-on that lets you view the HTML of any element on your web page, these Xpaths may then be viewed and edited using a Firefox add-on called Xpath Checker.

Efficient Xpaths

In the above example we are selecting menus, they contain sub-menus and the sub-menu checkboxes. The titles of these menus constantly change depending on the users original query search. The solution was to design with specific Xpaths where we can pass in multiple variables to select an element. The variables passed are numerical and therefore select the menu etc. based on its location rather than its title!

Unique registered users for every run!

When testing a website that requires users to register and login to access additional content, we need to think about how these users will be unique every single time we run the same test script! The solution to this will depend on the structure of the database architecture and the method used to store each unique user’s details.

If you have access to a dedicated test environment and database you should be able to carry out a database backup and restore as part of each test script, with the added advantage of allowing user data to be pre-populated with each restore of the database. At Red Badger we have another method using a clever little C# trick creating a new user email using a date and time stamp, every time the test script is run.

For example giving:

Create Unique User

Imagine a Life without Selenium?

Automation regression testing certainly leads to a better use of resources. Skilled testers are freed up to concentrate on using their exploratory test methods on new functionality being delivered by the Development team. Virtual Machines may be set up and used as a dedicated resource for regression testing, with little or no maintenance when using the xUnit series.

As proved here with Selenium, cost is no longer an issue when considering developing an automated test suite. All one needs is a little determination and imagination!

Learning Material

In addition to the links above, I would like to point you towards this blog Evil Tester. This seasoned tester has worked hard to gather relevant learning material and has concluded it here in a manner that I am only too happy to recommend – How can I learn to automate my testing using Selenium?. Also if you prefer to have a good old fashioned book, this tester is the author of a great book for beginners Selenium Simplified.

XPath, CSS, DOM and Selenium: The Rosetta Stone contains printable wall charts comparing element section options. It outlines that Xpath, CSS, and DOM are a fairly diverse set of technologies yet they have quite a bit in common.

2011, a collab with Onedotzero, Microsoft and Nokia

by Cain Ullah

WP_001169As anyone that has read this blog before knows, Red Badger has been developing on Windows Phone 7 since the very beginning. Now Mango is out, it’s features have got a lot more interesting. I have been waiting with bated breath to see what cool apps will be coming out on the platform now that Mango is readily available.

So, I was incredibly surprised and intrigued when I got an invite to the launch event in collaboration with onedotzero Adventures in Motion Festival. If like me, you are into electronic music, motion graphics, animation, immersion and generally anything innovative, then you should find out who onedotzero are if you don’t know already. I have been coming to various events put on by onedotzero at the Southbank in London for years. This weekend they are celebrating their 15th birthday by running the adventures in motion festival at the BFI Southbank showcasing a mixture of interesting screenings (screenings include subjects such as; Bjork’s unprecedented contribution to the medium and art form of music video), interactive installations (you’ll probably hear me talk a lot about immersion in the coming months), talks and workshops, some live audio/visual performances and some educational conferences. I’d recommend it to anyone.

WP_001168Anyway, back to the launch event. I had no idea what to expect at all and I didn’t know who the guest speakers were either. After picking up my complimentary breakfast from Benugo and getting my pass we were ushered into the studio. There were the usual Microsoft suspects, Will Coleman and Paul Foster, both Microsoft Developer Platform Evangelists for Windows Phone 7. There was also a large contingent from the Windows Phone User Group including Matt Lacey on the presenter’s roster. There was however, a very mixed crowd. A clear mix of art/creative and tech.

Shane Walter – OneDotZero Creative Director, made a number of inspirational talks that if you have been to onedotzero before, you’d be used to by now. Particular things he said rang close to my heart, particularly when discussing how artists/creatives should be integrated with developers (integrated teams of creatives and developers is something we believe in and practice at Red Badger). Such quotes as “Everybody is creative” & “We are social beings” (asking everyone to turn first to their left and then to the right to introduce the audience to each other and watching our behaviour to prove his point) gives you a glimpse at the sort of stuff he was talking about. This talk painted a picture of what was to be demoed.

After an intro to Windows Phone 7 by Will Coleman and a brief talk from Nokia’s Keith Varty – Head of ecosystem & services – Nokia UK & Eire, we got onto some demos…

VequencerFirst up was Team Holotronica & Stuart Warren-Hill  with Vequencer. Stuart Warren-Hill is one half of the Hexstatic duo, a ground-breaking audio/visual electronic music act who’ve been experimenting with 3D A/V shows for years. Vequencer is a dynamic 3D visual sequencer. It basically allows you to use 8 instruments (such as bass drum, closed hi-hats etc. for you budding music producers out there) to sequence a live track loop in a 32 beat bar. As your track plays, there is a dynamic 3D visualisation in the centre of the application that reacts to your sequencing. I had a play and could have played with it all day. The 3D visualisation was written in XNA in collaboration with Martin Caine (of Retroburn Games) & Simon Jackson (both admins of the XNA UK Usergroup). What was also really cool was that there is a group collaboration option which allows multiple users (up to 8 simultaneously) of the Nokia Lumia 800 to connect their phones together and have a jam (presumably each person being in control of an instrument each). Matt Lacey (founder of the Windows Phone User Group) had developed the interface to allow the software to sync across multiple phones, a feature Stuart demoed to us across 4 Nokias. It was a truly engaging musical/visual app that (I’m sure to Microsoft’s pleasure) fully utilised the new WP7 Mango feature that allows apps to combine both XNA and Silverlight in the same application. All of this was developed in 2 weeks and it’s already looking very slick. There is a whole host of other features that could follow. Speaking to Stuart, he has every intention of his next album being produced entirely in Vequencer. I can’t wait for it to come out so that I can start making music with it myself. A great start to an entirely new type of use of Windows Phone 7.

KaleidoboothNext up was Max Hattler and IndieSkiesGames to show Kaleidobooth. Max Hattler is a London based experimental moving image artist from Germany. He showed us some of his previous works all of which were very focused on symmetry. Kaleidobooth is an experimental art project using the Mango camera API to create a dynamic kaleidoscope application that adapts to both what the camera is looking at as well as sound inputs. What I found interesting is that Max had never worked with developers before so they discussed a little about their working environment, how they collaborated and the challenges they faced (Very much in the spirit of what Shane Walter had discussed earlier). Max was based in London, IndiesSkiesGames in Derby. They ran a tightly managed project using 37 Signals’ basecamp to collaborate. Again this was a 2 week project and the output was impressive. I didn’t get the chance to play with Kaleidobooth but it looks like a lot of fun and is due for release in early 2012.

RedshapeThe last demo was of Redshift. This is a 3D racing game through music videos created by digital art studio F’eld, Treehouse Dev, Edward Powell and music provided by artists from a favourite record label of mine – Numbers.  Presented by Vera Glahn of F’eld, Redshift was again a prototype that was only 2 weeks in the making but was already looking pretty impressive. It takes advantage of the Mango’s accelerometer and gyroscope features to allow the the user to race through a 3D world by changing the tilt of the phone in a steering wheel kind of manner. Visually it’s still in it’s early stages but is looking like it’s going to be a really engaging, immersive game with a killer soundtrack blending electronica with hip-hop beats.

All of the above apps demonstrated a wide use of Mango’s new features and showed just how easy it is to develop on the platform in comparison to other platforms, showcasing some really polished (and complex) apps that were developed in just 2 weeks.

The collaboration with onedotzero to create is a fantastic move by Nokia and Microsoft. It’s basically an experiment to merge technology and art to inspire experimental projects on the platform. If you sign up to you can start to submit your experiments to be showcased on the website straight away and there are cash prizes ranging from £500 to £5000 for the overall winner.

WP_001176 (2)At the end of the session, everyone in attendance got a free Nokia Lumia 800 so I’ll be retiring my HTC Trophy 7 now and testing the Nokia. I’ll blog about the experience in the next couple of weeks hopefully. After the session I enjoyed a beer before heading off to see some experimental music videos from the likes of Michel Gondry at Wavelength 11.

Unfortunately there is only 1 day left of the onedotzero festival but if you get time, I would get yourself down to the BFI to see some screenings and art installations. Tatsumi at 15:50 today, a screening paying tribute to Yoshihiro Tatsumi would be a highlight for me.


The new Badger

by Rachel Eyres

Rachel in the office

So I’ve joined the team at Red Badger, and now that I’m 2 weeks in I thought I’d share some musings. For those that don’t know me, I’m the new Director of Client Services, which means I’m going to be responsible for all things business development, account management, marketing and  generally helping the team to grow the business. And refreshingly, that doesn’t just mean “make as much money as fast as possible”, but rather focus on interesting, value-adding work which plays to the company’s strengths – use of cutting edge technologies, blended UX and delivery teams, innovation and creativity. So I’ve spent a couple of weeks settling in and doing all the things you’d expect. I’ve been getting to know the team, meeting some of RB’s very impressive clients, telling some of my own contacts about the company’s capability, and the thing I’ve spent the most time on so far is drawing up a business development strategy for the company. This is still a work in progress and needs lots of input from the founders, but it’s starting to take shape. One of the things I love about smaller companies is you can be creative, unconstrained by history and structure, and just come up with some great ideas and go after them.

Here’s what I’ve noticed so far:

The focus – the guys who set up the company are friends I’ve worked with in the past – they were always outstanding and focussed but doing their own thing has amplified this, and their commitment has rubbed off on the entire team. Everyone’s top quality, really into it and switched on. And how many consultancies can you say that about?

The team feeling – usually there’s at least some friction between the UX guys, the developers, the project manager etc. Not here. Everyone seems to instinctively, and through experience, get what each other is trying to achieve and they can genuinely work together. lovely.

The techy-ness – whilst it’s integrated and design focussed, this is a very technical company. The guys are forever trying new things, just to see if there’s a better way, which really pays off.

Just doing it – I’ve spent some time recently at an organisation that provides advisory services on cloud computing and other venerable subjects, which is great but very slow and time consuming. None of that here – we’re just doing cloud, we’re just doing 3d, we’re just doing multi-channel, we’re just doing mobile. There’s no fuss, no-one’s shouting about it and trying to turn it into a pretty picture, it just happens.

So I’m excited, which is a good place to start. The work we’re doing at the moment for customers is very exciting, the focus areas for the next 12 months are pretty cool, and some of the new product ideas the team are thinking about will blow your mind. But more on that stuff later. For now it’s just “hello, I’m here, taking it all in, liking what I see so far…..”