using System;using TestStack.White;using TestStack.White.Factory;using TestStack.White.UIItems.Finders;using TestStack.White.InputDevices;
namespace ConsoleApp1{ class Program { private const string ExeSourceFile = @"C:\Windows\System32\calc.exe"; //Global Variable to for Application launch private static TestStack.White.Application _application; //Global variable to get the Main window of calculator from application. private static TestStack.White.UIItems.WindowItems.Window _mainWindow;
static void Main(string[] args) { Console.WriteLine("Hello World!\n" + ExeSourceFile); var psi = new System.Diagnostics.ProcessStartInfo(ExeSourceFile); TestStack.White.Application _application = TestStack.White.Application.AttachOrLaunch(psi); } }}
using NUnit.Framework;using TestStack.White;using TestStack.White.Factory;using TestStack.White.UIItems.Finders;using TestStack.White.InputDevices;
namespace NUnitTestProject1{ public class Tests { private const string ExeSourceFile = @"C:\Windows\System32\calc.exe"; //Global Variable to for Application launch private static TestStack.White.Application _application; //Global variable to get the Main window of calculator from application. private static TestStack.White.UIItems.WindowItems.Window _mainWindow;
[SetUp] public void Setup() { System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(ExeSourceFile); _application = TestStack.White.Application.AttachOrLaunch(psi); }
[Test] public void Test1() { Assert.Pass(); } }}Test Name: Test1Test FullName: NUnitTestProject1.NUnitTestProject1.Tests.Test1Test Source: C:\Users\tester\Documents\amax\poc2\NUnitTestProject1\UnitTest1.cs : line 27Test Outcome: FailedTest Duration: 0:00:00
Test Name: Test1Test Outcome: FailedResult StackTrace: at TestStack.White.Application.Launch(ProcessStartInfo processStartInfo) at TestStack.White.Application.AttachOrLaunch(ProcessStartInfo processStartInfo) at NUnitTestProject1.Tests.Setup() in C:\Users\tester\Documents\amax\poc2\NUnitTestProject1\UnitTest1.cs:line 23Result Message: System.IO.FileNotFoundException : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.