White.NUnit as UI Testing tool

Got suggestion from JP, looking at White.NUnit as our UI testing tool, I’m surprised that it didn’t take too long to figure it out:

First difference this is different than Phantom UI test is, we have to write test cases in VS which we love to. Here is the sample code to test the calculator.

using NUnit.Framework;
using White.Core;
using White.Core.Factory;
using White.Core.UIItems;
using White.Core.UIItems.Finders;
using White.Core.UIItems.WindowItems;

namespace solution
    public class CalcTests
        private Application application;

        public void Setup()
            application = Application.Launch("calc.exe");

        public void TearDown()

        public void should_launch_calculator()

        public void should_do_a_simple_add_operation()

            Window window = application.GetWindow("Calculator", InitializeOption.NoCache);

            var result = window.Get<Label>(SearchCriteria.ByText("1"));

            Assert.AreEqual("4", result.Text);



  1. use White.recorder generate class function to get the actual control name.
  2. use SearchCriteria to find the control.

I found that White doesn’t know Datawindow control. For PB developer,they have to turn to IBM rational Robot or HP QuickTestPro, and learn another test script language other than C#.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s