public void OpenNetworkWindow() { Application = Application.Launch(@"C:\Users\Flotschi\git\handle\Handle.WPF\Handle.WPF\bin\Debug\Handle.WPF.exe"); Assert.IsNotNull(Application); MainWindow = Application.GetWindow("Handle"); Assert.IsNotNull(MainWindow); MainWindow.Focus(); Keyboard.LeaveAllKeys(); Keyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL); Keyboard.Enter("n"); NetworkWindow = MainWindow.ModalWindow("Networks"); Assert.IsNotNull(NetworkWindow); Keyboard.LeaveAllKeys(); NetworkWindow.Close(); Application.Kill(); }
public void CKitLaunchAndSOPSearch() { //Run Internet Explorer White.Core.Application IE = White.Core.Application.Launch("C:\\Program Files\\Internet Explorer\\iexplore.exe"); Thread.Sleep(15000); Window IEWindow = IE.GetWindow("Pages - Your Cigna Life - Microsoft Internet Explorer provided by CIGNA-Link", White.Core.Factory.InitializeOption.NoCache); IEWindow.Get <White.Core.UIItems.TextBox>("Address").SetValue("https://cigna.esecurecare.net/"); Thread.Sleep(6000); IEWindow.Get <White.Core.UIItems.TextBox>("Address").Click(); UserInputs.PressEnter(); Thread.Sleep(5000); Window IEModalWindow = IEWindow.ModalWindows()[0]; IEModalWindow.Get <White.Core.UIItems.TextBox>("User name:").SetValue(NunitSettings.InternalId.Substring(9)); IEModalWindow.Get <White.Core.UIItems.TextBox>("Password:"******"OK").Click(); Thread.Sleep(5000); IEWindow.Focus(DisplayState.Restored); Console.WriteLine("Looking for Search Button"); White.Core.UIItems.Button SearchButton = IEWindow.Get <White.Core.UIItems.Button>("Search"); Console.WriteLine("Search button found. Get Clickable Point"); Point SearchClickablePoint = SearchButton.Bounds.TopLeft; SearchClickablePoint.Offset(-100, 10); Mouse.Instance.Click(SearchClickablePoint); Console.WriteLine("Enter RNC"); UserInputs.Enter("RNC"); UserInputs.PressEnter(); Thread.Sleep(3000); White.Core.UIItems.Hyperlink RNCLink = IEWindow.Get <White.Core.UIItems.Hyperlink>("Reimbursement RNC 501 Processing Reference Guide"); RNCLink.Click(); Thread.Sleep(2000); Console.WriteLine("Looking for Search Button on RNC page"); SearchButton = IEWindow.Get <White.Core.UIItems.Button>("Search"); SearchClickablePoint = SearchButton.Bounds.TopLeft; SearchClickablePoint.Offset(-100, 10); Mouse.Instance.Click(SearchClickablePoint); Console.WriteLine("Enter document directory"); UserInputs.Enter("document directory"); UserInputs.PressEnter(); Thread.Sleep(3000); White.Core.UIItems.Hyperlink DocumentDirectory = IEWindow.Get <White.Core.UIItems.Hyperlink>("C KIT Document Directory"); DocumentDirectory.RightClick(); Thread.Sleep(2000); IEWindow.Popup.ItemBy(SearchCriteria.ByText("Open in New Tab")).Click(); Thread.Sleep(5000); UserInputs.PressHotKey((int)VirtualKeys.Control, (int)VirtualKeys.Tab); Thread.Sleep(1000); White.Core.UIItems.Hyperlink DirectoryReport = IEWindow.Get <White.Core.UIItems.Hyperlink>("Directory Report.xls"); DirectoryReport.Click(); Thread.Sleep(2000); Window IEDirectoryReportWindow = IE.GetWindow("https://cigna.esecurecare.net/ci/fattach/get/93710/ - Microsoft Internet Explorer provided by CIGNA-Link"); Window ModalDirectoryReportWindow = IEDirectoryReportWindow.ModalWindow("File Download"); Thread.Sleep(2000); Console.WriteLine("File Download window found"); Console.WriteLine("Press ALT+O"); UserInputs.HotKey(KeyboardInput.SpecialKeys.ALT, "O"); Thread.Sleep(9000); Console.WriteLine("Kill IE"); IE.Kill(); Console.WriteLine("Close Excel"); var allItem = Desktop.Instance.Windows(); foreach (var element in allItem) { if (element.Name.Contains("Microsoft Excel")) { element.Focus(DisplayState.Restored); Thread.Sleep(5000); element.Close(); } } Thread.Sleep(1000); ViPrClass.ExitVipr(); //Stop services Console.WriteLine("Stop Services"); Service.Stop(NunitSettings.ServiceWdName); Service.Stop(NunitSettings.ServiceDttName); // Check all FocusIns List <string> ExpApplications = new List <string>(); ExpApplications.Add("https://cigna.esecurecare.net/app/home"); ExpApplications.Add("https://cigna.esecurecare.net/app/answers/list/search/1/kw/RNC/answers.c$is_healthcare_reform/~any~"); ExpApplications.Add("C-KIT:Reimbursement RNC 501 Processing Reference Guide"); ExpApplications.Add("C-KIT:C KIT Document Directory"); ExpApplications.Add("\"C:\\Program Files\\Microsoft Office XP Standard\\OFFICE11\\EXCEL.EXE\" /e"); Assert.IsTrue(CheckResults.CheckAllFocusIn(ExpApplications)); }
public void TearDown() { application.Kill(); }