Exemple #1
0
 public static void MoveLeft(this Ranorex.Unknown container, int moveNum)
 {
     for (int i = 0; i < moveNum; i++)
     {
         container.PressKeys("{Shift down}{Tab}{Shift up}");
     }
 }
        public override RanorexStepExecutionResponse Execute(Dictionary <string, object> arguments)
        {
            RanorexStepExecutionResponse stepResponse = new RanorexStepExecutionResponse();

            try
            {
                RepoItemInfo repoItemInfo = null;

                string target        = (string)arguments.GetValueOrDefault <string, object>("target");
                string action        = (string)arguments.GetValueOrDefault <string, object>("action");
                string startLocation = (string)arguments.GetValueOrDefault <string, object>("startlocation");
                int    distance      = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("distance"));
                double direction     = Convert.ToDouble(arguments.GetValueOrDefault <string, object>("direction"));
                int    duration      = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("duration"));
                int    delay         = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("delay"));

                int  timeout       = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("timeout"));
                bool retrieveImage = (bool)arguments.GetValueOrDefault <string, object>("retrieveImage");

                if (timeout == default(int))
                {
                    timeout = 10000;
                }
                if (duration == default(int))
                {
                    duration = 0;
                }
                if (startLocation == default(string))
                {
                    startLocation = "0;0";
                }

                if (target != default(string))
                {
                    repoItemInfo = CreateItemInfo(repo, target, timeout);
                    Ranorex.Unknown adapter = CreateAdapter(repoItemInfo);

                    Report.Log(ReportLevel.Info, "Touch Gestures", "Swipe gesture with direction '" + direction + "' starting from '" + startLocation + "' with distance '" + distance + "' with swipe duration '" + duration + "'", repoItemInfo, new RecordItemIndex(Agent.EXECUTION_INDEX));
                    adapter.Swipe(startLocation, direction, distance, duration, 0);

                    if (retrieveImage)
                    {
                        stepResponse.image64 = GetImage64(adapter);
                    }
                }
                else
                {
                }

                Delay.Milliseconds(200);

                stepResponse.success = true;
            }
            catch (Exception e)
            {
                stepResponse.message = "Ranorex Exception: " + e.Message;
                stepResponse.success = false;
            }
            return(stepResponse);
        }
Exemple #3
0
        // International CodeF4 Check ##############################################################################
        //
        public void InternationalCheckForCodeF4Alert()
        {
            RanorexRepository repo = new RanorexRepository();

            Ranorex.Unknown element = null;

            if (Host.Local.TryFindSingle(repo.ReservationDeposit.CodeF4WarningInfo.AbsolutePath.ToString(), out element))
            {
                repo.ReservationDeposit.CodeF4Warning.Click("201;9");
                Delay.Milliseconds(200);

                repo.ReservationDeposit.RawTextF4Drop.Click("23;10");
                Delay.Milliseconds(200);

                repo.ReservationDeposit.AfxOleControl42.PressKeys("{F4}");
                Delay.Milliseconds(100);

                Keyboard.Press("psu");

                Keyboard.Press("advanced{Return}");
                Delay.Milliseconds(100);

                repo.ReservationDeposit.Self.PressKeys("{F4}");
                Delay.Milliseconds(1000);

                Keyboard.Press("40000");
                Delay.Milliseconds(100);

                Keyboard.Press("{Return}");
                Delay.Milliseconds(100);

                Keyboard.Press("{Escape}");
            }
        }
Exemple #4
0
 public static void MoveDown(this Ranorex.Unknown container, int moveNum)
 {
     for (int i = 0; i < moveNum; i++)
     {
         container.PressKeys("{Down}");
     }
 }
Exemple #5
0
        //
        // E N T E R   C U S T O M E R  ##############################################################################
        //
        public void SpecialEnterCustomer()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

            Global.LogText = @"Enter Special Customer Phone Number";

            repo.Retech.FindCustomerTextBox.TextValue = Global.SpecialCustomerPhoneNumber;
            repo.Retech.FindCustomerTextBox.PressKeys("{Enter}");
            Thread.Sleep(100);

            while (!repo.RetechFindCustomerView.CustomerSearchCriteria.Enabled)
            {
                Thread.Sleep(100);
            }

            repo.RetechFindCustomerView.ListBoxItem.Click();

            while (Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
        }
Exemple #6
0
 public static void SetText(this Ranorex.Unknown container, string text)
 {
     if (Functions.GoodData(text))
     {
         container.PressKeys(text);
     }
 }
Exemple #7
0
        public static List <List <string> > GetContents(this Ranorex.Unknown container, bool bRemoveHeader)
        {
            if (container.Visible)
            {
                Ranorex.NativeWindow containerText = new Ranorex.NativeWindow(container);


                // gets all non-blank lines from container
                // if a container has blank lines in the middle, may cause problems, just remove option in call
                List <string> lsRows = containerText.WindowText.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries).ToList(); // split the string into an array of rows separated by new line characters

                // removes the container header line
                if (bRemoveHeader)
                {
                    lsRows.RemoveAt(0);
                }

                // split fields from each row
                List <List <string> > contents = new List <List <string> >(); // contents contains rows and columns

                foreach (string currentString in lsRows)
                {
                    contents.Add(currentString.Split(new char[] { '\t' }).ToList());     // split each row into cells separated by tabs
                }

                return(contents);
            }
            else
            {
                return(null);
            }
        }
Exemple #8
0
        public static void MoveToField(this Ranorex.Unknown container, int rowNum, int colNum)
        {
            container.SetToLine(rowNum);

            for (int i = 0; i < colNum; i++)
            {
                container.PressKeys("{Tab}");
            }
        }
Exemple #9
0
        public static void SetToLine(this Ranorex.Unknown container, int rowNumber)
        {
            container.ClickFirstCell();

            for (int i = 0; i < rowNumber; i++)
            {
                container.PressKeys("{Down}");
            }
        }
Exemple #10
0
        //
        // F I N A L   C H E C K   O U T ##############################################################################
        //
        public void SpecialFinalCheckOut()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

            switch (Global.RetechVersion.Substring(0, 3))
            {
            case "5.6":
                Global.LogText = @"Clicking on Purchase Mode F2";
                WriteToLogFile.Run();
                repo.Retech.Self.Focus();
                Keyboard.Press("{F2}");                          // Purchase Mode F2
                Thread.Sleep(100);

                Global.LogText = @"Clicking Cointinue in Purchase Mode F6";
                WriteToLogFile.Run();
                repo.Retech.Self.Focus();
                Keyboard.Press("{F6}");             // Continue in Purchase Mode F6
                Thread.Sleep(100);
                Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.LineItemCustomerEditorView.CustomerInfoEditProfileIcon_5_6_0_103Info.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
                break;

            case "5.7":
                Global.LogText = @"Clicking on Trades F3 Continue F5 button";
                WriteToLogFile.Run();
                repo.Retech.ContinueButtonCommandTrade_5_7_1_2.Click();
                Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.EditProfileCommandInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
                break;

            default:
                Global.LogText = @"Clicking on Trades F3 Continue F5 button";
                WriteToLogFile.Run();
                repo.Retech.ContinueButtonCommandTrade_5_7_1_2.Click();
                Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.EditProfileCommandInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
                break;
            }
        }
        public override RanorexStepExecutionResponse Execute(Dictionary <string, object> arguments)
        {
            RanorexStepExecutionResponse stepResponse = new RanorexStepExecutionResponse();

            try
            {
                RepoItemInfo repoItemInfo = null;

                string target        = (string)arguments.GetValueOrDefault <string, object>("target");
                string sequence      = (string)arguments.GetValueOrDefault <string, object>("keySequence");
                int    duration      = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("duration"));
                int    delay         = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("delay"));
                int    timeout       = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("timeout"));
                bool   retrieveImage = (bool)arguments.GetValueOrDefault <string, object>("retrieveImage");

                if (timeout == default(int))
                {
                    timeout = 10000;
                }

                if (duration == default(int))
                {
                    duration = 0;
                }

                if (target != default(string))
                {
                    repoItemInfo = CreateItemInfo(repo, target, timeout);
                    Ranorex.Unknown adapter = CreateAdapter(repoItemInfo);
                    Report.Log(ReportLevel.Info, "Keyboard", "Key '" + sequence + "' Press with focus on UI Element.", repoItemInfo, new RecordItemIndex(Agent.EXECUTION_INDEX));

                    adapter.PressKeys(sequence, duration);
                    if (retrieveImage)
                    {
                        stepResponse.image64 = GetImage64(adapter);
                    }
                }
                else
                {
                    Report.Log(ReportLevel.Info, "Keyboard", "Key '" + sequence + "' Press.", new RecordItemIndex(Agent.EXECUTION_INDEX));
                    Keyboard.Press(sequence, duration);
                }

                Delay.Milliseconds(200);

                stepResponse.success = true;
            }
            catch (Exception e)
            {
                stepResponse.message = "Ranorex Exception: " + e.Message;
                stepResponse.success = false;
            }
            return(stepResponse);
        }
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            Ranorex.Unknown element = null;

            Report.Log(ReportLevel.Info, "IN fnClearBrowserCache", "IN fnClearBrowserCache", new RecordItemIndex(0));

            // The following will clear the cache for IE and the POS Browser. You can copy and paste it into the Ranorex code.

            Host.Local.RunApplication("C:\\Windows\\System32\\rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess 255", "", false);
            Thread.Sleep(1000);

            // NOTE store 4285 register 2 has takes very long time to clear cache and times out
            try
            { repo.DeleteBrowsingHistory.PleaseWaitWhileClearingHistoryInfo.WaitForNotExists(90000); }
            catch
            { repo.DeleteBrowsingHistory.PleaseWaitWhileClearingHistoryInfo.WaitForNotExists(90000); }
            try
            { repo.DeleteBrowsingHistory.SelfInfo.WaitForNotExists(90000); }
            catch
            {
                try
                {
                    repo.DeleteBrowsingHistory.SelfInfo.WaitForNotExists(90000);
                }
                catch
                {
                    try
                    {
                        repo.DeleteBrowsingHistory.SelfInfo.WaitForNotExists(90000);
                    }
                    catch
                    {
                        repo.DeleteBrowsingHistory.SelfInfo.WaitForNotExists(90000);
                    }
                }
            }

            while (Host.Local.TryFindSingle(repo.DeleteBrowsingHistory.PleaseWaitWhileClearingHistoryInfo.AbsolutePath.ToString(), out element) ||
                   Host.Local.TryFindSingle(repo.DeleteBrowsingHistory.SelfInfo.AbsolutePath.ToString(), out element)

                   )
            {
                Thread.Sleep(2000);
            }

            Report.Log(ReportLevel.Info, "OUT fnClearBrowserCache", "OUT fnClearBrowserCache", new RecordItemIndex(0));
        }
