Exemplo n.º 1
0
        public void NistTest(string name, string expected_label_id)
        {
            // This opens a HashCheck Verify window in the current process
            Process.Start(Path.Combine(common.PATH_PREFIX, name));

            var verify_window = common.app.GetWindow(name);

            try
            {
                // Wait for hashing to complete (there are 0 pending results)
                var   re0             = new System.Text.RegularExpressions.Regex(@"\b0\b");
                Label pending_results = verify_window.Get <Label>(SearchCriteria.ByNativeProperty(
                                                                      AutomationElement.AutomationIdProperty, IDC_PENDING_RESULTS));
                while (!re0.IsMatch(pending_results.Text))
                {
                    System.Threading.Thread.Sleep(0);
                }

                // On success, the expected label should read "# of #" where the #'s are the same
                Label match_results = verify_window.Get <Label>(SearchCriteria.ByNativeProperty(
                                                                    AutomationElement.AutomationIdProperty, expected_label_id));
                Assert.Matches(@"\b(\d+)\b.*\b\1\b", match_results.Text);
            }
            finally
            {
                verify_window.Close();
            }
        }
Exemplo n.º 2
0
        public string SelectKM()
        {
            Panel    TaskType = advanceSearch.Get <Panel>(SearchCriteria.ByAutomationId("ehKnowledgeSpecialist"));
            ComboBox cb       = TaskType.Get <ComboBox>(SearchCriteria.ByAutomationId("CheckableCombo"));//.Click();

            return(cb.Items[1].Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Agarwal, Ankita")).ToString());
        }
Exemplo n.º 3
0
        public Hyperlink OpenWorkspace(Window gMTWindow, string WorkspaceName)
        {
            win = gMTWindow;
            IUIItem leftPane = win.Get(SearchCriteria.ByAutomationId("workspaceSplitter"));

            return(leftPane.Get <Hyperlink>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, WorkspaceName)));
        }
Exemplo n.º 4
0
 public void TestToString()
 {
     Assert.That(SearchCriteria.ByText("bar").AndAutomationId("foo").ToString(), Is.EqualTo("AutomationId=foo,Name=bar"));
     Assert.That(SearchCriteria.ByText("bar").AndAutomationId("foo").AndIndex(1).ToString(), Is.EqualTo("AutomationId=foo,Name=bar,Index=1"));
     //ByNativePropertyTests...
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.NameProperty, "blah").ToString(), Is.EqualTo("AutomationElementIdentifiers.NameProperty=blah"));
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, true).ToString(), Is.EqualTo("AutomationElementIdentifiers.IsControlElementProperty=True"));
 }
Exemplo n.º 5
0
 public void runSavedReport()
 {
     if (rptWin.Exists(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Report 1")) == true)
     {
         rptWin.Get(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Report 1")).Click();
         rptWin.Get(SearchCriteria.ByAutomationId("btnRun")).Click();
     }
     else
     {
         throw new Exception("No Saved Report View Exsist. Please create a saved view");
     }
 }
Exemplo n.º 6
0
        void GetControlBasedOnIndex(WindowsFramework framework)
        {
            using (var window = StartScenario("GetMultipleButton", "GetMultiple"))
            {
                var button = window.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(0));
                Assert.NotNull(button);

                var exception = Assert.Throws <AutomationException>(() => MainWindow.Get <TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(4)));
                var expected  = framework == WindowsFramework.Wpf?
                                "Failed to get ControlType=edit,AutomationElementIdentifiers.NameProperty=Button,Index=4":
                                "Failed to get (ControlType=edit or ControlType=document),AutomationElementIdentifiers.NameProperty=Button,Index=4";
                Assert.Equal(expected, exception.Message);
            }
        }
Exemplo n.º 7
0
 public void Equals()
 {
     Assert.AreEqual(SearchCriteria.ByAutomationId("foo"), SearchCriteria.ByAutomationId("foo"));
     Assert.AreNotEqual(SearchCriteria.ByText("foo"), SearchCriteria.ByAutomationId("foo"));
     Assert.AreEqual(SearchCriteria.ByFramework(Constants.Win32FrameworkId), SearchCriteria.ByFramework(Constants.Win32FrameworkId));
     Assert.AreNotEqual(SearchCriteria.ByFramework(Constants.WinFormFrameworkId), SearchCriteria.ByFramework(Constants.Win32FrameworkId));
     Assert.AreEqual(SearchCriteria.ByAutomationId("foo").AndByText("bar"), SearchCriteria.ByAutomationId("foo").AndByText("bar"));
     Assert.AreEqual(SearchCriteria.ByText("bar").AndAutomationId("foo"), SearchCriteria.ByAutomationId("foo").AndByText("bar"));
     //ByNativePropertyTests...
     Assert.AreEqual(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "blah"), SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "blah"));
     Assert.AreNotEqual(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "blah"), SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "blah1"));
     Assert.AreEqual(SearchCriteria.ByNativeProperty(AutomationElement.IsControlElementProperty, true), SearchCriteria.ByNativeProperty(AutomationElement.IsControlElementProperty, true));
     Assert.AreNotEqual(SearchCriteria.ByNativeProperty(AutomationElement.IsControlElementProperty, true), SearchCriteria.ByNativeProperty(AutomationElement.IsControlElementProperty, false));
     Assert.AreNotEqual(SearchCriteria.ByNativeProperty(AutomationElement.IsControlElementProperty, true), SearchCriteria.ByNativeProperty(AutomationElement.IsDockPatternAvailableProperty, true));
 }
