Aaron Jensen

Sponsors

The Lounge

Advertisement

Advanced Selenium RC logging with MSpec

Today I pushed some new features to MSpec to allow you to see this in MSpec’s html report when you get Selenium RC failures:

2009-10-19_1810

This is very similar to ruby’s selenium client’s rspec report. You can see a real example of that here.

So how do you get this? It’s pretty easy. All you need to do is grab and build the latest MSpec, add a reference to Machine.Specifications.SeleniumSupport.dll and add a class like the following to your assembly that contains your selenium specs in it:

  public class SeleniumSupport : SeleniumResultSupplementer
  {
    protected override string ImagesPath
    {
      get { return GetTempPath(); }
    }

    protected override DefaultSelenium Selenium
    {
      get { return ...; } // Replace with the DefaultSelenium in use 
                          // by the current running spec
    }

    static string tempPath;

    private static string GetTempPath()
    {
      if (string.IsNullOrEmpty(tempPath))
      {
        tempPath = Path.Combine(Path.GetTempPath(), "selenium");

        if (Directory.Exists(tempPath))
        {
          Directory.Delete(tempPath, true);
        }

        Directory.CreateDirectory(tempPath);
      }

      return tempPath;
    }
  }

That's pretty much it. Like I said, this is brand new, just got it up today so please let me know if you have any problems with it. You can do so on twitter or the machine google group. Enjoy!


Posted Mon, Oct 19 2009 6:30 PM by aaronjensen
Filed under: ,

[Advertisement]

Comments

PimpThisBlog.com wrote Advanced Selenium RC logging with MSpec
on Tue, Oct 20 2009 1:06 PM

Thank you for submitting this cool story - Trackback from PimpThisBlog.com

Aaron Jensen wrote MSpec v0.3
on Wed, Nov 18 2009 1:20 PM

It’s been more or less forever since I’ve incremented the version number of MSpec so I went ahead and

Add a Comment

(required)  
(optional)
(required)  
Remember Me?