/// <summary>
        /// CustomBackgroundColor - Use 'CustomBackgroundColorParams' to pass parameters into this method.
        /// </summary>
        public void CustomBackgroundColor(bool enableCustomBackGroundColor)
        {
            #region Variable Declarations
            WinRadioButton uICustomRadioButton = this.UIDisplayOptionsWindow.UICustomWindow.UICustomRadioButton;
            WinButton      uIItemButton        = this.UIDisplayOptionsWindow.UIItemWindow3.UIItemButton;
            WinText        uIBasiccolorsText   = this.UIColorWindow.UIItemWindow.UIBasiccolorsText;
            WinButton      uIOKButton          = this.UIColorWindow.UIOKWindow.UIOKButton;
            #endregion

            if (enableCustomBackGroundColor)
            {
                // Select 'Custom' radio button
                uICustomRadioButton.Selected = enableCustomBackGroundColor;

                // Click '...' button
                Mouse.Click(uIItemButton, new Point(10, 18));

                // Click 'Basic colors:' label
                Mouse.Click(uIBasiccolorsText, new Point(141, 32));

                // Click 'OK' button
                Mouse.Click(uIOKButton, new Point(26, 14));
            }

            if (!enableCustomBackGroundColor)
            {
                BackgroundColorNormalizerTarget();
            }
        }
        public static UITestControl txtmethodResult()
        {
            UITestControl txtResult = new WinText(control);

            txtResult.SearchProperties[UITestControl.PropertyNames.Name] = "Result";
            return(txtResult);
        }
Example #3
0
        public void Test_Windows_Calculator()
        {
            var app = ApplicationUnderTest.Launch(@"C:\Windows\system32\calc.exe");

            var button5 = new WinButton(app);

            button5.SearchProperties.Add(WinControl.PropertyNames.Name, "5");
            Mouse.Click(button5);

            var buttonPlus = new WinButton(app);

            buttonPlus.SearchProperties.Add(WinControl.PropertyNames.Name, "Add");
            Mouse.Click(buttonPlus);

            Mouse.Click(button5);

            var buttonEquals = new WinButton(app);

            buttonEquals.SearchProperties.Add(WinControl.PropertyNames.Name, "Equals");
            Mouse.Click(buttonEquals);

            var resultText = new WinText(app);

            resultText.SearchProperties.Add(WinControl.PropertyNames.Name, "Result");
            Assert.AreEqual("10", resultText.DisplayText);
        }
Example #4
0
        public static void AssertWindowText(string windowName, string name, string assertValue)
        {
            WinWindow window = (WinWindow)Robot.FindWinControl(typeof(WinWindow), windowName, null);
            WinText   text   = (WinText)Robot.FindWinControl(typeof(WinText), name, window);

            Assert.AreEqual(text.DisplayText, assertValue);
        }
Example #5
0
 private void Start()
 {
     WinText.SetActive(false);
     SpeedFx.SetActive(false);
     WinCollider.SetActive(false);
     JumpBar.SetActive(false);
 }
    public ArkanoidWinScreen(MainGame tempGame) : base()
    {
        _game           = tempGame;
        _mainMenuButton = new ImageButton("Arkanoid Buttons/Menu.png", 2, 1)
        {
            scale = 0.6f
        };

        _mainMenuButton.SetXY(game.width / 2, game.height / 2 - 50);
        AddChild(_mainMenuButton);

        _quitButton = new ImageButton("Arkanoid Buttons/Exit.png", 2, 1)
        {
            scale = 0.6f
        };

        _quitButton.SetXY(game.width / 2, game.height / 2 + 50);
        AddChild(_quitButton);

        _winText = new WinText(game.width / 2, game.height / 2 - 150, _game.ticketsReceived);
        AddChild(_winText);

        Sound backgroundMusic = new Sound("ArkanoidSounds/EndLmao.mp3", true, true);

        _backgroundMusicChannel        = backgroundMusic.Play();
        _backgroundMusicChannel.Volume = 1f;
    }