Exemplo n.º 8
0
 public void EqualsTests()
 {
     Assert.That(SearchCriteria.ByAutomationId("foo"), Is.EqualTo(SearchCriteria.ByAutomationId("foo")));
     Assert.That(SearchCriteria.ByText("foo"), Is.Not.EqualTo(SearchCriteria.ByAutomationId("foo")));
     Assert.That(SearchCriteria.ByFramework(WindowsFramework.Win32.FrameworkId()), Is.EqualTo(SearchCriteria.ByFramework(WindowsFramework.Win32.FrameworkId())));
     Assert.That(SearchCriteria.ByFramework(WindowsFramework.WinForms.FrameworkId()), Is.Not.EqualTo(SearchCriteria.ByFramework(WindowsFramework.Win32.FrameworkId())));
     Assert.That(SearchCriteria.ByAutomationId("foo").AndByText("bar"), Is.EqualTo(SearchCriteria.ByAutomationId("foo").AndByText("bar")));
     Assert.That(SearchCriteria.ByAutomationId("foo").AndByText("bar"), Is.EqualTo(SearchCriteria.ByText("bar").AndAutomationId("foo")));
     //ByNativePropertyTests...
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.NameProperty, "blah"), Is.EqualTo(SearchCriteria.ByNativeProperty(AutomationObjectIds.NameProperty, "blah")));
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.NameProperty, "blah"), Is.Not.EqualTo(SearchCriteria.ByNativeProperty(AutomationObjectIds.NameProperty, "blah1")));
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, true), Is.EqualTo(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, true)));
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, true), Is.Not.EqualTo(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, false)));
     Assert.That(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsControlElementProperty, true), Is.Not.EqualTo(SearchCriteria.ByNativeProperty(AutomationObjectIds.IsDockPatternAvailableProperty, true)));
 }
Exemplo n.º 9
0
        public void GetControlBasedOnIndexTest()
        {
            using (var window = StartScenario("GetMultipleButton", "GetMultiple"))
            {
                var button = window.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(0));
                Assert.That(button, Is.Not.Null);

                var expected = Framework == WindowsFramework.Wpf ?
                               "Failed to get ControlType=edit,AutomationElementIdentifiers.NameProperty=Button,Index=4" :
                               "Failed to get (ControlType=edit or ControlType=document),AutomationElementIdentifiers.NameProperty=Button,Index=4";

                Assert.That(() => { MainWindow.Get <TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button").AndIndex(4)); },
                            Throws.TypeOf <AutomationException>().With.
                            Message.EqualTo(expected));
            }
        }
