Skip to content

Golem.Purple, Getting Started

sethuster edited this page Nov 11, 2014 · 1 revision

=====

Golem Purple API

Golem supports creating automated tests for Windows desktop applications written in dotNet. Golem.Purple is a completely new framework inspired by TestStack.White. While functionally similar, Golem.Purple uses an entirely different approach to finding automation elements in the application under test. The goal was to make Golem.Purple much faster for finding elements in Windows Forms applications. Golem.Purple also supports WPF, and Silverlight applications. Golem.Purple tests are supported with the same Template design pattern that the WebDriver module uses. Groups of functionality are divided into Screen Objects which are used by test objects to evaluate functionality of the application.

=====

Element Interaction

Purple.Elements can be interacted with as users typically would interact with their base element type. Buttons can be clicked, TextBoxes can be read and set, and tables can be traversed and clicked on. The actions that can be performed on an element are limited by their type.

Test Objects

As mentioned, Windows UI automation tests using Golem.Purple use the Screen Objects created by the engineer to perform the actions needed for the functionality being tested. Golem.Purple tests must also contain information to facilitate the starting of the application being tested, as well as identify the main window launched by that application.

Test Setup

Each test object needs to set the Config.Settings.purpleSettings.appPath and the PurpleTestBase.window value before a test can be initiated. This can be handled with MbUnit or NUnit in the Test object. Note that the title of the main window, as seen by Inspect.exe, should be used to set up the window in the PurpleTestbase object.

Example:

[FixtureInitializer]
 public void Setup()
 {
    Config.Settings.purpleSettings.appPath = "C:\\Program Files\\ProtoTest\\AwesomeSauce.exe";
 }

 [SetUp]
 public void setup()
 {
   PurpleTestBase.window = new PurpleWindow("ProtoTest's AwesomeSauce™");
 }