Example #7
0
        /// <summary>
        /// dangnhap
        /// </summary>
        public void RecordedMethod1()
        {
            #region Variable Declarations
            WinControl uIAllWork1sGoogleChromDocument = this.UIAllWork1sGoogleChromWindow.UIChromeLegacyWindowWindow.UIAllWork1sGoogleChromDocument;
            WinEdit    uIItemEdit = this.UIAllWork1sGoogleChromWindow.UIItemGroup.UIItemEdit;
            WinGroup   uIAllWork1sGoogleChromGroup = this.UIAllWork1sGoogleChromWindow.UIItemGroup.UIAllWork1sGoogleChromGroup;
            WinText    uIAllWork1sGoogleChromText  = this.UIAllWork1sGoogleChromWindow.UIỨngViênTanhuynh1999MenuButton.UIAllWork1sGoogleChromText;
            WinText    uIAllWork1sGoogleChromText1 = this.UIAllWork1sGoogleChromWindow.UIĐăngxuấtHyperlink.UIAllWork1sGoogleChromText;
            #endregion

            // Click 'AllWork1s - Google Chrome' document
            Mouse.Click(uIAllWork1sGoogleChromDocument, new Point(876, 337));

            // Click '******************' text box
            Mouse.Click(uIItemEdit, new Point(340, 24));

            // Click 'AllWork1s - Google Chrome' group
            Mouse.Click(uIAllWork1sGoogleChromGroup, new Point(421, 27));

            // Click 'AllWork1s - Google Chrome' label
            Mouse.Click(uIAllWork1sGoogleChromText, new Point(68, 11));

            // Click 'AllWork1s - Google Chrome' label
            Mouse.Click(uIAllWork1sGoogleChromText1, new Point(34, 1));
        }