Exemplo n.º 10
0
        void VerifyResults(Window prop_window, string expected_results)
        {
            // Wait for hashing to complete (status contains a summary instead of "Progress")
            GroupBox status = prop_window.Get <GroupBox>(SearchCriteria.ByNativeProperty(
                                                             AutomationElement.AutomationIdProperty, IDC_STATUSBOX));

            while (status.Name == "Progress")
            {
                System.Threading.Thread.Sleep(100);
            }

            // Verify the results
            TextBox results = prop_window.Get <TextBox>(SearchCriteria.ByNativeProperty(
                                                            AutomationElement.AutomationIdProperty, IDC_RESULTS));

            Assert.Equal(expected_results, results.BulkText, true, true, true);  // ignores case, line endings and whitespace changes
        }
Exemplo n.º 11
0
        // Workaround for ViPr.
        // 1. Click ok button in the Invalid Proclaim Payment Password.
        // 2. Choose Acceptance Testing.
        // 3. Login.
        private static void ViPrHack()
        {
            // Close invalid password dialog
            Window ViPr = getViprWindow();

            ViPr.Get <Button>(SearchCriteria.ByText("OK")).Click();
            Thread.Sleep(20000);

            Panel operatorPanel = ViPr.Get <Panel>(SearchCriteria.ByText("Workspace"));

            operatorPanel.Get(SearchCriteria.ByAutomationId("DropDown")).Click();
            Thread.Sleep(3000);
            operatorPanel.Get(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Acceptance Testing")).Click();
            Thread.Sleep(3000);

            operatorPanel.Get <Button>(SearchCriteria.ByText("Ok")).Click();
            Thread.Sleep(30000);
        }
Exemplo n.º 12
0
        public void ClickContentWorkpanel(ContentWorkPanel panelName)
        {
            switch (panelName)
            {
            case ContentWorkPanel.Terms: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Terms")).Click(); break;

            case ContentWorkPanel.KS: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "KS")).Click(); break;

            case ContentWorkPanel.Contacts: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Contacts")).Click(); break;

            case ContentWorkPanel.ContentDetails: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Content Details")).Click(); break;

            case ContentWorkPanel.Notes: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Notes")).Click(); break;

            case ContentWorkPanel.ReviewContent: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Review Content")).Click(); break;

            case ContentWorkPanel.DocumentOption: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Document Option")).Click(); break;

            case ContentWorkPanel.CaseCode_ClientName: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Case Code(s)/Client Name(s)")).Click(); break;
            }
        }
