Search code examples
c#visual-studiowhite-framework

Is it necessary to have Visual Studio Enterprise licence to use Teststack.White for UI Automation?


To run coded UI tests using visual studio (2017) it is necessary to have the Enterprise license.

Does anybody know it this applies to TestStack.White framework?

I am having issues getting it up and running on a test project where I am getting the following error:

"System.ComponentModel.Win32Exception: The system cannot find the file specified"

Code :

[TestClass()]
public class MainWindowTests
{
    private static TestContext _testContext;

    [ClassInitialize]
    public static void Setup(TestContext testContext)
    {
        _testContext = testContext;
    }

    [TestMethod()]
    public void MainWindowTest()
    {
        var applicationDirectory = _testContext.DeploymentDirectory;
        var applicationPath = Path.Combine(applicationDirectory, "TestApp.exe");
        var application = Application.Launch(applicationPath);
        Window window = application.GetWindow("MainWindow");

        var button = window.Get<TestStack.White.UIItems.Button>();
        var label = window.Get<TestStack.White.UIItems.Label>();

        Assert.AreEqual(label.Text, ""); 

        button.Click();

        Assert.AreEqual(label.Text, "");
    }
}

Solution

  • No, a Visual Studio Enterprise license is not required to use TestStack White for UI automation.

    In a previous role, the company used White for automating testing of a WPF application, and the developers did not have Visual Studio Enterprise.

    Are you certain the path being constructed for launching the application is correct?