Example #8
0
        /// <summary>
        /// 檢測Label的顏色是否正確
        /// </summary>
        /// <param name="labelName">標籤的AccessibleName</param>
        /// <param name="color">待測顏色</param>
        public static void AssertLabelColor(string labelName, Color color)
        {
            WinText label  = (WinText)Robot.FindWinControl(typeof(WinText), labelName, _root);
            Bitmap  bitmap = new Bitmap(label.CaptureImage());

            Assert.AreEqual(color.ToArgb(), bitmap.GetPixel(0, 0).ToArgb());
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="window"></param>
        /// <param name="controlName"></param>
        /// <returns></returns>
        public static WinText GetLabelByControlName(this WinWindow window, string controlName)
        {
            WinText btn = new WinText(window);

            btn.SearchProperties[WinText.PropertyNames.ControlName] = controlName;
            return(btn);
        }
Example #10
0
        /// <summary>
        /// CreateNewClass - Use 'CreateNewClassParams' to pass parameters into this method.
        /// </summary>
        public void CreateNewClass(String className, String description, String symbol)
        {
            #region Variable Declarations
            WinButton uIBtnAddClassButton  = this.UISmartLearnClassifierWindow1.UIBtnAddClassWindow.UIBtnAddClassButton;
            WinEdit   uITxtNameEdit        = this.UISmartLearnClassifierWindow1.UITxtNameWindow.UITxtNameEdit;
            WinEdit   uITxtDescriptionEdit = this.UISmartLearnClassifierWindow1.UITxtDescriptionWindow.UITxtDescriptionEdit;
            WinEdit   uITxtSymbolEdit      = this.UISmartLearnClassifierWindow1.UIItemWindow.UITxtSymbolEdit;
            WinButton uIColorButton        = this.UISmartLearnClassifierWindow1.UIColorWindow.UIColorButton;
            WinText   uIBasiccolorsText    = this.UIColorWindow.UIItemWindow.UIBasiccolorsText;
            WinButton uIOKButton           = this.UIColorWindow.UIOKWindow.UIOKButton;
            #endregion

            // Click 'btnAddClass' button
            Mouse.Click(uIBtnAddClassButton, new Point(14, 19));

            // Type 'TestNewClass' in 'txtName' text box
            uITxtNameEdit.Text = className;

            // Type 'Description' in 'txtDescription' text box
            uITxtDescriptionEdit.Text = description;

            // Type 'w' in 'txtSymbol' text box
            uITxtSymbolEdit.Text = symbol;

            // Click 'Color...' button
            Mouse.Click(uIColorButton, new Point(52, 13));

            // Click 'Basic colors:' label
            Mouse.Click(uIBasiccolorsText, new Point(197, 58));

            // Click 'OK' button
            Mouse.Click(uIOKButton, new Point(41, 12));
        }
Example #11
0
 public FormModel()
 {
     MainWindow = new WinWindow(By.Name("Form1"));
     lbl_ChangingText = MainWindow.Find<WinText>(By.Name("lbl_ChangingText"));
     btn_ChangeTxt = MainWindow.Find<WinButton>(By.Name("btn_ChangingText"));
     txtBox_ChangingBox = MainWindow.Find<WinEdit>(By.Name("txtBox_ChangingText"));
 }
Example #12
0
        public string GetResult()
        {
            var text = new WinText(Calculator);

            text.SearchProperties[WinText.PropertyNames.Name] = CalculatorActionButton.ResultText;
            text.WindowTitles.Add("Calculator");
            return(text.DisplayText);
        }
        public void ThenTheResultShouldBeOnTheScreen(int result)
        {
            WinText resultTextBox = new WinText(_aut);

            resultTextBox.SearchProperties[UITestControl.PropertyNames.Name] = "Result";

            Assert.AreEqual(result.ToString(CultureInfo.InvariantCulture), resultTextBox.DisplayText);
        }
Example #14
0
        private static WinText GetWinText(string uiTitle, string uiType)
        {
            var htmlcontrolWin = new WinText(Window.Locate(uiTitle, uiType));
            var htmlControlWin = htmlcontrolWin;

            htmlControlWin.TechnologyName = TechnologyNameWin;
            return(htmlControlWin);
        }
Example #15
0
        public WinText alarmText(string uiProp)
        {
            WinText resultsObj = new WinText(window);

            resultsObj.SearchProperties.Add(WinText.PropertyNames.Name, uiProp);
            resultsObj.WindowTitles.Add(winTitle);
            return(resultsObj);
        }
Example #16
0
 //決定ボタンを押したときの挙動
 //とりあえずplayerは1,computerは2にしとく
 public void Det()
 {
     if (PlayerTurn)
     {
         if (Masume[x % n, y % n, z % n] == 0)
         {
             Masume[x % n, y % n, z % n] = 1;
             Cubes[x % n, y % n, z % n].GetComponent <Renderer>().sharedMaterial = Materials[Masume[x % n, y % n, z % n]];
             if (Judge(1) == 1)
             {
                 WinText.SetActive(true);
                 Continue   = false;
                 PlayerTurn = false;
             }
             if (starter == 2)
             {
                 turnnum++;
                 TurnText.text = turnnum + "回目";
             }
             x = y = z = 1;
             WhichTurnText.text = "コンピューターのターン";
             PlayerTurn         = false;
         }
         else
         {
             //キャンヴァスに「ここは選択できません」
         }
     }
     else
     {
         if (Masume[x % n, y % n, z % n] == 0)
         {
             PlayerTurn = true;
             Masume[x % n, y % n, z % n] = 2;
             Cubes[x % n, y % n, z % n].GetComponent <Renderer>().sharedMaterial = Materials[Masume[x % n, y % n, z % n]];
             for (i = 0, j = 1; i < n; i++)
             {
                 j *= 2;
             }
             if (Judge(j) == 1)
             {
                 LoseText.SetActive(true);
                 Continue   = false;
                 PlayerTurn = false;
             }
             if (starter == 1)
             {
                 turnnum++;
                 TurnText.text = turnnum + "回目";
             }
             x = y = z = 1;
             WhichTurnText.text = "あなたのターン";
         }
         else
         {
         }
     }
 }
Example #17
0
        /// <summary>
        /// ResultMultiplicateAssertMethod - Используйте "ResultMultiplicateAssertMethodExpectedValues" для передачи параметров в этот метод.
        /// </summary>
        public void ResultMultiplicateAssertMethod()
        {
            #region Variable Declarations
            WinText uIItem400Text = this.UICalcWindow.UIItem35Window.UIItem400Text;
            #endregion

            // Убедитесь, что свойство DisplayText "400" надпись равняется "400"
            Assert.AreEqual(this.ResultMultiplicateAssertMethodExpectedValues.UIItem400TextDisplayText, uIItem400Text.DisplayText, "Результат не соответствует требуемому");
        }
Example #18
0
        /// <summary>
        /// ResultAssertEqualMethod - Используйте "ResultAssertEqualMethodExpectedValues" для передачи параметров в этот метод.
        /// </summary>
        public void ResultAssertEqualMethod()
        {
            #region Variable Declarations
            WinText uIItem35Text = this.UICalcWindow.UIItem35Window.UIItem35Text;
            #endregion

            // Убедитесь, что свойство DisplayText "35" надпись равняется "35"
            Assert.AreEqual(this.ResultAssertEqualMethodExpectedValues.UIItem35TextDisplayText, uIItem35Text.DisplayText);
        }
        /// <summary>
        /// Testing Help
        /// </summary>
        public void AssertMethod6()
        {
            #region Variable Declarations
            WinText uIHomePageMovieRatingWText = this.UIHomePageMovieRatingWWindow.UIHelpHyperlink.UIHomePageMovieRatingWText;
            #endregion

            // Verify that the 'Name' property of 'Home Page - Movie Rating Web App - Google Chrome' label equals 'Help'
            Assert.AreEqual(this.AssertMethod6ExpectedValues.UIHomePageMovieRatingWTextName, uIHomePageMovieRatingWText.Name, "Solution should be Help, otherwise error");
        }
Example #20
0
        /// <summary>
        /// surseeleukerbad - Verwenden Sie "surseeleukerbadParams", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void surseeleukerbad()
        {
            #region Variable Declarations
            WinComboBox uICb_startComboBox             = this.UITransportAppWindow.UICb_startWindow.UICb_startComboBox;
            WinButton   uIStationsuchenButton          = this.UITransportAppWindow.UIStationsuchenWindow.UIStationsuchenButton;
            WinText     uIBittegebenSieIhreEndText     = this.UITransportAppWindow.UIBittegebenSieIhreEndWindow.UIBittegebenSieIhreEndText;
            WinComboBox uIBittegebenSieIhreStaComboBox = this.UITransportAppWindow.UICb_endWindow.UIBittegebenSieIhreStaComboBox;
            WinWindow   uIBittegebenSieIhreStaWindow   = this.UITransportAppWindow.UITransportAppClient.UIBittegebenSieIhreStaWindow;
            WinButton   uIStationsuchenButton1         = this.UITransportAppWindow.UIStationsuchenWindow1.UIStationsuchenButton;
            WinButton   uIVerbindungsuchenButton       = this.UITransportAppWindow.UIVerbindungsuchenWindow.UIVerbindungsuchenButton;
            WinButton   uIZumStationenFahrplanButton   = this.UITransportAppWindow.UIZumStationenFahrplanWindow.UIZumStationenFahrplanButton;
            WinClient   uITransportAppClient           = this.UITransportAppWindow.UITransportAppClient;
            WinButton   uISchliessenButton             = this.UITransportAppWindow.UISchliessenWindow.UISchliessenButton;
            #endregion

            // "Sursee" in "cb_start" Kombinationsfeld auswählen
            uICb_startComboBox.EditableItem = this.surseeleukerbadParams.UICb_startComboBoxEditableItem;

            // Klicken "&Station suchen" Schaltfläche
            Mouse.Click(uIStationsuchenButton, new Point(24, 15));

            // "Sursee" in "cb_start" Kombinationsfeld auswählen
            uICb_startComboBox.SelectedItem = this.surseeleukerbadParams.UICb_startComboBoxSelectedItem;

            // Klicken "Bitte geben Sie Ihre Endstation ein:" Bezeichnung
            Mouse.Click(uIBittegebenSieIhreEndText, new Point(135, 7));

            // "Leukerbad" in "Bitte geben Sie Ihre Startstation ein:" Kombinationsfeld auswählen
            uIBittegebenSieIhreStaComboBox.EditableItem = this.surseeleukerbadParams.UIBittegebenSieIhreStaComboBoxEditableItem;

            // Klicken "Bitte geben Sie Ihre Startstation ein:" Fenster
            Mouse.Click(uIBittegebenSieIhreStaWindow, new Point(168, 88));

            // Klicken "Bitte geben Sie Ihre Startstation ein:" Fenster
            Mouse.Click(uIBittegebenSieIhreStaWindow, new Point(168, 88));

            // "Leukerba" in "Bitte geben Sie Ihre Startstation ein:" Kombinationsfeld auswählen
            uIBittegebenSieIhreStaComboBox.EditableItem = this.surseeleukerbadParams.UIBittegebenSieIhreStaComboBoxEditableItem1;

            // Klicken "Station such&en" Schaltfläche
            Mouse.Click(uIStationsuchenButton1, new Point(48, 10));

            // Klicken "Verbindung suchen" Schaltfläche
            Mouse.Click(uIVerbindungsuchenButton, new Point(104, 10));

            // Klicken "Zum Stationen Fahrplan" Schaltfläche
            Mouse.Click(uIZumStationenFahrplanButton, new Point(119, 8));

            // Klicken "Transport App" Client
            Mouse.Click(uITransportAppClient, new Point(228, 201));

            // Klicken "Transport App" Client
            Mouse.Click(uITransportAppClient, new Point(228, 201));

            // Klicken "Schliessen" Schaltfläche
            Mouse.Click(uISchliessenButton, new Point(52, 18));
        }
        /// <summary>
        /// AssertMethod2 - Use 'AssertMethod2ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod2()
        {
            #region Variable Declarations
            WinText uIItem0Text = this.UIStarkeundunregelmäßiWindow.UIItem0Window1.UIItem0Text;
            #endregion

            // Verify that the 'ControlType' property of '0' label equals 'Text'
            Assert.AreEqual(this.AssertMethod2ExpectedValues.UIItem0TextControlType, uIItem0Text.ControlType.ToString());
        }
Example #22
0
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WinText uIBookinghasbeenaddedText = this.UIBookinghasbeenaddedWindow.UIBookinghasbeenaddedText;
            #endregion

            // Verify that the 'DisplayText' property of 'Booking has been added:' label matches 'Booking has been added: '
            StringAssert.Matches(uIBookinghasbeenaddedText.DisplayText, new Regex(this.AssertMethod1ExpectedValues.UIBookinghasbeenaddedTextDisplayText));
        }