Exemplo n.º 13
0
        private void GetMultipleButtons(WindowsFramework framework)
        {
            MainWindow.Get <Button>("GetMultipleButton").Click();
            var window = MainWindow.ModalWindow("GetMultiple");

            try
            {
                var buttons = window.GetMultiple(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button")).OfType <Button>();
                Assert.AreEqual(3, buttons.Count());

                if (framework == WindowsFramework.Wpf)
                {
                    buttons = window.GetMultiple(SearchCriteria.ByAutomationId("Test")).OfType <Button>();
                    Assert.AreEqual(3, buttons.Count());
                }

                var checkboxes = window.GetMultiple(SearchCriteria.ByControlType(ControlType.CheckBox)).OfType <CheckBox>();
                Assert.AreEqual(3, checkboxes.Count());

                checkboxes = window.GetMultiple(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Checkbox")).OfType <CheckBox>();
                Assert.AreEqual(3, checkboxes.Count());

                if (framework == WindowsFramework.Wpf)
                {
                    checkboxes = window.GetMultiple(SearchCriteria.ByAutomationId("Test2")).OfType <CheckBox>();
                    Assert.AreEqual(3, checkboxes.Count());
                }

                if (framework == WindowsFramework.Wpf)
                {
                    var customControls = window.GetMultiple(SearchCriteria.ByClassName("CustomItem"));

                    Assert.AreEqual(3, customControls.Length);
                }
            }
            finally
            {
                window.Close();
            }
        }
Exemplo n.º 14
0
        public void CheckInsightTabXcl()
        {
            /////////////////////////////////
            /////  This Test will Filter out Insights on basis of KS selected in Browse Queue
            /////  It will export excel and verify some excel is opened realing to same.
            //////////////////////////////
            logger.Debug("STARTED RUNNING TEST CASE: " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.Info("Get Application window");
            gmtTab.OpenTab(gMTWindow, "Insights").Click();
            insightScreen1.getTabWin(gMTWindow);
            logger.Info("Select Insight Tab");

            insightScreen1.SelectBasicSearchOptions(InsightBaseFilter.browseQueue, "Chopra, Mitali");
            logger.Info("Apply filter to Browse Queue");

            Panel output = insightScreen1.GetInsightResult();

            logger.Info("Fetch Results");
            gMTWindow.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Export")).Click();
            logger.Info("Click to Open Excel");
            Verify_Excel();
        }
Exemplo n.º 15
0
        public void CheckProposalTabXcl()
        {
            /////////////////////////////////
            /////  This Test will Filter out Insights on basis of Ind/Cap filter.
            /////  It will export excel and verify some excel is opened realing to same.
            //////////////////////////////
            logger.Debug("STARTED RUNNING TEST CASE: " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.Info("Get Application window");
            gmtTab.OpenTab(gMTWindow, "Proposals").Click();
            proposalScreen1.getTabWin(gMTWindow);
            logger.Info("Select Proposals Tab");

            proposalScreen1.SelectBasicSearchOptions(ProposalBaseFilter.clientName, "Cigna");
            logger.Info("Apply filter ClientName=Cigna");

            Panel output = proposalScreen1.GetProposalResult();

            logger.Info("Fetch Results");
            gMTWindow.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Export")).Click();
            logger.Info("Click to Open Excel");
            Verify_Excel();
        }
Exemplo n.º 16
0
        public void AddContact(contact search, string keyword)
        {
            advanceSearch.Get <Button>(SearchCriteria.ByAutomationId("btnEmployees")).Click();
            Window addContactWin = advanceSearch.ModalWindow("Add Contact");
            //Panel empSearch = addContactWin.Get<Panel>(SearchCriteria.ByAutomationId("panLeft"));
            contact c = search;

            switch (c)
            {
            case contact.Employee:
                addContactWin.Get <RadioButton>(SearchCriteria.ByAutomationId("optEmployeeLastName")).Click();
                addContactWin.Get(SearchCriteria.ByAutomationId("txtLastName")).SetValue(keyword);
                break;

            case contact.CaseCode:
                addContactWin.Get <RadioButton>(SearchCriteria.ByAutomationId("optCaseCode")).Click();
                addContactWin.Get(SearchCriteria.ByAutomationId("txtCaseCode")).SetValue(keyword);
                addContactWin.Get <Button>(SearchCriteria.ByAutomationId("btnSearch")).Click();
                addContactWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Select All")).Click();
                break;

            case contact.Office:
                addContactWin.Get <RadioButton>(SearchCriteria.ByAutomationId("optEmployeeOffice")).Click();
                addContactWin.Get <ComboBox>(SearchCriteria.ByAutomationId("cboEmployeeOffice")).SetValue(keyword);
                addContactWin.Get <Button>(SearchCriteria.ByAutomationId("btnSearch")).Click();
                addContactWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Select All")).Click();
                break;

            case contact.All:
                addContactWin.Get <RadioButton>(SearchCriteria.ByAutomationId("optAll")).Click();
                break;

            default:
                addContactWin.Get <RadioButton>(SearchCriteria.ByAutomationId("btnCancel")).Click();
                break;
            }

            addContactWin.Get <Button>(SearchCriteria.ByAutomationId("btnSave")).Click();
        }
Exemplo n.º 17
0
        public void CheckCaseTabXcl()
        {
            /////////////////////////////////
            /////  This Test will Filter out Cases on basis of Client NAme
            /////  It will export excel and verify some excel is opened realing to same.
            //////////////////////////////
            logger.Debug("STARTED RUNNING TEST CASE: " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.Info("Get window");

            gmtTab.OpenTab(gMTWindow, "Cases").Click();
            caseScreen1.getTabWin(gMTWindow);
            logger.Info("Open Case Tab");
            caseScreen1.SelectBasicSearchOptions(CaseBaseFilter.clientName, "Cigna");
            logger.Info("Apply Client Name basic filter");

            Panel output = caseScreen1.GetCasesResult();

            logger.Info("Fetch Results");
            gMTWindow.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Export")).Click();
            logger.Info("Click to Open Excel");
            Verify_Excel();
        }
Exemplo n.º 18
0
        public void GetMultipleButtonsTest()
        {
            MainWindow.Get <Button>("GetMultipleButton").Click();
            var window = MainWindow.ModalWindow("GetMultiple");

            try
            {
                var buttons = window.GetMultiple(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Button")).OfType <Button>().ToList();
                Assert.That(buttons, Has.Count.EqualTo(3));

                if (Framework == WindowsFramework.Wpf)
                {
                    buttons = window.GetMultiple(SearchCriteria.ByAutomationId("Test")).OfType <Button>().ToList();
                    Assert.That(buttons, Has.Count.EqualTo(3));
                }

                var checkboxes = window.GetMultiple(SearchCriteria.ByControlType(ControlType.CheckBox)).OfType <CheckBox>().ToList();
                Assert.That(checkboxes, Has.Count.EqualTo(3));

                checkboxes = window.GetMultiple(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Checkbox")).OfType <CheckBox>().ToList();
                Assert.That(checkboxes, Has.Count.EqualTo(3));

                if (Framework == WindowsFramework.Wpf)
                {
                    checkboxes = window.GetMultiple(SearchCriteria.ByAutomationId("Test2")).OfType <CheckBox>().ToList();
                    Assert.That(checkboxes, Has.Count.EqualTo(3));
                }

                if (Framework == WindowsFramework.Wpf)
                {
                    var customControls = window.GetMultiple(SearchCriteria.ByClassName("CustomItem")).ToList();
                    Assert.That(customControls, Has.Count.EqualTo(3));
                }
            }
            finally
            {
                window.Close();
            }
        }
Exemplo n.º 19
0
        public void ClickCaseWorkpanel(CaseWorkPanel panelName)
        {
            switch (panelName)
            {
            case CaseWorkPanel.CaseDetails: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Case Details")).Click(); break;

            case CaseWorkPanel.ContentRequested: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Content Requested")).Click(); break;

            case CaseWorkPanel.KS: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "KS")).Click(); break;

            case CaseWorkPanel.Outreach: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Outreach")).Click(); break;

            case CaseWorkPanel.Priority: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Priority")).Click(); break;

            case CaseWorkPanel.RequestServed: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Request Served")).Click(); break;

            case CaseWorkPanel.SimilarContentSubmission: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Similar Content & Submissions")).Click(); break;

            case CaseWorkPanel.TasksNotes: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Tasks & Notes")).Click(); break;

            case CaseWorkPanel.Terms: gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Terms")).Click(); break;
            }
        }
Exemplo n.º 20
0
        public void ClickContentType(contentType checkItem)
        {
            switch (checkItem)
            {
            case contentType.Cases:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Cases")).Click();
                break;

            case contentType.Employees:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Employees")).Click();
                break;

            case contentType.HomePages:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Home Pages")).Click();
                break;

            case contentType.Insights:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Insights")).Click();
                break;

            case contentType.Lists:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Lists")).Click();
                break;

            case contentType.PracticeAreaPages:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Practice Area Pages")).Click();
                break;

            case contentType.Proposals:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Proposals")).Click();
                break;

            case contentType.Taxonomies:
                gmtWin.Get <CheckBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Taxonomies")).Click();
                break;
            }
        }
Exemplo n.º 21
0
 public void getSavedReport()
 {
     rptWin.Get <TreeNode>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "My Reports")).Click();
 }
Exemplo n.º 22
0
 public bool ChkIfNoRecordFound()
 {
     return(gmtWin.Exists(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "No Record Selected")));
 }
Exemplo n.º 23
0
        void viprActions_case04()
        {
            Window viprWindow = Vipr.getViprWindow();

            // Press F2
            AT.PressF2();
            Thread.Sleep(10000);

            // Enter doc. Number: 0431202304001
            // Enter SSN: 9
            Program.SetDocNumberAndSN("0431202304001", "9");

            // Press ‘Alt+A’
            Program.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            Thread.Sleep(5000);

            //Run Extra emulator for Session 6 from the Desktop
            //Login to CED z420/#happy06
            //CED – From Session 2 -> File -> Open Session (Session6)
            Window session2 = CorkBoard.getWindow("SESSION2 - EXTRA!");

            session2.Focus(DisplayState.Restored);
            Thread.Sleep(1000);

            Program.HotKey(KeyboardInput.SpecialKeys.ALT, "f");
            Thread.Sleep(1000);

            AT.PressKey((int)VirtualKeys.O);
            Thread.Sleep(1000);

            session2.Get <White.Core.UIItems.TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "File name:")).SetValue("Session6.edp");
            Thread.Sleep(1000);

            session2.Get(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Open")).Click();
            Thread.Sleep(1000);

            //Enter application: 'EBDAA08' - > Enter
            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "e");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "b");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "d");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "a");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "a");
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad8);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Return);
            Thread.Sleep(500);

            //Enter ACF2 ID -> Tab -> password -> Enter

            //q054", "#happy07"

            AT.PressKey((int)VirtualKeys.Q);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad5);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad4);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Tab);
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "3");
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.H);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.A);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.P);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.P);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Y);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad7);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Return);
            Thread.Sleep(500);

            //Enter gomm -> Enter



            //// Press ‘Alt+A’
            //Program.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            //Thread.Sleep(5000);

            //// Press ‘O’ to set disposition code
            //AT.PressKey((int)VirtualKeys.O);
            //Thread.Sleep(5000);

            //// Press ‘Alt+A’
            //Program.HotKey(KeyboardInput.SpecialKeys.ALT, "A");
            //Thread.Sleep(5000);

            //// Press ‘Ctrl+M’
            //Program.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            //Thread.Sleep(5000);

            //// Press ‘M’ to set disposition code
            //AT.PressKey((int)VirtualKeys.M);
            //Thread.Sleep(5000);

            //// Press ‘Ctrl+M’
            //Program.HotKey(KeyboardInput.SpecialKeys.CONTROL, "M");
            //Thread.Sleep(5000);

            // TBD :
            //Switch  to Session6 -> F12 -> Enter
            //Close Session 6 by pressing X
        }
