• Home
  • RSS Feed
  • Log in

Cirilo Wortel

Fitnesse – Selenium integration struggles
Posted by Cirilo Wortel around lunchtime: April 23rd, 2009

Recently I was challenged by a client to test a new web application in an Agile project. The team was new at working Agile and even more with working together with a functional tester, altogether this resulted in me getting very little development support from the team.
Because the lack of tooling and support I focussed my efforts on just recording test-scripts using Selenium IDE, hoping I would be able to reuse them once I got the development support I had been requesting. The plan was to integrate the pre-recorded scripts in a more extended test environment in a later stage of the project.

After having studied what my options were for successfully automating the test environment, I formulated a strategy to undertake this. Being used to having a powerful framework like Fitnesse, with Selenium IDE I missed about all the functionality to operate on the domain of the application itself. Such as test preparations steps, database access and calls directly to server processes. Besides using Selenium IDE by itself simply does not support the use of any other browser besides Firefox and the customer expected the application to be running on any browser and explicitly requested it to be tested on at least IE6/7, Firefox and Safari.

Quite a lot of blogs can be found on the net on how to integrate Fitnesse with Selenium. There is even the webtest fixture in Fitnesse that sets the basis for this integration.  All that is necessary is a fixture that is capable of calling Selenium and the pre-recorded Selenium scripts would have to be converted in a format that Fitnesse can understand. Fitnesse would than call Selenium RC enabling the browser support that was necessary for the job.

When a Xebia colleague joined the project things sped up and I got my implementation. It took him little time to write the fixtures I needed. In our experiment we found that in order for Fitnesse to work with selenium scripts, just a very simple driver could do the trick, the most important part was the ability for Fitnesse to understand the different Selenium commands. Fitnesse version 3.x contains a script fixture that makes it very simple to create a logical script in a readable way, that could also be based upon the pre-recorded Selenium scripts. A groovy script did the translation, the makeup of the script needed just minor adjustments to conform with the Wiki table and some basic commands that are used in Selenium IDE differ from what Selenium RC uses, so these needed translating.

That pretty much does the trick!

When I actually started using it I ran into some odd problems. For instance, when you try to test across domain borders, from our website to another and back (in our case this was a internet payment provider), Selenium RC just stopped with some unclear error, while IDE had worked perfectly fine. Again my colleague came to the rescue. At home he did some investigating and got the thing working. We just need to set the -proxyInjectionMode as we where working behind a proxy at the customer site.
Yet again this did not solve the problem entirely, Selenium ended in a strange session exception. Whenever Selenium crossed the domain it would start a new session, loosing the proxy settings of the original browser session. Now this problem was a bit more tricky, after doing extensive research we found that every-time firefox started a new session it did it from blank profile, causing our proxy settings to be lost. Turned out the guys from Selenium already implemented the solution to this problem, we just had to point it to the correct Firefox profile template using the -firefoxProfileTemplate parameter.

So the final startup command turned out to be something like:
java -jar selenium-server.jar   -firefoxProfileTemplate /Users/cirilowortel/Library/Application\ Support/Firefox -proxyInjectionMode’

 

Share

Tags: Agile, fitnesse, Scrum, Selenium, Testing
Filed under Agile, Quality Assurance, Testing | 6 Comments »



6 Responses to “Fitnesse – Selenium integration struggles”



    Seu Enium Says:
    Posted at: April 23, 2009 at 3:20 pm

    You can use *chrome instead of *firefox. It resolves all the problems about changing domains during the navigation.
    About Fitnesse integration with Selenium, I’ve used it for a while but I haven’t like it. Debugging in Fitnesse is awful and web tests generally crash and you have to debug.

    Reply


    Rob Fletcher Says:
    Posted at: April 23, 2009 at 5:02 pm

    What kind of ‘agile’ team has a separate tester writing functional tests? Why aren’t the devs doing it?

    Reply


      Cirilo Wortel Says:
      Posted at: April 27, 2009 at 8:11 am

      Hi Rob,
      In this team the developers were just doing unit testing. We have found that adding a functional tester to our teams is a recipe for success and if done correctly makes additional acceptance testing by the customer redundant. Also a tester can focus more on the business while the developers can fully focus on technical issues. This is for us a proven strategy, besides in my opinion testing and developing are just two different specialties.

      Reply


    Derek Neighbors Says:
    Posted at: April 23, 2009 at 7:21 pm

    It is nice to see how other agile teams are approaching functional testing. Please keep sharing.

    Reply


    Powers Foss Says:
    Posted at: April 29, 2009 at 8:12 pm

    I have also combined FitNesse with Selenium RC to form the basis of our automated functional test strategy. It works quite well and we have a team of nearly 30 QA testers authoring their tests in FitNesse utilizing Java fixture wrappers around the Selenium calls. We’ve found that with only a basic knowledge of XPath, the majority of the QA team can be productively automating tests without any programming experience. This keeps the so-called “test automation team” size down to a very small number (3) needed to support the functional tests, any custom fixtures, and execute the load & performance testing.

    Reply


    Keith Sterling Says:
    Posted at: May 9, 2009 at 8:15 am

    Guys,

    I have a full DSL implementation of Selenium in Fitnesse available for all to use at http://www.magneticreason.com/tools/fitnium/fitnium.html

    Keith

    Reply


Leave a Reply

Click here to cancel reply.


Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India
  • XebiCon 2012

Categories

  • Java (312)
  • Agile (192)
  • General (141)
  • Scrum (70)
  • Testing (65)
  • Architecture (65)
  • Performance (47)
  • Middleware (59)
    • Deployment (40)
  • Xebia Labs (41)
  • SOA (31)
  • Project Management (31)
  • Podcast (31)
  • Tools (28)
  • Uncategorized (24)
  • lean architecture (20)
  • Quality Assurance (19)
  • Articles (15)
  • Requirements Management (14)
  • Virtualization (21)

Tag Cloud

    lean architecture Ajax Architecture Scrum Concurrency Control JPA implementation patterns Hibernate Eclipse Groovy SOA XML ACT TDD Lean JPA Grails Xebia Flex Scala Oracle product owner Maven agile architectuur Java Javascript Spring lean architectuur Frameworks Agile Moving to India

Archives

  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
Avatars by Sterling Adventures