Example #23
0
        /// <summary>
        /// AssertTheResult - Use 'AssertTheResultExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertTheResult()
        {
            #region Variable Declarations
            WinText inputLableValue = this.UICalculatorWindow.InputLabel.InputLableValue;
            #endregion

            // Verify that 'Input' label's property 'DisplayText' equals 'ExpectedValue'
            Assert.AreEqual(Convert.ToInt32(this.AssertTheResultExpectedValues.InputLableValueDisplayText), Convert.ToInt32(inputLableValue.DisplayText));
        }
Example #24
0
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WinText uIItemResultText = this.UICalculatorWindow.UIItemWindow.UIItemResultText;
            #endregion

            // Verify that the 'DisplayText' property of '0' label equals '3'
            Assert.AreEqual(this.AssertMethod1ExpectedValues.UIItemResultTextDisplayText, uIItemResultText.DisplayText, "Result is incorrect");
        }
Example #25
0
        /// <summary>
        /// AssertMethod2 - Use 'AssertMethod2ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod2()
        {
            #region Variable Declarations
            WinText uINonMember25Text = this.UISphereBookingandChecWindow.UIBookingFormWindow.UINonMember25Window.UINonMember25Text;
            #endregion

            // Verify that the 'DisplayText' property of 'Non-Member: £25' label matches 'Non-Member: £25'
            StringAssert.Matches(uINonMember25Text.DisplayText, new Regex(this.AssertMethod2ExpectedValues.UINonMember25TextDisplayText));
        }