Exemplo n.º 24
0
        static void Main(string[] args)
        {
            for (int i = 0; i < Convert.ToInt32(args[1]); i++)
            {
                StreamWriter file2     = new StreamWriter(@"e:\RunningTimeWhiteLogin.txt", true);
                Stopwatch    stopwatch = Stopwatch.StartNew(); //creates and start the instance of Stopwatch

                var psi = new ProcessStartInfo(@"C:\\Users\\pth\\AppData\\Local\\Personify\\Omni\\Personify.exe");
                TestStack.White.Application app = TestStack.White.Application.AttachOrLaunch(psi);
                int    numWaits = 0;
                Window window;
                do
                {
                    Console.WriteLine("\n Looking for Chat application...");
                    // Find window with title "Personify"
                    window = app.GetWindow("Personify", TestStack.White.Factory.InitializeOption.NoCache);
                    ++numWaits;
                    Thread.Sleep(100);
                } while (window == null && numWaits < 50);
                Assert.IsNotNull(window);
                TestStack.White.UIItems.TextBox username = window.Get <TestStack.White.UIItems.TextBox>(SearchCriteria.ByAutomationId("Username"));
                TestStack.White.UIItems.TextBox password = window.Get <TestStack.White.UIItems.TextBox>(SearchCriteria.ByAutomationId("Password"));

                if (username == null || password == null)
                {
                    Assert.Fail("!!Can not find any textbox");
                }

                AutomationElement aeTemp = TreeWalker.ControlViewWalker.GetNextSibling(password.AutomationElement);
                // Input valid nxchattest1 user account to sign in.
                AutomationElement aeSignInButton      = TreeWalker.ControlViewWalker.GetNextSibling(aeTemp);
                TestStack.White.UIItems.Button signIn = new TestStack.White.UIItems.Button(aeSignInButton, window.ActionListener);
                username.BulkText = "";
                password.BulkText = "";
                signIn.Click();
                Thread.Sleep(1000);
                username.BulkText = "*****@*****.**";
                password.BulkText = "123456";
                signIn.Click();
                Thread.Sleep(2000);
                // Waiting for Chat Deck Window display
                numWaits = 0;
                do
                {
                    Console.WriteLine("\n Looking for Chat Deck...");
                    window = app.GetWindow("Home", TestStack.White.Factory.InitializeOption.NoCache);
                    ++numWaits;
                    Thread.Sleep(100);
                } while (window == null && numWaits < 50);


                //TestStack.White.UIItems.TextBox texttemp = window.Get<TestStack.White.UIItems.TextBox>(SearchCriteria.ByText("Create an immersive recording with your persona and content on screen."));
                TestStack.White.UIItems.Label  texttemp = window.Get <TestStack.White.UIItems.Label>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Create an immersive recording with your persona and content on screen."));
                AutomationElement              aemenu   = TreeWalker.ControlViewWalker.GetNextSibling(texttemp.AutomationElement);
                TestStack.White.UIItems.Button menubtn  = new TestStack.White.UIItems.Button(aemenu, window.ActionListener);
                menubtn.Toggle();
                TestStack.White.UIItems.MenuItems.Menu signout = window.Get <TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("Sign out"));
                signout.Click();
                app.Kill();
                stopwatch.Stop();
                file2.WriteLine(stopwatch.ElapsedMilliseconds + " miliseconds");
                file2.Close();
            }
        }
