void Start() { if (testProcess == null) { EnsureCleanState(); string exe = typeof(Walkabout.MainWindow).Assembly.Location; ResignAssembly(exe); // find the ofx test server, this file is created by the OfxTestServer project. string path = FindFileInParent(Path.GetDirectoryName(exe), "ServerConfig.txt"); string serverExePath = File.ReadAllText(path).Trim(); // start ofx test server string serverExe = Path.Combine(Path.GetDirectoryName(serverExePath), Path.GetFileNameWithoutExtension(serverExePath) + ".exe"); serverProcess = Process.Start(new ProcessStartInfo(serverExe)); serverProcess.WaitForInputIdle(); ofxServerWindow = OfxServerWindowWrapper.FindMainWindow(serverProcess.Id); // start money ProcessStartInfo psi = new ProcessStartInfo(exe, "/nosettings"); testProcess = Process.Start(psi); testProcess.WaitForInputIdle(); window = MainWindowWrapper.FindMainWindow(testProcess.Id); } }
internal void AddOnlineAccounts() { for (int retries = 5; retries > 0; retries--) { foreach (var item in onlineAccounts.GetOnlineAccounts()) { if (item.HasAddButton) { item.ClickAdd(); hasOnlineAccounts = true; string title = "Select Account for: " + item.Id; MainWindowWrapper mainWindow = MainWindowWrapper.FindMainWindow(onlineAccounts.Element.Current.ProcessId); AutomationElement child = mainWindow.Element.FindChildWindow(title, 5); if (child != null) { AccountPickerWrapper picker = new AccountPickerWrapper(child); picker.ClickAddNewAccount(); AutomationElement child2 = mainWindow.Element.FindChildWindow("Account", 5); if (child2 != null) { AccountSettingsWrapper settings = new AccountSettingsWrapper(child2); settings.ClickOk(); } } return; } } Thread.Sleep(1000); } throw new Exception("Where are the online accounts?"); }
void Start() { if (testProcess == null) { EnsureCleanState(); string exe = typeof(Walkabout.MainWindow).Assembly.Location; ResignAssembly(exe); // start ofx test server string serverExe = typeof(OfxTestServer).Assembly.Location; serverProcess = Process.Start(new ProcessStartInfo(serverExe)); serverProcess.WaitForInputIdle(); ofxServerWindow = OfxServerWindowWrapper.FindMainWindow(serverProcess.Id); // start money ProcessStartInfo psi = new ProcessStartInfo(exe, "/nosettings"); testProcess = Process.Start(psi); testProcess.WaitForInputIdle(); window = MainWindowWrapper.FindMainWindow(testProcess.Id); } }