Exemple #13
0
        public override RanorexStepExecutionResponse Execute(Dictionary <string, object> arguments)
        {
            RanorexStepExecutionResponse stepResponse = new RanorexStepExecutionResponse();

            try
            {
                RepoItemInfo    repoItemInfo = null;
                Ranorex.Unknown adapter      = null;

                string target      = (string)arguments["target"];
                string method      = (string)arguments["method"];
                int    gracePeriod = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("gracePeriod"));
                int    timeout     = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("timeout"));

                if (timeout == default(int))
                {
                    timeout = 10000;
                }

                if (target != default(string))
                {
                    repoItemInfo = CreateItemInfo(repo, target, timeout);
                    adapter      = CreateAdapter(repoItemInfo);
                }
                else
                {
                    throw new Exception("No target defined!");
                }

                if (method == "CloseWindow")
                {
                    Host.Local.CloseApplication(adapter, new Duration(gracePeriod));
                }
                else if (method == "KillProcess")
                {
                    Host.Local.KillApplication(adapter);
                }

                stepResponse.success = true;
            }
            catch (Exception e)
            {
                stepResponse.message = "Ranorex Exception: " + e.Message;
                stepResponse.success = false;
            }

            return(stepResponse);
        }
        public override RanorexStepExecutionResponse Execute(Dictionary <string, object> arguments)
        {
            RanorexStepExecutionResponse stepResponse = new RanorexStepExecutionResponse();

            try
            {
                RepoItemInfo    repoItemInfo = null;
                Ranorex.Unknown adapter      = null;

                string target = (string)arguments.GetValueOrDefault <string, object>("target");
                string name   = (string)arguments.GetValueOrDefault <string, object>("name");
                string value  = (string)arguments.GetValueOrDefault <string, object>("value");

                int  timeout       = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("timeout"));
                bool retrieveImage = (bool)arguments.GetValueOrDefault <string, object>("retrieveImage");

                if (timeout == default(int))
                {
                    timeout = 10000;
                }

                if (target != default(string))
                {
                    repoItemInfo = CreateItemInfo(repo, target, timeout);
                    adapter      = CreateAdapter(repoItemInfo);

                    adapter.Element.SetAttributeValue(name, value);
                    if (retrieveImage)
                    {
                        stepResponse.image64 = GetImage64(adapter);
                    }
                    stepResponse.message = "";
                }
                else
                {
                    throw new Exception("No target defined!");
                }

                stepResponse.success = true;
            }
            catch (Exception e)
            {
                stepResponse.message = "Ranorex Exception: " + e.Message;
                stepResponse.success = false;
            }
            return(stepResponse);
        }
Exemple #15
0
        // ####################################################
        private void EndScenarioCleanup()
        {
            Ranorex.Unknown   element        = null;
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            if (Global.DomesticRegister) // Domestic Store
            {                            // Domestic Hanging Notification Bar 9/24/18
                if (Host.Local.TryFindSingle(repo.HOPSOverlayView.InstructionsLabelInfo.AbsolutePath.ToString(), out element))
                {
                    repo.HOPSOverlayView.ExpandButton.Click();
                }
            }
            while (File.Exists("c:\\PAL\\pause"))
            {
                Global.LogText = "Pause file - pausing";
                WriteToLogFile.Run();
                Thread.Sleep(60000);
            }

            if (Host.Local.TryFindSingle(repo.PickupAtStorePopupNotifier.PickupAtStoreRequestPopUpInfo.AbsolutePath.ToString(), out element))
            {
                Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Down item 'PopupNotifierView' at 434;30.", repo.PickupAtStorePopupNotifier.SelfInfo, new RecordItemIndex(0));
                repo.PickupAtStorePopupNotifier.Self.MoveTo("434;30");
                Keyboard.Press("{ENTER}");
                //Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
                Delay.Milliseconds(200);
                // repo.PopupNotifierView.Self.Click();
                Thread.Sleep(100);
            }

            Global.IndirectCall      = false;                // 12-3-18
            Global.CurrentSKUOveride = false;                // 12-3-18
            Global.DoingCollectible  = false;                // 12-3/18

            if (Global.ScenarioExecuted & !Global.SwitchPauseBetweenScenariosOff)
            {
                Global.LogText = "Pausing in between scenarios";
                WriteToLogFile.Run();
                Thread.Sleep(45000);
            }
        }
Exemple #16
0
        // ####################################################
        private void EndScenarioCleanup()
        {
            Ranorex.Unknown   element = null;
            RanorexRepository repo    = new RanorexRepository();

            if (Global.DomesticRegister) // Domestic Store
            {                            // Domestic Hanging Notification Bar 9/24/18
                if (Host.Local.TryFindSingle(repo.HOPSOverlayView.InstructionsLabelInfo.AbsolutePath.ToString(), out element))
                {
                    repo.HOPSOverlayView.ExpandButton.Click();
                }
            }
            while (File.Exists("c:\\PAL\\pause"))
            {
                Thread.Sleep(100);
            }

            Global.IndirectCall      = false;                // 12-3-18
            Global.CurrentSKUOveride = false;                // 12-3-18
            Global.DoingCollectible  = false;                // 12-3/18
        }