Example #26
0
        /// <summary>
        /// AssertAddition - Use 'AssertAdditionExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertAddition()
        {
            #region Variable Declarations
            WinText uIItem3Text = this.UICalculatorWindow.UIItem3Window.UIItem3Text;
            #endregion

            // Verify that the 'DisplayText' property of '3' label equals '3'
            Assert.AreEqual(this.AssertAdditionExpectedValues.UIItem3TextDisplayText, uIItem3Text.DisplayText);
        }
Example #27
0
 // Start is called before the first frame update
 void Start()
 {
     winText = GetComponent <Text>();
     winText.CrossFadeAlpha(0, 0, true);
     restartText.CrossFadeAlpha(0, 0, true);
     instance  = this;
     beenTrig  = false;
     lowerSong = 0.4f;
 }
Example #28
0
        /// <summary>
        /// valdiationcorrect - Verwenden Sie "valdiationcorrectExpectedValues", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void valdiationcorrect()
        {
            #region Variable Declarations
            WinText uIValidationcorrectText = this.UIValidationcorrectWindow.UIValidationcorrectText;
            #endregion

            // Sicherstellen, dass die Eigenschaft 'Name' von "Validation correct" Bezeichnung ist gleich 'Validation correct'
            Assert.AreEqual(this.valdiationcorrectExpectedValues.UIValidationcorrectTextName, uIValidationcorrectText.Name);
        }