Exemplo n.º 25
0
 private static UIItem getChildByName(Window window, String name)
 {
     return(window.Get <UIItem>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, name)));
 }
Exemplo n.º 26
0
 private static Window getModalWindowByName(Window window, String name)
 {
     return(window.ModalWindow(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, name)));
 }
Exemplo n.º 27
0
        public void CignaFake1()
        {
            //Run Extra emulator for Session 6 from the Desktop
            //Login to CED z420/#happy06
            //CED – From Session 2 -> File -> Open Session (Session6)
            Window session2 = CorkBoard.getWindow("SESSION2 - EXTRA!");

            session2.Focus(DisplayState.Restored);
            Thread.Sleep(1000);

            Program.HotKey(KeyboardInput.SpecialKeys.ALT, "f");
            Thread.Sleep(1000);

            AT.PressKey((int)VirtualKeys.O);
            Thread.Sleep(1000);

            session2.Get <White.Core.UIItems.TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "File name:")).SetValue("Session6.edp");
            Thread.Sleep(1000);

            session2.Get(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Open")).Click();
            Thread.Sleep(1000);

            //Enter application: 'EBDAA08' - > Enter
            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "e");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "b");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "d");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "a");
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "a");
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad8);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Return);
            Thread.Sleep(500);

            //Enter ACF2 ID -> Tab -> password -> Enter

            //q054", "#happy07"

            AT.PressKey((int)VirtualKeys.Q);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad5);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad4);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Tab);
            Thread.Sleep(500);

            Program.HotKey(KeyboardInput.SpecialKeys.SHIFT, "3");
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.H);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.A);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.P);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.P);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Y);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad0);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Numpad7);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.Return);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.G);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.O);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.M);
            Thread.Sleep(500);

            AT.PressKey((int)VirtualKeys.M);
        }
Exemplo n.º 28
0
        public void FindViaNativeProperty()
        {
            var box = button.Get <TextBox>(SearchCriteria.ByNativeProperty(AutomationElement.AutomationIdProperty, "foo"));

            Assert.AreEqual(null, box);
        }
Exemplo n.º 29
0
 public void DeleteInsight()
 {
     gmtWin.Get <Button>(SearchCriteria.ByAutomationId("btnDeleteInsight")).Click();
     gmtWin.Get <Button>(SearchCriteria.ByNativeProperty(AutomationElement.NameProperty, "Yes")).Click();
 }