Exemple #17
0
        // R E T U R N  S K U ##############################################################################
        //
        public void SpecialCheckForCodeF4Alert()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

            // Wait for Another Transaction pop-up
            while (!Host.Local.TryFindSingle(repo.RetechAnotherTransactionInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
                if (Host.Local.TryFindSingle(repo.RetechTillOverageWarningView.CodeF4AlertInfo.AbsolutePath.ToString(), out element)
                    ||
                    Host.Local.TryFindSingle(repo.RetechTillOverageWarningView.CodeF4Alert2Info.AbsolutePath.ToString(), out element)
                    )
                {
                    repo.RetechTillOverageWarningView.DropCashCommand.Click();
                    while (!repo.RetechLoginView.TxtPassword.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    repo.RetechLoginView.TxtPassword.PressKeys("advanced{Return}");
                    while (!repo.RetechTillDepositView.DropBoxAmount.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    repo.RetechTillDepositView.DropBoxAmount.PressKeys("40000");
                    repo.RetechTillDepositView.AddCashDropButton.Click();
                    Thread.Sleep(1000);
                    repo.RetechTillDepositView.DropBoxAmount.PressKeys("{Escape}");
                }
            }

            // Press excape key on Another Transaction pop-up
            while (!Host.Local.TryFindSingle(repo.RetechLoginView.TxtPasswordInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
        }
Exemple #18
0
        private void GoHome()
        {
            Ranorex.Unknown   element        = null;
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Thread.Sleep(1000);
            Global.LogText = @"Waiting for Performance Dashboard Menu to display";
            WriteToLogFile.Run();
            while (!repo.ShellRoot.DashboardSHomeButton.Enabled)
            {
                Thread.Sleep(100);
            }
            repo.ShellRoot.DashboardSHomeButton.Click();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.MyLogoRootInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.MyLogoRoot.Enabled)
            {
                Thread.Sleep(100);
            }
        }
Exemple #19
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;


            Ranorex.Unknown element = null;

            RanorexRepository           repo                      = new RanorexRepository();
            fnWriteToLogFile            WriteToLogFile            = new fnWriteToLogFile();
            fnWriteToErrorFile          WriteToErrorFile          = new fnWriteToErrorFile();
            fnWaitForItemSearchToFinish WaitForItemSearchToFinish = new fnWaitForItemSearchToFinish();
            fnDumpStatsQ4            DumpStatsQ4                  = new fnDumpStatsQ4();
            fnTimeMinusOverhead      TimeMinusOverhead            = new fnTimeMinusOverhead();
            fnUpdatePALStatusMonitor UpdatePALStatusMonitor       = new fnUpdatePALStatusMonitor();
            FnWriteOutStatsQ4Buffer  WriteOutStatsQ4Buffer        = new FnWriteOutStatsQ4Buffer();
            FnCheckout                 Checkout                   = new FnCheckout();
            FnStartTransaction         StartTransaction           = new FnStartTransaction();
            FnProductionIssueFunctions ProductionIssueFunctions   = new FnProductionIssueFunctions();
            FnEnterSKU                 EnterSKU                   = new FnEnterSKU();

            Global.RetechScenariosPerformed++;
            UpdatePALStatusMonitor.Run();

            // Create new stopwatch
            Stopwatch MystopwatchTT = new Stopwatch();

            MystopwatchTT.Reset();
            MystopwatchTT.Start();

            Stopwatch MystopwatchTotal = new Stopwatch();

            MystopwatchTotal.Reset();
            MystopwatchTotal.Start();
            Stopwatch MystopwatchQ4          = new Stopwatch();
            Stopwatch MystopwatchModuleTotal = new Stopwatch();
            Stopwatch MystopwatchF1          = new Stopwatch();
            Stopwatch MystopwatchTrade       = new Stopwatch();

            // Start
            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            Global.LogText = @"Start Transaction";
            WriteToLogFile.Run();
            StartTransaction.Run();

            if (Global.DomesticRegister)
            {
                Global.LogText = @"Enter Customer Information";
                WriteToLogFile.Run();

                // Enter customer
                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();

                repo.Retech.FindCustomerTextBox.PressKeys("9727651234{Enter}");
                Thread.Sleep(100);
                while (!repo.RetechFindCustomerView.CustomerSearchCriteria.Enabled)
                {
                    Thread.Sleep(100);
                }

                TimeMinusOverhead.Run((float)MystopwatchModuleTotal.ElapsedMilliseconds);                   // Subtract overhead and store in Global.Q4StatLine
                Global.CurrentMetricDesciption = "Member Card Lookup";
                Global.Module = "Member Card Lookup";
                DumpStatsQ4.Run();
                Global.CurrentMetricDesciption = "Module Total Time";
                DumpStatsQ4.Run();
            }

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            if (Global.DomesticRegister)
            {
                while (!Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }                                            // change 1/8/17
                repo.RetechFindCustomerView.ListBoxItem.Click();

                while (Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
            }

            int NumberSKUs = 1;

            if (Global.NumberOfTradesMinusOne == 4)
            {
                NumberSKUs = 1;
            }
            else if (Global.NumberOfTradesMinusOne == 99)
            {
                NumberSKUs = 4;
            }

            for (int x = 1; x <= NumberSKUs; x++)
            {
                Global.LogText = @"Add Item";
                WriteToLogFile.Run();

                if (Global.DomesticRegister)
                {
                    // Press F1 add item
                    Keyboard.Press("{F1}");                     // Add Item F1
                    MystopwatchF1.Reset();
                    MystopwatchF1.Start();
                    while (!Host.Local.TryFindSingle(repo.AddItemTextInfo.AbsolutePath.ToString(), out element))
                    {
                        Thread.Sleep(100);
                        if (MystopwatchF1.ElapsedMilliseconds > 1000)
                        {
                            Keyboard.Press("{F1}");
                            Thread.Sleep(100);
                            MystopwatchF1.Reset();
                            MystopwatchF1.Start();
                        }
                    }
                }

                Global.LogText = @"Enter purchase SKU";
                WriteToLogFile.Run();

                // Enter SKUs
                if (Global.DomesticRegister)
                {
                    if (NumberSKUs == 1)
                    {
                        repo.AddItemText.TextValue = "115571";
                    }
                    else
                    {
                        repo.AddItemText.TextValue = "883672";
                    }
                    repo.RetechQuickEntryView.TxtWatermark.PressKeys("{Enter}");

                    Thread.Sleep(200);

                    while (!Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                    {
                        if (Host.Local.TryFindSingle(repo.ShellView.AgeVerifiedCommandWPFInfo.AbsolutePath.ToString(), out element))
                        {
                            repo.ShellView.AgeVerifiedCommandWPF.Click();
                            Thread.Sleep(100);
                        }                               // 11/16/18
                    }
//					if(Host.Local.TryFindSingle(repo.ShellView.AgeVerifiedCommandWPFInfo.AbsolutePath.ToString(), out element))
//					{	repo.ShellView.AgeVerifiedCommandWPF.Click();
//						Thread.Sleep(100);
//					}

                    if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                    {
                        repo.ContinueButtonCommand.Click();
                        Thread.Sleep(100);
                    }

                    while (!repo.AddLineItemCommand.Enabled)
                    {
                        if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                        {
                            repo.ContinueButtonCommand.Click();
                        }
                        Thread.Sleep(100);
                    }
                }
                else                 // International
                {
                    EnterSKU.Run();  // Value  set in EnterSKU
                }
            }

//			TimeMinusOverhead.Run((float) MystopwatchQ4.ElapsedMilliseconds);  // Subtract overhead and store in Global.Q4StatLine
//			Global.CurrentMetricDesciption = "Enter SKUs";
//		    Global.Module = "Enter SKUs";
//		    DumpStatsQ4.Run();
//			Global.CurrentMetricDesciption = "Module Total Time";
//          DumpStatsQ4.Run();

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            if (Global.DomesticRegister)
            {
                switch (Global.RetechVersion.Substring(0, 3))
                {
                case "5.6":
                    while (!repo.Retech.TradeKey_5_6_0_103.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    break;

                case "5.7":
                    while (!repo.Retech.TradesF3_5_7_1_2.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    break;

                default:
                    while (!repo.Retech.TradesF3_5_7_1_2.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    break;
                }
            }

            // Press the Trade Key
            if (Global.DomesticRegister)
            {
                Keyboard.Press("{F3}");

                while (!Host.Local.TryFindSingle(repo.Retech.TradesTotalInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
            }
            else                                                    // International
            {
                repo.InternationalInsideSKUField.PressKeys("{F6}"); // Trades
                while (!repo.TradeIn.InternationalTradeSKUFIeld.Enabled)
                {
                    Thread.Sleep(100);
                }
            }

            string[] TradeInSKUList = new string[100];
            TradeInSKUList[0]  = Global.S17Trade1;
            TradeInSKUList[1]  = Global.S17Trade2;
            TradeInSKUList[2]  = Global.S17Trade3;
            TradeInSKUList[3]  = Global.S17Trade4;
            TradeInSKUList[4]  = Global.S17Trade6;     // 02-20-18
            TradeInSKUList[5]  = Global.S17Trade6;
            TradeInSKUList[6]  = Global.S17Trade7;
            TradeInSKUList[7]  = Global.S17Trade8;
            TradeInSKUList[8]  = Global.S17Trade9;
            TradeInSKUList[9]  = Global.S17Trade10;
            TradeInSKUList[10] = Global.S17Trade11;
            TradeInSKUList[11] = Global.S17Trade12;
            TradeInSKUList[12] = Global.S17Trade13;
            TradeInSKUList[13] = Global.S17Trade14;
            TradeInSKUList[14] = Global.S17Trade15;
            TradeInSKUList[15] = Global.S17Trade16;
            TradeInSKUList[16] = Global.S17Trade17;
            TradeInSKUList[17] = Global.S17Trade18;
            TradeInSKUList[18] = Global.S17Trade19;
            TradeInSKUList[19] = Global.S17Trade20;
            TradeInSKUList[20] = Global.S17Trade21;
            TradeInSKUList[21] = Global.S17Trade22;
            TradeInSKUList[22] = Global.S17Trade23;
            TradeInSKUList[23] = Global.S17Trade24;
            TradeInSKUList[24] = Global.S17Trade25;
            TradeInSKUList[25] = Global.S17Trade1;
            TradeInSKUList[26] = Global.S17Trade2;
            TradeInSKUList[27] = Global.S17Trade3;
            TradeInSKUList[28] = Global.S17Trade4;
            TradeInSKUList[29] = Global.S17Trade5;
            TradeInSKUList[30] = Global.S17Trade6;
            TradeInSKUList[31] = Global.S17Trade7;
            TradeInSKUList[32] = Global.S17Trade8;
            TradeInSKUList[33] = Global.S17Trade9;
            TradeInSKUList[34] = Global.S17Trade10;
            TradeInSKUList[35] = Global.S17Trade11;
            TradeInSKUList[36] = Global.S17Trade12;
            TradeInSKUList[37] = Global.S17Trade13;
            TradeInSKUList[38] = Global.S17Trade14;
            TradeInSKUList[39] = Global.S17Trade15;
            TradeInSKUList[40] = Global.S17Trade16;
            TradeInSKUList[41] = Global.S17Trade17;
            TradeInSKUList[42] = Global.S17Trade18;
            TradeInSKUList[43] = Global.S17Trade19;
            TradeInSKUList[44] = Global.S17Trade20;
            TradeInSKUList[45] = Global.S17Trade21;
            TradeInSKUList[46] = Global.S17Trade22;
            TradeInSKUList[47] = Global.S17Trade23;
            TradeInSKUList[48] = Global.S17Trade24;
            TradeInSKUList[49] = Global.S17Trade25;
            TradeInSKUList[50] = Global.S17Trade1;
            TradeInSKUList[51] = Global.S17Trade2;
            TradeInSKUList[52] = Global.S17Trade3;
            TradeInSKUList[53] = Global.S17Trade4;
            TradeInSKUList[54] = Global.S17Trade5;
            TradeInSKUList[55] = Global.S17Trade6;
            TradeInSKUList[56] = Global.S17Trade7;
            TradeInSKUList[57] = Global.S17Trade8;
            TradeInSKUList[58] = Global.S17Trade9;
            TradeInSKUList[59] = Global.S17Trade10;
            TradeInSKUList[60] = Global.S17Trade11;
            TradeInSKUList[61] = Global.S17Trade12;
            TradeInSKUList[62] = Global.S17Trade13;
            TradeInSKUList[63] = Global.S17Trade14;
            TradeInSKUList[64] = Global.S17Trade15;
            TradeInSKUList[65] = Global.S17Trade16;
            TradeInSKUList[66] = Global.S17Trade17;
            TradeInSKUList[67] = Global.S17Trade18;
            TradeInSKUList[68] = Global.S17Trade19;
            TradeInSKUList[69] = Global.S17Trade20;
            TradeInSKUList[70] = Global.S17Trade21;
            TradeInSKUList[71] = Global.S17Trade22;
            TradeInSKUList[72] = Global.S17Trade23;
            TradeInSKUList[73] = Global.S17Trade24;
            TradeInSKUList[74] = Global.S17Trade25;
            TradeInSKUList[75] = Global.S17Trade1;
            TradeInSKUList[76] = Global.S17Trade2;
            TradeInSKUList[77] = Global.S17Trade3;
            TradeInSKUList[78] = Global.S17Trade4;
            TradeInSKUList[79] = Global.S17Trade5;
            TradeInSKUList[80] = Global.S17Trade6;
            TradeInSKUList[81] = Global.S17Trade7;
            TradeInSKUList[82] = Global.S17Trade8;
            TradeInSKUList[83] = Global.S17Trade9;
            TradeInSKUList[84] = Global.S17Trade10;
            TradeInSKUList[85] = Global.S17Trade11;
            TradeInSKUList[86] = Global.S17Trade12;
            TradeInSKUList[87] = Global.S17Trade13;
            TradeInSKUList[88] = Global.S17Trade14;
            TradeInSKUList[89] = Global.S17Trade15;
            TradeInSKUList[90] = Global.S17Trade16;
            TradeInSKUList[91] = Global.S17Trade17;
            TradeInSKUList[92] = Global.S17Trade18;
            TradeInSKUList[93] = Global.S17Trade19;
            TradeInSKUList[94] = Global.S17Trade20;
            TradeInSKUList[95] = Global.S17Trade21;
            TradeInSKUList[96] = Global.S17Trade22;
            TradeInSKUList[97] = Global.S17Trade23;
            TradeInSKUList[98] = Global.S17Trade24;
            TradeInSKUList[99] = Global.S17Trade25;

            Global.LogText = @"Enter Trade SKUs";
            WriteToLogFile.Run();

            for (int soff = 0; soff <= Global.NumberOfTradesMinusOne; soff++)
            {
                if (Global.DomesticRegister)
                {
                    // Press F1 add item
                    Keyboard.Press("{F1}");                     // Add Item F1
                    MystopwatchF1.Reset();
                    MystopwatchF1.Start();
                    while (!Host.Local.TryFindSingle(repo.AddItemTextInfo.AbsolutePath.ToString(), out element))
                    {
                        Thread.Sleep(100);
                        if (MystopwatchF1.ElapsedMilliseconds > 1000)
                        {
                            Keyboard.Press("{F1}");                             // Add Item F1
                            Thread.Sleep(100);
                            MystopwatchF1.Reset();
                            MystopwatchF1.Start();
                        }
                    }

                    // Enter SKUs
                    repo.AddItemText.TextValue = TradeInSKUList[soff];
                    repo.RetechQuickEntryView.TxtWatermark.PressKeys("{Enter}");
                }
                else                 // International
                {
                    // for International SKU search for staring with PO in description
                    //	select * from SKU
                    //	Where Price >= 1 and description like 'PO%'
                    //	order by Price
                    repo.TradeIn.InternationalTradeSKUFIeld.PressKeys("703620{Enter}");
                }
            }

            if (!Global.DomesticRegister)
            {
                while (!repo.TradeIn.InternationalTradeSKUFIeld.Enabled)
                {
                    Thread.Sleep(100);
                }
                repo.TradeIn.InternationalTradeSKUFIeld.PressKeys("{F12}");                     // complete tradces
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Enter Trades";
            Global.Module = "Enter Trades";
            DumpStatsQ4.Run();
            Global.CurrentMetricDesciption = "Module Total Time";
            DumpStatsQ4.Run();



            if (Global.DomesticRegister)
            {
                MystopwatchModuleTotal.Reset();
                MystopwatchModuleTotal.Start();

                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();

                switch (Global.RetechVersion.Substring(0, 3))
                {
                case "5.6":
                    Global.LogText = @"Clicking on Purchase Mode F2";
                    WriteToLogFile.Run();
                    repo.Retech.Self.Focus();
                    Keyboard.Press("{F2}");                              // Purchase Mode F2
                    Thread.Sleep(100);

                    Global.LogText = @"Clicking Cointinue in Purchase Mode F6";
                    WriteToLogFile.Run();
                    repo.Retech.Self.Focus();
                    Keyboard.Press("{F6}");                 // Continue in Purchase Mode F6
                    //            repo.Retech.ContinueToPurchaseMode.Click(); // Continue in Purchase Mode F6
                    Thread.Sleep(100);

                    Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                    WriteToLogFile.Run();
                    while (!Host.Local.TryFindSingle(repo.LineItemCustomerEditorView.CustomerInfoEditProfileIcon_5_6_0_103Info.AbsolutePath.ToString(), out element))
                    {
                        Thread.Sleep(100);
                    }
                    break;

                case "5.7":
                    Global.LogText = @"Clicking on Trades F3 Continue F5 button";
                    WriteToLogFile.Run();
                    repo.Retech.ContinueButtonCommandTrade_5_7_1_2.Click();
                    Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                    WriteToLogFile.Run();
                    while (!Host.Local.TryFindSingle(repo.EditProfileCommandInfo.AbsolutePath.ToString(), out element))
                    {
                        Thread.Sleep(100);
                    }
                    break;

                default:
                    Global.LogText = @"Clicking on Trades F3 Continue F5 button";
                    WriteToLogFile.Run();
                    repo.Retech.ContinueButtonCommandTrade_5_7_1_2.Click();
//						Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
//						WriteToLogFile.Run();
//						while(!Host.Local.TryFindSingle(repo.CustomerEditorView.EditProfileCommand_5_7_1_2Info.AbsolutePath.ToString(), out element))
//						{	Thread.Sleep(100);	}
                    break;
                }
                TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                   // Subtract overhead and store in Global.Q4StatLine
                Global.CurrentMetricDesciption = "Select Purchase Mode";
                Global.Module = "Select Purchase Mode";
                DumpStatsQ4.Run();
                Global.CurrentMetricDesciption = "Module Total Time";
                DumpStatsQ4.Run();

// Start block comment for program flow change
                MystopwatchModuleTotal.Reset();
                MystopwatchModuleTotal.Start();

                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();

                // ##### Start edit customer
                Global.LogText = @"F8 edit customer info";
                WriteToLogFile.Run();

                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();
                // Edit the customer information
//				Keyboard.Press("{F8}"); // edit F8
                while (!repo.EditProfileCommand.Enabled)
                {
                    Thread.Sleep(100);
                }
                repo.EditProfileCommand.Click();
                while (!repo.Gender.Enabled)
                {
                    Thread.Sleep(100);
                }
                if (repo.Gender.SelectedItemText == null)
                {
                    repo.Gender.SelectedItemText = "Female";
                }
                if (repo.EyeColor.SelectedItemText == null)
                {
                    repo.EyeColor.SelectedItemText = "Brown";
                }
                if (repo.HairColor.SelectedItemText == null)
                {
                    repo.HairColor.SelectedItemText = "Brown";
                }

                Thread.Sleep(200);
                if (repo.CustomerEditorView1.DateOfBirth.TextValue == "")
                {
                    repo.CustomerEditorView1.DateOfBirth.TextValue = "01/01/1940";
                }

                if (repo.AlternatePhoneValue.TextValue == "")
                {
                    repo.AlternatePhoneValue.TextValue = "5555555555";
                }
                if (repo.StreetTwoValue.TextValue == "")
                {
                    repo.StreetTwoValue.TextValue = "10 St";
                }
                if (repo.CustInfoEmail.TextValue == "")
                {
                    repo.CustInfoEmail.PressKeys("*****@*****.**");
                }


                // ##### End edit customer
                Global.LogText = @"Save Customer F6";
                WriteToLogFile.Run();
                Keyboard.Press("{F6}");             // Save
                Thread.Sleep(200);

                TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                   // Subtract overhead and store in Global.Q4StatLine
                Global.CurrentMetricDesciption = "Edit Customer Information";
                Global.Module = "Edit Customer Information";
                DumpStatsQ4.Run();
                Global.CurrentMetricDesciption = "Module Total Time";
                DumpStatsQ4.Run();


// End block comment


                MystopwatchModuleTotal.Reset();
                MystopwatchModuleTotal.Start();

                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();


                Global.LogText = @"F6 Continue to Purchase & Contine to pin pad";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.DialogShellView.WaitingForSignatureInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F6}");                 // Continue in Purchase Mode F6 & Continue to Pin Pad F6
                    Thread.Sleep(500);
                }

                Global.LogText = @"Sign on Pin Pad";
                WriteToLogFile.Run();

                Thread.Sleep(50);
                repo.RetechPeripheralHostWindow.SignOnPinPad.Click();

                Thread.Sleep(50);
                repo.RetechPeripheralHostWindow.AcceptOnPinPad.Click();

                Thread.Sleep(50);
                repo.RetechPeripheralHostWindow.MinimizePinPad.Click();              // minimize cause always on top!!!!

                Thread.Sleep(50);
                repo.DialogShellView.SignatureAcceptedCommand.Click();

                Thread.Sleep(100);

                if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                {
                    repo.ContinueButtonCommand.Click();
                    Thread.Sleep(100);
                }

//				Global.LogText = @"SpecialPriceOverride";
//				WriteToLogFile.Run();
//		        ProductionIssueFunctions.SpecialPriceOverride(12.00m);

                TimeMinusOverhead.Run((float)MystopwatchModuleTotal.ElapsedMilliseconds);                   // Subtract overhead and store in Global.Q4StatLine
                Global.NowCustomerLookup       = Global.AdjustedTime;
                Global.CurrentMetricDesciption = "Sign on Pin Pad";
                Global.Module = "Sign on Pin Pad";
                DumpStatsQ4.Run();
                Global.CurrentMetricDesciption = "Module Total Time";
                DumpStatsQ4.Run();
            }


            // @#@#@# C H E C K O U T #@#@#@
            Global.PayWithMethod = "Cash";
            Checkout.Run();

            TimeMinusOverhead.Run((float)MystopwatchTT.ElapsedMilliseconds);   // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Scenario 47";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            // Write out metrics buffer
            WriteOutStatsQ4Buffer.Run();


            Thread.Sleep(2000);
        }
        public void Run()
        {
            Mouse.DefaultMoveTime        = 0;
            Keyboard.DefaultKeyPressTime = 0;
            Delay.SpeedFactor            = 0.0;

            RanorexRepository   repo              = new RanorexRepository();
            fnWriteToLogFile    WriteToLogFile    = new fnWriteToLogFile();
            fnDumpStatsQ4       DumpStatsQ4       = new fnDumpStatsQ4();
            fnTimeMinusOverhead TimeMinusOverhead = new fnTimeMinusOverhead();

            Global.LogText = "IN fnEnterCustomerInformation";
            WriteToLogFile.Run();
            Global.LogFileIndentLevel++;

            // Create new stopwatch
            Stopwatch Mystopwatch = new Stopwatch();

            Mystopwatch.Reset();
            Mystopwatch.Start();

            Ranorex.Unknown element = null;
            string          MyXPATH;

            // Will only fill in fields that are enabled and blank

            //repo.TransactionCustomerInformation.SearchTimeout = 100;
            while (!repo.TransactionCustomerInformation.PnlContent.FirstName.Enabled)
            {
                Thread.Sleep(100);
            }

            // First Name
            if (repo.TransactionCustomerInformation.PnlContent.FirstName.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.FirstName.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.FirstName.TextValue = "PALFirst";
            }

            // Middle Name
            if (repo.TransactionCustomerInformation.PnlContent.MiddleName.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.MiddleName.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.MiddleName.TextValue = "PALMiddle";
            }

            // Last Name
            if (repo.TransactionCustomerInformation.PnlContent.LastName.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.LastName.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.LastName.TextValue = "PALLast";
            }

            // Address 1
            if (repo.TransactionCustomerInformation.PnlContent.Address1.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.Address1.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.Address1.TextValue = "301 Bronco Street";
            }

            // Primary Phone
            if (repo.TransactionCustomerInformation.PnlContent.PrimaryPhone.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.PrimaryPhone.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.PrimaryPhone.TextValue = "9727651234";
            }

            // Address 2
            if (repo.TransactionCustomerInformation.PnlContent.Address2.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.Address2.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.Address2.TextValue = "301 Bronco Street";
            }

            // Mobile Phone
            if (repo.TransactionCustomerInformation.PnlContent.MobilePhone.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.MobilePhone.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.MobilePhone.TextValue = "9727654321";
            }

            // Email
//            if(	repo.TransactionCustomerInformation.PnlContent.Email.Enabled &&
//              repo.TransactionCustomerInformation.PnlContent.Email.TextValue == "")
            if (repo.EmailValue.Enabled &&
                repo.EmailValue.TextValue == "")
            {
                // Create a unique name consisting of time down to millisecond
                System.DateTime DateTimeNow = System.DateTime.Now;
                System.TimeSpan TimeNow     = DateTimeNow.TimeOfDay;
                string          UniqueName  = TimeNow.ToString().Replace(":", "");
                UniqueName = UniqueName.Replace(".", "");
                repo.EmailValue.TextValue = "PAL" + UniqueName + "@PALMail.com";
            }

            // City
            if (repo.TransactionCustomerInformation.PnlContent.City.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.City.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.City.TextValue = "Little Elm";
            }

            // Select State from drop down
            if (repo.TransactionCustomerInformation.PnlContent.StateDropDown.SelectedItemIndex == 0 &&
                repo.TransactionCustomerInformation.PnlContent.StateDropDown.Enabled)
            {
                repo.TransactionCustomerInformation.RawText6.Click("6;5");
                Delay.Milliseconds(200);

                repo.TransactionCustomerInformation.RawText6.Click("6;5");
                Delay.Milliseconds(200);

                repo.ListItemsValues.ListItemMB.Click("55;7");
                Delay.Milliseconds(200);
            }

            // Zip
            if (repo.TransactionCustomerInformation.PnlContent.ZipCode.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.ZipCode.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.ZipCode.TextValue = "75068";
            }

            // Date of Birth
            if (repo.TransactionCustomerInformation.TradeInformation.DateOfBirth.Enabled &&
                repo.TransactionCustomerInformation.TradeInformation.DateOfBirth.TextValue == "  /  /")
            {
                repo.TransactionCustomerInformation.TradeInformation.DateOfBirth.TextValue = "09111952";
            }

            // Male/Female
            if (repo.TransactionCustomerInformation.TradeInformation.MaleFemaleDropDownArrow.TextColor != "#FFFFFF")            // Is "#FFFFFF" when shaded out - not enabled
            {
                repo.TransactionCustomerInformation.TradeInformation.MaleFemaleDropDownArrow.Click("6;8");                      // NOTE must be pressed twice
                repo.TransactionCustomerInformation.TradeInformation.MaleFemaleDropDownArrow.Click("6;8");
                repo.ListItemsValues.Female.Click("99;7");
            }

            // Eye Color
            if (repo.TransactionCustomerInformation.TradeInformation.EyeColorDropDownArrow.TextColor != "#FFFFFF")            // Is "#FFFFFF" when shaded out - not enabled
            {
                repo.TransactionCustomerInformation.TradeInformation.EyeColorDropDownArrow.Click("5;7");                      // NOTE must be pressed twice
                repo.TransactionCustomerInformation.TradeInformation.EyeColorDropDownArrow.Click("5;7");
                repo.ListItemsValues.Blue.Click("115;6");
            }

            // Hair Color
            if (repo.TransactionCustomerInformation.TradeInformation.HairColorDropDownArrow.TextColor != "#FFFFFF")             // Is "#FFFFFF" when shaded out - not enabled
            {
                repo.TransactionCustomerInformation.TradeInformation.HairColorDropDownArrow.Click("8;8");                       // NOTE must be pressed twice
                repo.TransactionCustomerInformation.TradeInformation.HairColorDropDownArrow.Click("8;8");
                repo.ListItemsValues.Black.Click("99;2");
            }

            // Tax ID
            MyXPATH = repo.TransactionCustomerInformation.PnlContent.TaxIDInfo.AbsolutePath.ToString();
            if (Host.Local.TryFindSingle(MyXPATH, out element))
            {
                repo.TransactionCustomerInformation.PnlContent.TaxID.TextValue = "46464645645645";
            }

            // Organization
            MyXPATH = repo.TransactionCustomerInformation.PnlContent.OrganizationNameInfo.AbsolutePath.ToString();
            if (Host.Local.TryFindSingle(MyXPATH, out element))
            {
                repo.TransactionCustomerInformation.PnlContent.OrganizationName.TextValue = "My Ogranization";
            }

            // Select "Other" for Reason for Exemption
            MyXPATH = repo.TransactionCustomerInformation.PnlContent.ReasonForExemptionDropDownArrowInfo.AbsolutePath.ToString();
            if (Host.Local.TryFindSingle(MyXPATH, out element))
            {
                repo.TransactionCustomerInformation.PnlContent.ReasonForExemptionDropDownArrow.Click("6;5");
                //Thread.Sleep(50);
                repo.ListItemsValues.Other.Click("211;10");
            }

            // Country
            if (repo.TransactionCustomerInformation.PnlContent.Country.Enabled &&
                repo.TransactionCustomerInformation.PnlContent.Country.TextValue == "")
            {
                repo.TransactionCustomerInformation.PnlContent.Country.TextValue = "US";
            }

            Keyboard.Press("{F5}");
            Thread.Sleep(100);

            // Check for Refund Warning pop-up if yes press F5 for cash
            if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.WarningPowerUpMemberInfo.AbsolutePath.ToString(), out element))
            {
                Global.LogText = "Popup - Warning Power Up Member";
                WriteToLogFile.Run();
                Keyboard.Press("{F5}");
                Thread.Sleep(100);
            }

            // Check for "If the customer also want to update their GI subscription ..."
            // NOTE: this has same xpath as no customer found by phone number popup
            if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.WarningPowerUpMemberInfo.AbsolutePath.ToString(), out element))
            {
                Global.LogText = "Popup - If the customer also want to update their GI subscription ...";
                WriteToLogFile.Run();
                Keyboard.Press("{F5}");
                Thread.Sleep(100);
                Keyboard.Press("{F5}");
                Thread.Sleep(100);
            }

            // Check for if customer want to update GI subscription
            if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.PopUpIfWantToUpdateGIInfo.AbsolutePath.ToString(), out element))
            {
                Global.LogText = "Popup - if customer want to update GI subscription";
                WriteToLogFile.Run();
                Keyboard.Press("{F5}");
                Thread.Sleep(100);
            }

            while (Host.Local.TryFindSingle(repo.TransactionCustomerInformation.PnlContent.FirstNameInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);

                // Check for Invalid email address
                if (Host.Local.TryFindSingle(repo.InvalidFieldDialog.InvalidEmailAddressInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Invalid email address";
                    WriteToLogFile.Run();
                    repo.InvalidFieldDialog.Skip.Click("4;15");
                }
                // Check for Invalid email address Windows 7
                if (Host.Local.TryFindSingle(repo.InvalidFieldDialog.VerifyTheEmailAddressWithTheCustomInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Invalid email address";
                    WriteToLogFile.Run();
                    Keyboard.Press("{Escape}");
                }

                // Check for Because the customer is a PowerUp member...
                if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.BecauseTheCustomerIsAPowerUpMemberInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Because the customer is a PowerUp member..";
                    WriteToLogFile.Run();
                    Keyboard.Press("{F5}");
                    Thread.Sleep(100);
                }

                // Check for Customer communication email address...
                if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.CustomersCommunicationEmailAddressHaInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Customer communication email address..";
                    WriteToLogFile.Run();
                    Keyboard.Press("{F5}");
                    Thread.Sleep(100);
                }
                // Check for Customer communication email address...
                if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.CustomersCommunicationEmailAddressInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Customer communication email address..";
                    WriteToLogFile.Run();
                    Keyboard.Press("{F5}");
                    Thread.Sleep(100);
                }

                // Check for Unable to Validate Customer
                if (Host.Local.TryFindSingle(repo.PopUpCustomerLookupUnavailable.WeAreUnableToValidateTheCustomersInfo.AbsolutePath.ToString(), out element))
                {
                    Global.LogText = "Popup - Unable to Validate Customer..";
                    WriteToLogFile.Run();
                    Keyboard.Press("{F5}");
                    Thread.Sleep(100);
                }
            }


            TimeMinusOverhead.Run((float)Mystopwatch.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Enter Customer Information";
            Global.Module = "fnEnterCustomerInformation";
            DumpStatsQ4.Run();

            Global.LogFileIndentLevel--;
            Global.LogText = "OUT fnEnterCustomerInformation";
            WriteToLogFile.Run();
        }
        public void Run()
        {       //*****************Start  Scenario 39 - Retech - Enter 10 SKUs - credit card ******************
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            Ranorex.Unknown element = null;
            Global.AbortScenario = false;

            // Uses same SKU and Customer for Scenarios 3, 4, and 5

            RanorexRepository        repo = new RanorexRepository();
            fnTimeMinusOverhead      TimeMinusOverhead      = new fnTimeMinusOverhead();
            fnDumpStatsQ4            DumpStatsQ4            = new fnDumpStatsQ4();
            fnWriteToLogFile         WriteToLogFile         = new fnWriteToLogFile();
            fnWriteToErrorFile       WriteToErrorFile       = new fnWriteToErrorFile();
            FnWriteOutStatsQ4Buffer  WriteOutStatsQ4Buffer  = new FnWriteOutStatsQ4Buffer();
            fnUpdatePALStatusMonitor UpdatePALStatusMonitor = new fnUpdatePALStatusMonitor();
            FnCheckout         Checkout         = new FnCheckout();
            FnStartTransaction StartTransaction = new FnStartTransaction();

            Global.CurrentScenario = 39;

            if (!Global.DoScenarioFlag[Global.CurrentScenario])
            {
                return;
            }

            Global.RetechScenariosPerformed++;
            UpdatePALStatusMonitor.Run();

            // Create new stopwatch
            Stopwatch MystopwatchTT = new Stopwatch();

            MystopwatchTT.Reset();
            MystopwatchTT.Start();

            Stopwatch MystopwatchTotal = new Stopwatch();

            MystopwatchTotal.Reset();
            MystopwatchTotal.Start();
            Stopwatch MystopwatchQ4          = new Stopwatch();
            Stopwatch MystopwatchModuleTotal = new Stopwatch();
            Stopwatch MystopwatchF1          = new Stopwatch();

            Global.LogText = @"---> fnDoScenario39 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 39 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Start
            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            Global.LogText = @"Start Transaction";
            WriteToLogFile.Run();
            StartTransaction.Run();

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            string[] MySKUs = new string[10];
            MySKUs[0] = Global.S9SKU1;
            MySKUs[1] = Global.S9SKU2;
            MySKUs[2] = Global.S9SKU3;
            MySKUs[3] = Global.S9SKU4;
            MySKUs[4] = Global.S9SKU5;
            MySKUs[5] = Global.S9SKU6;
            MySKUs[6] = Global.S9SKU7;
            MySKUs[7] = Global.S9SKU8;
            MySKUs[8] = Global.S9SKU9;
            MySKUs[9] = Global.S9SKU10;

            MystopwatchF1.Reset();
            MystopwatchF1.Start();

            Global.LogText = @"Enter SKUs";
            WriteToLogFile.Run();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            for (int soff = 0; soff <= 9; soff++)
            {
                // Press F1 add item
                Keyboard.Press("{F1}");
                MystopwatchF1.Reset();
                MystopwatchF1.Start();
                while (!Host.Local.TryFindSingle(repo.AddItemTextInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                    if (MystopwatchF1.ElapsedMilliseconds > 1000)
                    {
                        Keyboard.Press("{F1}");
                        Thread.Sleep(100);
                        MystopwatchF1.Reset();
                        MystopwatchF1.Start();
                    }
                }

                // Enter SKU
                Global.LogText = @"Entering SKU: " + MySKUs[soff];
                WriteToLogFile.Run();
                repo.AddItemText.TextValue = MySKUs[soff];
                repo.RetechQuickEntryView.TxtWatermark.PressKeys("{Enter}");
                while (!repo.AddLineItemCommand.Enabled)
                {
                    if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                    {
                        repo.ContinueButtonCommand.Click();
                    }
                    Thread.Sleep(100);
                }
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Enter SKUs";
            Global.Module = "Enter 10 SKUs";
            DumpStatsQ4.Run();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            Keyboard.Press("{F5}");                                          // Continue F5 Recommended Pre-Owned Items
            Thread.Sleep(200);
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds); // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F5] Continue";
            Global.Module = "Enter 10 SKUs";
            DumpStatsQ4.Run();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            Keyboard.Press("{F6}");                                          // I've explained these related products to the customer F6
            Thread.Sleep(100);
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds); // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F6]: explain related products";
            Global.Module = "Enter 10 SKUs";
            DumpStatsQ4.Run();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Keyboard.Press("{F5}");                                          // Continue F5
            Thread.Sleep(200);
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds); // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F5]: GPG";
            Global.Module = "Enter 10 SKUs";
            DumpStatsQ4.Run();

            TimeMinusOverhead.Run((float)MystopwatchModuleTotal.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.NowCustomerLookup       = Global.AdjustedTime;
            Global.CurrentMetricDesciption = "Module Total Time";
            Global.Module = "Enter 10 SKUs";
            DumpStatsQ4.Run();

            // @#@#@# C H E C K O U T #@#@#@
            Global.PayWithMethod = "Credit";
            Checkout.Run();

            TimeMinusOverhead.Run((float)MystopwatchTT.ElapsedMilliseconds);   // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Scenario 39";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            // Write out metrics buffer
            WriteOutStatsQ4Buffer.Run();

            Global.LogText = "<--- fnDoScenario39 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 39 OUT", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            Thread.Sleep(2000);

            // ***********End Scenario 39*****************
        }
Exemple #22
0
 public static void ClickFirstCell(this Ranorex.Unknown container)
 {
     container.Click("49;26");
 }
Exemple #23
0
 public static void MoveDown(this Ranorex.Unknown container)
 {
     container.PressKeys("{Down}");
 }
Exemple #24
0
 public static void MoveLeft(this Ranorex.Unknown container)
 {
     container.PressKeys("{Shift down}{Tab}{Shift up}");
 }
Exemple #25
0
 public static void MoveRight(this Ranorex.Unknown container)
 {
     container.PressKeys("{Tab}");
 }
Exemple #26
0
 public static void Toggle(this Ranorex.Unknown container)
 {
     container.PressKeys("{Space}");
 }
Exemple #27
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository        repo = new RanorexRepository();
            fnUpdatePALStatusMonitor UpdatePALStatusMonitor = new fnUpdatePALStatusMonitor();
            fnWriteToLogFile         WriteToLogFile         = new fnWriteToLogFile();
            FnWriteOutStatsQ4Buffer  WriteOutStatsQ4Buffer  = new FnWriteOutStatsQ4Buffer();
            fnDumpStatsQ4            DumpStatsQ4            = new fnDumpStatsQ4();
            fnTimeMinusOverhead      TimeMinusOverhead      = new fnTimeMinusOverhead();

            Ranorex.Unknown element = null;
            Global.AbortScenario = false;

            //*****************Start  Scenario 21 - WIS Web-In-Store ******************
            Global.CurrentScenario = 21;

            if (!Global.IndirectCall)
            {
                if (!Global.DoScenarioFlag[Global.CurrentScenario])
                //			if(Global.CurrentScenario != 9999)
                {
                    return;
                }
            }

            Global.ScenarioExecuted = true;

            Global.RetechScenariosPerformed++;
            UpdatePALStatusMonitor.Run();

            // Create new stopwatch
            Stopwatch MystopwatchTT = new Stopwatch();

            MystopwatchTT.Reset();
            MystopwatchTT.Start();
            Stopwatch MystopwatchModuleTotal = new Stopwatch();

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            Stopwatch MystopwatchQ4 = new Stopwatch();

            Global.LogText = @"---> fnDoScenario21 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 21 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Click on back office link
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Clicking on Back Office link";
            WriteToLogFile.Run();
            repo.Retech.Self.Click();
            repo.Retech.Self.PressKeys("{LShiftKey down}{F3}{LShiftKey up}");
            Global.LogText = @"Waiting for Back Office home screen";
            WriteToLogFile.Run();
            while (!repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Load Back Office";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();
            Thread.Sleep(1000);

            // Press Shift-F2 for WIS
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Pressing Shift-F2 for WIS";
            WriteToLogFile.Run();
            Keyboard.Press("{LShiftKey down}{F2}{LShiftKey up}");
            Global.LogText = @"Waiting for Browser to load";
            WriteToLogFile.Run();
            Thread.Sleep(3000);
            while (!Host.Local.TryFindSingle(repo.WebInStoreProductMozillaFirefox.FireFoxTextInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(200);
            }
            while (!repo.WebInStoreProductMozillaFirefox.FireFoxText.Enabled)
            {
                Thread.Sleep(200);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Load Browser";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();
            Thread.Sleep(200);

            // Enter SKU
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Enter SKU";
            WriteToLogFile.Run();
            repo.WebInStoreProductMozillaFirefox.FireFoxText.PressKeys("100800{Return}");              // ##### E N T E R    S K U ###
            Thread.Sleep(100);
            Global.LogText = @"Waiting for SKU link to display";
            WriteToLogFile.Run();
            while (!repo.MozillaFirefoxGameStopEdition.ProductDetails.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Search for SKU";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Product Details
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Product Details";
            WriteToLogFile.Run();
            repo.MozillaFirefoxGameStopEdition.ProductDetails.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Product Details to display";
            WriteToLogFile.Run();
            while (!repo.WebInStoreProductMozillaFirefox.ProductDetailsText.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Get Product Details";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Add to Cart
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Add to Cart";
            WriteToLogFile.Run();
            repo.WebInStoreProductMozillaFirefox.Grouping.AddToCart.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Item(s) added to cart";
            WriteToLogFile.Run();
            while (!repo.WebInStoreProductMozillaFirefox.Grouping.TextItemSAddedToCart.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Add to Cart";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Cart Continue
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Cart Continue";
            WriteToLogFile.Run();
            repo.WebInStoreProductMozillaFirefox.Grouping.Continue.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Shipping Address";
            WriteToLogFile.Run();
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddress1.Click();
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Load Shipping Address";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Fill in shipping address and click continue
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Fill in shipping address and click continue";
            WriteToLogFile.Run();
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressFirstName.PressKeys("PAL");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressLastName.PressKeys("Last");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressAddress.PressKeys("301 Tower");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressCity.PressKeys("MyCity");
            //state start
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ComboBox.Click("214;9");
            Delay.Milliseconds(200);
            repo.Dropdown.Self.Click("169;23");
            Delay.Milliseconds(200);
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ComboBox.PressKeys("{LControlKey down}{LMenu}{LControlKey up}");
            // State end
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressZipPostal.PressKeys("76401");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressPhone.PressKeys("9727651234");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressEmail.PressKeys("*****@*****.**");
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressReTypeEmail.PressKeys("*****@*****.**");
            // Press continue
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressContinue.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Shipping Address Confirm";
            WriteToLogFile.Run();
            while (!repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressConfirmButton.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Fill in Shipping Address";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Shipping Address Confirmed
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Shipping Address Confirmed";
            WriteToLogFile.Run();
            repo.ShippingAddressMozillaFirefoxGame.ShippingAddress.ShippingAddressConfirmButton.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Shipping Method";
            WriteToLogFile.Run();
            while (!repo.ShippingAddressMozillaFirefoxGame.Grouping.ShippingMethod.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Shipping Address Confirmed";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Shipping Method Continue
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Shipping Method Continue";
            WriteToLogFile.Run();
            repo.ShippingAddressMozillaFirefoxGame.Grouping.ShippingMethodContinue.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Order Review";
            WriteToLogFile.Run();
            while (!repo.ShippingAddressMozillaFirefoxGame.Grouping.OrderReview.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Shipping Method Confirmed";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Click on Order Review Continue
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Click on Order Review Continue";
            WriteToLogFile.Run();
            repo.ShippingAddressMozillaFirefoxGame.Grouping.OrderReviewSubmit.Click();
            Thread.Sleep(100);
            Global.LogText = @"Waiting for Order Confirmation";
            WriteToLogFile.Run();
            while (!repo.ShippingAddressMozillaFirefoxGame.Grouping.GameStopWebOrderConfirmation.Enabled)
            {
                Thread.Sleep(100);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Order Confirmation";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            Global.TempFloat = (float)MystopwatchModuleTotal.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchModuleTotal.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Module Total Time";
            Global.Module = "WIS:";
            DumpStatsQ4.Run();

            // Press Escape to exit
            repo.ShippingAddressMozillaFirefoxGame.FireFoxExit.Click();

            TimeMinusOverhead.Run((float)MystopwatchTT.ElapsedMilliseconds);   // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Scenario 21";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            // Write out metrics buffer
            WriteOutStatsQ4Buffer.Run();

            Global.LogText = "<--- fnDoScenario21 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 21 OUT", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            return;

            // ***********End Scenario 21 *****************
        }
Exemple #28
0
 public static void ClickFirstCell(this Ranorex.Unknown container, Location loc)
 {
     container.Click(loc);
 }
Exemple #29
0
        public void Run()
        {       //*****************Start  Scenario 16 - Retech - Returns ******************
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            Ranorex.Unknown element = null;
            Global.AbortScenario = false;

            // Uses same SKU and Customer for Scenarios 3, 4, and 5

            RanorexRepository        repo = new RanorexRepository();
            fnTimeMinusOverhead      TimeMinusOverhead      = new fnTimeMinusOverhead();
            fnDumpStatsQ4            DumpStatsQ4            = new fnDumpStatsQ4();
            fnWriteToLogFile         WriteToLogFile         = new fnWriteToLogFile();
            fnWriteToErrorFile       WriteToErrorFile       = new fnWriteToErrorFile();
            FnWriteOutStatsQ4Buffer  WriteOutStatsQ4Buffer  = new FnWriteOutStatsQ4Buffer();
            fnUpdatePALStatusMonitor UpdatePALStatusMonitor = new fnUpdatePALStatusMonitor();
            FnCheckout         Checkout         = new FnCheckout();
            FnStartTransaction StartTransaction = new FnStartTransaction();
            FnEnterSKU         EnterSKU         = new FnEnterSKU();

            Global.CurrentScenario = 16;

            if (!Global.IndirectCall)
            {
                if (!Global.DoScenarioFlag[Global.CurrentScenario])
                {
                    return;
                }
            }

            Global.ScenarioExecuted = true;

            Global.RetechScenariosPerformed++;
            UpdatePALStatusMonitor.Run();

            // Create new stopwatch
            Stopwatch MystopwatchTT = new Stopwatch();

            MystopwatchTT.Reset();
            MystopwatchTT.Start();

            Stopwatch MystopwatchF1 = new Stopwatch();

            Stopwatch MystopwatchTotal = new Stopwatch();

            MystopwatchTotal.Reset();
            MystopwatchTotal.Start();
            Stopwatch MystopwatchQ4          = new Stopwatch();
            Stopwatch MystopwatchModuleTotal = new Stopwatch();

            Global.LogText = @"---> fnDoScenario16 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 16 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Start

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            StartTransaction.Run();

            MystopwatchModuleTotal.Reset();
            MystopwatchModuleTotal.Start();

            Global.LogText = @"Add Item";
            WriteToLogFile.Run();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            if (Global.DomesticRegister)
            {
                // Press F1 add item
                Keyboard.Press("{F1}");
                MystopwatchF1.Reset();
                MystopwatchF1.Start();
                while (!Host.Local.TryFindSingle(repo.AddItemTextInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
                TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                   // Subtract overhead and store in Global.Q4StatLine
                Global.CurrentMetricDesciption = "[F1] wait for add item";
                Global.Module = "F1 Add Item";
                DumpStatsQ4.Run();
                Global.CurrentMetricDesciption = "Module Total Time";
                DumpStatsQ4.Run();
            }
            else
            {
                repo.IPOSScreen.Self.Click();
            }

            Global.CurrentSKU = Global.S17Trade5;
            EnterSKU.Run();

// 8-1-18			var activityRoot = repo.Retech.ActivityRoot;

            // Press returns
            if (Global.DomesticRegister)
            {
//				while(!repo.Retech.ReturnsF4.Enabled) // 7-23-18
//					{	Thread.Sleep(100); }
//				repo.Retech.ReturnsF4.Click();
                Keyboard.Press("{F4}");
                Thread.Sleep(100);
            }
            else                                                            // International
            {
                repo.IPOSInternationalEnterSKUField.Text.PressKeys("{F3}"); // Returns
                //	while(!repo.FormPOS1.ReturnSKuField.Enabled) // 3/25/19
                while (!repo.CodeF4Password.Enabled)
                {
                    Thread.Sleep(100);
                }
            }

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            for (int RetNum = 1; RetNum <= 5; RetNum++)
            {
                if (Global.DomesticRegister)
                {
                    // select add item and add the SKU
                    while (!repo.AddLineItemCommand.Enabled)
                    {
                        Thread.Sleep(100);
                    }
                    Thread.Sleep(100);
                    // repo.AddLineItemCommand.Click(); 1-21-19
                    Keyboard.Press("{F1}");
                    Thread.Sleep(100);
                    repo.AddItemText.TextValue = Global.S4Sku1;
                    Keyboard.Press("{Enter}");

                    // Select Defective for retrun reason
                    //repo.ReturnReason.Click();  1-21-19
                    repo.ShellView.Rectangle.Click();
                    Thread.Sleep(200);
                    //repo.Defective.Click();  1-21-19
                    repo.Source.Defective.Click();
                    Thread.Sleep(100);

                    //Click on Scan or select receipt and select no receipt
                    repo.Retech.SelectReceipt.Click();
                    Thread.Sleep(100);
                    repo.Retech.NoReceiptAvailableCommand.Click();
                    Thread.Sleep(200);

                    // Press F5 continue
                    Keyboard.Press("{F5}");
                }
                else                // International
                {
                    while (!repo.CodeF4Password.Visible)
                    {
                        Thread.Sleep(100);
                    }

                    repo.CodeF4Password.Click("72;8");
                    Delay.Milliseconds(200);

                    repo.CodeF4Password.PressKeys("238325{Return}");

                    Keyboard.Press("n{Return}");

                    Keyboard.Press("{F5}");

                    Keyboard.Press("{F12}");

//					repo.InternationalReturnSKUField.TextValue = "238325";	// Enter SKU to return
//					repo.InternationalReturnSKUField.PressKeys("{Return}");
//
//					repo.ItemSearch.Self.PressKeys("n");	// no box not opened
//					while(!repo.ItemSearch.Self.Enabled) Thread.Sleep(100);
//					repo.ItemSearch.Self.PressKeys("{Return}"); // return defective
//					while(!repo.ItemSearch.Self.Enabled) Thread.Sleep(100);
//					repo.ItemSearch.Self.PressKeys("{F5}");		// no receipt
//					while(!repo.ItemSearch.Self.Enabled) Thread.Sleep(100);
//					repo.ItemSearch.Self.PressKeys("{F12}");	// OK
//					while(!repo.ItemSearch.Self.Enabled) Thread.Sleep(100);
                }
            }

            if (!Global.DomesticRegister)                       // if international to final apply for returns
            {
                Keyboard.Press("{F12}");
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Enter 5 Returns";
            Global.Module = "Returns";
            DumpStatsQ4.Run();

            Global.CurrentMetricDesciption = "Module Total Time";
            DumpStatsQ4.Run();


            // @#@#@# C H E C K O U T #@#@#@
            Global.PayWithMethod = "Cash";
            Checkout.Run();

            TimeMinusOverhead.Run((float)MystopwatchTT.ElapsedMilliseconds);   // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Scenario 16";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            // Write out metrics buffer
            WriteOutStatsQ4Buffer.Run();

            Global.LogText = "<--- fnDoScenario16 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 16 OUT", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            Thread.Sleep(2000);

            // ***********End Scenario 16*****************
        }
Exemple #30
0
 public static List <List <string> > GetContents(this Ranorex.Unknown container)
 {
     return(GetContents(container, true));
 }