Example #29
0
 /// <summary>
 /// InvalidAtmText - Use 'InvalidAtmTextExpectedValues' to pass parameters into this method.
 /// </summary>
 public bool InvalidAtmText()
 {
     #region Variable Declarations
     WinText uINounitwithIDFDDFSDwaText = this.UINotavalidATMWindow.UINounitwithIDFDDFSDwaWindow.UINounitwithIDFDDFSDwaText;
     #endregion
     return(uINounitwithIDFDDFSDwaText.Exists);
     // Verify that 'No unit with ID: FDDFSD was found.' label's property 'ControlType' matches 'InvalidAtmText'
     //sStringAssert.Matches(uINounitwithIDFDDFSDwaText.ControlType.ToString(), new Regex(this.InvalidAtmTextExpectedValues.UINounitwithIDFDDFSDwaTextControlType));
 }
        /// <summary>
        /// Converts the display text to double.
        /// </summary>
        public static double GetDisplayTextAsDouble(this WinText testControl)
        {
            if (testControl == null)
            {
                throw new ArgumentNullException("testControl");
            }

            return(double.Parse(testControl.DisplayText, CultureInfo.CurrentCulture));
        }
Example #31
0
 public void Menu(bool Win) // Win yazisi gorunup gorunmemesi icin
 {
     Time.timeScale = 0f;
     EndMenu.SetActive(true);
     if (Win == true)
     {
         WinText.SetActive(true);
     }
 }
        public WinText GetCUITTextcontrol(WinWindow w, string searchBy, string searchValue, int index)
        {
            Console.WriteLine("Inside function GetCUITTextcontrol");
            WinText GetCUITTextcontrol = new WinText(w);

            try
            {
                Playback.Initialize();
                switch (searchBy.Trim().ToLower())
                {
                    case "text":
                        {
                            if (index == -1)
                            {
                                GetCUITTextcontrol.SearchProperties.Add(WinText.PropertyNames.Name, searchValue, PropertyExpressionOperator.Contains);
                                UITestControlCollection textCollection = GetCUITTextcontrol.FindMatchingControls();
                                GetCUITTextcontrol = (WinText)textCollection[0];
                            }
                            else
                            {
                                GetCUITTextcontrol.SearchProperties.Add(WinText.PropertyNames.Name, searchValue);
                                UITestControlCollection textCollection = GetCUITTextcontrol.FindMatchingControls();
                                GetCUITTextcontrol = (WinText)textCollection[index];
                            }
                            break;
                        }

                    case "automationid":
                        {
                            if (index == -1)
                            {
                                GetCUITTextcontrol.SearchProperties.Add(WinText.PropertyNames.ControlName, searchValue);
                                UITestControlCollection textCollection = GetCUITTextcontrol.FindMatchingControls();
                                GetCUITTextcontrol = (WinText)textCollection[0];
                            }
                            else
                            {
                                GetCUITTextcontrol.SearchProperties.Add(WinText.PropertyNames.ControlName, searchValue);
                                UITestControlCollection textCollection = GetCUITTextcontrol.FindMatchingControls();
                                GetCUITTextcontrol = (WinText)textCollection[index];
                            }
                            break;
                        }

                    default:
                        throw new Exception(_error);
                }

                Playback.Cleanup();
                Console.WriteLine("Found TextControl and exiting function GetCUITTextcontrol");
                return GetCUITTextcontrol;

            }
            catch (Exception e)
            {
                var st = new StackTrace(e, true);
                var testFrame = st.GetFrame(0);
                for (int i = 0; i < st.FrameCount; i++)
                {
                    testFrame = st.GetFrame(i);
                    if (testFrame.GetFileName() != null)
                    {
                        if (testFrame.GetFileName().ToString().Contains("CUITFramework.cs") == true)
                        {
                            break;
                        }
                    }

                }
                // Get the top stack frame
                var frame = testFrame;
                // Get the line number from the stack frame
                var line = frame.GetFileLineNumber();
                logTofile(_eLogPtah, "Error in GetCUITCHeckbox and in line: " + line);
                throw new Exception(_error + "CUITRButton:" + System.Environment.NewLine + e.Message);
            }
        }
Example #33
0
 public static UITestControlCollection GetControlCollection(WinText editControl)
 {
     return editControl.FindMatchingControls();
 }