Ejemplo n.º 1
0
 public void YodaSpeakTransalate()
 {
     txtOriginalText.Enter("Hello welcome to microsoft team.");
     button.Click();
     window.WaitWhileBusy();
     Assert.IsNotEmpty(txtResult.Text);
     System.Threading.Thread.Sleep(2000);
 }
Ejemplo n.º 2
0
        public void changeCalcMode(String mode)
        {
            MenuBar menus = (MenuBar)win.Get(SearchCriteria
                                             .ByControlType(ControlType.MenuBar).AndByText("Application"));

            if (mode.Equals("Mortgage"))
            {
                Menu tobeSelected = menus.MenuItem("View", "Worksheets", "Mortgage");
                tobeSelected.Click();
            }
            else
            {
                Menu tobeSelected = menus.MenuItem("View", mode);
                tobeSelected.Click();
                win.WaitWhileBusy();
            }
        }
Ejemplo n.º 3
0
 //**************************************************************************************************************************************************************
 public static void ClickButtonByName(Window win, String name)
 {
     try
     {
         AutomationProperty p = AutomationElementIdentifiers.NameProperty;
         TestStack.White.UIItems.Button b = (TestStack.White.UIItems.Button)win.Get(SearchCriteria.ByNativeProperty(p, name));
         b.Click();
         win.WaitWhileBusy();
         Thread.Sleep(int.Parse(Execution_Speed));
     }
     catch (Exception e)
     {
         String sMessage = e.Message;
         LastException.SetLastError(sMessage);
         throw new Exception(sMessage);
     }
 }
Ejemplo n.º 4
0
        //**************************************************************************************************************************************************************

        public static void ClickElementByName(Window win, String name)
        {
            Logger.logMessage("Function call @ :" + DateTime.Now);
            string windowName = null;

            try
            {
                windowName = win.Name;
                AutomationProperty p = AutomationElementIdentifiers.NameProperty;
                win.Get(SearchCriteria.ByNativeProperty(p, name)).Click();
                win.WaitWhileBusy();
                Logger.logMessage("ClickElementByName " + windowName + "->" + name + " - Successful");
                Logger.logMessage("------------------------------------------------------------------------------");
                Thread.Sleep(int.Parse(Execution_Speed));
            }
            catch (Exception e)
            {
                Logger.logMessage("ClickElementByName " + windowName + "->" + name + " - Failed");
                Logger.logMessage(e.Message);
                Logger.logMessage("------------------------------------------------------------------------------");

                String sMessage = e.Message;
                LastException.SetLastError(sMessage);
                throw new Exception(sMessage);
            }

        }
Ejemplo n.º 5
0
        public virtual void Handle(Window window)
        {
            window.WaitWhileBusy();

            if (types.Contains(ActionType.NewControls)) window.ReloadIfCached();
        }
Ejemplo n.º 6
0
 public void init()
 {
     app = Application.Launch(applicationPath);
     win = app.GetWindow("Calculator");
     win.WaitWhileBusy();
 }