Esempio n. 1
0
        public void RightClickDeleteResource(string resourceName, string categoryName, string serverName)
        {
            EnterExplorerSearchText(resourceName);
            UITestControl theControl = null;

            if (categoryName != "Unassigned" && categoryName != string.Empty)
            {
                theControl = VisualTreeWalker.GetChildByAutomationIdPath(_explorerTree, serverName, categoryName, resourceName);
            }
            else
            {
                theControl = VisualTreeWalker.GetChildByAutomationIdPath(_explorerTree, serverName, resourceName);
            }
            Point p = new Point(theControl.BoundingRectangle.X + 100, theControl.BoundingRectangle.Y + 5);

            Mouse.Move(p);
            Playback.Wait(500);
            Mouse.Click(MouseButtons.Right, ModifierKeys.None, p);
            Playback.Wait(1000);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{ENTER}");
            PopupDialogUIMap.WaitForDialog();
            Playback.Wait(100);
            var confirmationDialog = UIBusinessDesignStudioWindow.GetChildren()[0];
            var yesButton          = confirmationDialog.GetChildren().FirstOrDefault(c => c.FriendlyName == "Yes");

            Mouse.Click(yesButton, new Point(10, 10));
        }
Esempio n. 2
0
        public void RightClickRemoveResource(string resourceName, string categoryName, string serverName)
        {
            EnterExplorerSearchText(resourceName);
            UITestControl theControl = GetServiceItem(serverName, categoryName, resourceName);
            Point         p          = new Point(theControl.BoundingRectangle.X + 100, theControl.BoundingRectangle.Y + 5);

            Mouse.Move(p);
            Playback.Wait(500);
            Mouse.Click(MouseButtons.Right, ModifierKeys.None, p);
            Playback.Wait(1000);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{DOWN}");
            Playback.Wait(100);
            SendKeys.SendWait("{ENTER}");
            PopupDialogUIMap.WaitForDialog();
            Playback.Wait(100);
            var confirmationDialog = UIBusinessDesignStudioWindow.GetChildren()[0];
            var yesButton          = confirmationDialog.GetChildren().FirstOrDefault(c => c.FriendlyName == "Yes");

            Mouse.Click(yesButton, new Point(10, 10));
        }