Today I got a demo of a tool called Ranorex Studio, a test automation product built using the SharpDevelop IDE. Aside from the IDE, I last played with in the early days of the SharpDevelop project, the most interesting aspect was the Ranorex C# framework with that provides the basis of modeling UI elements in a manner similar to Zombie’s GEM framework. Tests can be written in C#, VB.NET or Iron Python using the framework to build tests. To give you a taste of this kind of "model" binding here is fragment from a typed class that models Windows Calc:
/// <summary>
/// The FormCalculatorAppFolder folder.
/// </summary>
public class FormCalculatorAppFolder : RepoGenBaseFolder
{
/// <summary>
/// Creates a new FormCalculator folder.
/// </summary>
public FormCalculatorAppFolder(RepoGenBaseFolder appFolder) :
base("FormCalculator", "/form[@title='Calculator' or @title='Rechner']", appFolder, 3000, true)
{
}
/// <summary>
/// The ButtonAsterisk item.
/// </summary>
public virtual Ranorex.Button ButtonAsterisk
{
get
{
return CreateAdapterForPath<Ranorex.Button>("ButtonAsterisk", "button[@text='*']", 5000, null);
}
}
/// <summary>
/// The Button3 item.
/// </summary>
public virtual Ranorex.Button Button3
{
get
{
return CreateAdapterForPath<Ranorex.Button>("Button3", "button[@text='3']", 5000, null);
}
}
/// <summary>
/// The ButtonEqual item.
/// </summary>
public virtual Ranorex.Button ButtonEqual
{
get
{
return CreateAdapterForPath<Ranorex.Button>("ButtonEqual", "button[@text='=']", 5000, null);
}
}
/// <summary>
/// The OutputText item.
/// </summary>
public virtual Ranorex.Text OutputText
{
get
{
return CreateAdapterForPath<Ranorex.Text>("OutputText", "text[@controlid='403']", 5000, null);
}
}
/// <summary>
/// The ButtonClose item.
/// </summary>
public virtual Ranorex.Button ButtonClose
{
get
{
return CreateAdapterForPath<Ranorex.Button>("ButtonClose", "titlebar/button[@accessiblename='Close' or @accessiblename='Schließen']", 5000, null);
}
}
/// <summary>
/// The Button7 item.
/// </summary>
public virtual Ranorex.Button Button7
{
get
{
return CreateAdapterForPath<Ranorex.Button>("Button7", "button[@text='7']", 5000, null);
}
}
/// <summary>
/// The ButtonMinus item.
/// </summary>
public virtual Ranorex.Button ButtonMinus
{
get
{
return CreateAdapterForPath<Ranorex.Button>("ButtonMinus", "button[@text='-']", 5000, null);
}
}
/// <summary>
/// The Self item.
/// </summary>
public virtual Ranorex.Form Self
{
get
{
return CreateAdapterForPath<Ranorex.Form>("Self", "", 3000, null);
}
}
}
Notice in this example methods of class FormCalculatorAppFolder use XPATH regular expressions to “bind” their respective UI element which I think this is an interesting approach with a lot of flexibility. Also notice the idea here is similar to that of strongly typed dataset for data access. The tool provides a set of “adapters” which are used to drive various types of UI at varying degrees of accessibility (WinAPI, .NET, Web, MSAA).
I haven’t had enough time using the tool or framework to draw a conclusion as to the validity of the approach or quality of implementation but I have seen a few unexpected error dialogs which are things that will need to be fixed right away.
Are you familiar with or have you used this tool? If so, what do you think?
If not, what tools are you using for GUI automation?