Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.


DotNetNuke Automated GUI Testing

The DotNetNuke Quality Team has been working on Automated GUI Testing for several months now. A project has of course been created on CodePlex. Tools of choice are Gallio, MbUnit and WatiN. We’ve been lucky to get Jeroen van Menen aboard the project, as he is the creator and leader of the WatiN project. You will need to install Gallio and MbUnit before you start. Installing WatiN is also a good idea, but since the binaries are included, that’s not strictly nessecary.

In this post, I’ll be showing how to get started with the DotNetNue Automation Project, ultimately to be able to start writing your own automated tests.

Step 1: get the sources

You need to get the sourcefiles of the CodePlex project. Personally, I prefer to use Tortoise and SVN to connect to CodePlex:

image  image

As you can see I’m using a checkout command to get the sources. Since the download is almost 40MB, it might take a few minutes to download.

What we have now, is a folder containing all the sources:

image

 Step 2: Open the solution

Next, we’ll open up the solution DotNetNuke_WatiN_Tests which resides in the root of the AutomationTests folder. If you don’t have TFS Explorer installed, you’ll get a warning about that because the are TFS bindings in the solution:

image

Step 3: Set up the environment

image In the solution explorer, navigate to the DotNetNuke.Tests.WatiN project and open up the app.config file. Without getting into all the details of the configuration file, there’s a few elements we need to have a look at.

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <configuration>
  3.   <appSettings>
  4.     <!--Site Settings-->
  5.     <add key="SiteURL" value="http://localhost/DNN_522/"/>
  6.  
  7.     <!--Browser Settings-->
  8.     <add key="SilentMode" value="False"/>
  9.     <add key="IETimeOut" value="180"/>
  10.     <add key="AutoCloseIE" value="True"/>
  11.     
  12.     <!--Database Settings-->
  13.     <add key="DatabaseName" value="DNN_522_Test"/>    
  14.     <add key="DatabaseServer" value="(local)"/>
  15.     
  16.     <!--Videos & Screen Capture Settings-->
  17.     <add key="VideoEnabled" value="False"/>
  18.     <add key="ScreenCaptureEnabled" value="False"/>
  19.     <add key="VideoZoom" value="0.25"/>
  20.     <add key="VideoFramesPerSec" value="5"/>
  21.     <add key="CaptionFontSize" value="26"/>
  22.     
  23.     <!--Test File Locations-->
  24.     <add key="TestRoot" value="D:\Tests"/>
  25.     <add key="WebsitePath" value="Websites"/>
  26.     <add key="PackagePath" value="Packages"/>
  27.     <add key="DatabasePath" value="D:\\TestDatabases"/>
  28.   </appSettings>
  29. </configuration>

First, there’s the SiteURL settings. Although you can of course change the setting to suit your own needs, I’ll just stick to this one and create a brand new DotNetNuke CE 5.2.2 installation at this URL.

The same goes for the database: while I could create a database with any name, I’ll take the easy way out here and just name it DNN_522_Test. You might want to change the DatabaseServer setting too by the way.

Next we’ll need to make sure the test file location settings are correct. Since I don’t have a D drive, I’ll have to change these settings. You can choose to name your path without drive specification, in which case it will be assumed to be a subfolder of TestRoot, or specify a fully qualified path.

Finally, we need to put the “clean” database files in the folder specified in “DatabasePath”. This is used to assure that the tests are always run on the same DotNetNuke installation, and that it doesn’t get “dirty” from running tests over and over again. De files we need to copy to the folder, are the detached databasefiles. If you navigate to your database in SQL Server Management Studio, right-click it, then Tasks, then Detach to get the Detach Database dialog. Make sure you know where those files are before you detach them. You can find that out on the Database Properties Dialog:

image

Once you have detached the files, you can copy them to the “DatabasePath” folder and Attach the database files again in SSMS.

Step 4: Test!

image

imageI chose to click the Gallio icon next to the class declaration for the LoginTests class to run the tests. After some compiling you will notice that Internet Explorer will run and navigate to your test site. After all tests are completed you can read the test report to see if anything went wrong.

In my case, on of the tests failed but that’s just a minor detail…

 

Step 5: Write your own test!

Using this setup, you can easily start writing your own test. We encourage you to do so. Let’s hear about all the great tests your wrote and keep running them on each and every beta release of DotNetNuke.

Comments

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Daniels (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (108)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (181)
Daniel Valadas (48)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (17)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (4)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (40)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patricio F. Salinas (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott Schlesier (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (180)
William Severance (5)
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out