コード例 #1
0
ファイル: fnCommon14and15.cs プロジェクト: joeyrodrigue/PAL
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            Ranorex.Unknown element = null;

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

            Stopwatch MystopwatchQ4 = new Stopwatch();
            Stopwatch MystopwatchTT = new Stopwatch();

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Waiting for Performance Dashboard Menu to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.DashBoardF11Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.DashBoardF11.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display Dashboard Menu";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();

            //
            // Sales F1 Report
            //
            Global.LogText = @"Waiting for Sales F1 Report to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.SalesButtonF1Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.SalesButtonF1.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.SalesButtonF1.Click("184;26");
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.SalesTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.SalesTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display Sales F1 Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();


            //
            // Five To Drive F2 Report
            //
            Global.LogText = @"Waiting for Five To Drive F2 Report to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.FiveToDriveButtonF2Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.FiveToDriveButtonF2.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.FiveToDriveButtonF2.Click("104;13");
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.FiveToDriveTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.FiveToDriveTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display Five To Drive F2 Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();


            //
            // Guest F3 Report
            //
            Global.LogText = @"Waiting for Guest F3 Report to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.GuestButtonF3Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.GuestButtonF3.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.GuestButtonF3.Click("160;9");
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.GuestTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.GuestTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display Guest F3 Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();

            //
            // Circle of Life F4 Report
            //
            Global.LogText = @"Waiting for Circle of Life F4 Report to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.CircleOfLifeButtonF4Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.CircleOfLifeButtonF4.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.CircleOfLifeButtonF4.Click("198;9");
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.CircleOfLifeTaskBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.CircleOfLifeTaskBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display Circle of Life F4 Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            // Sub Circle of Life Reports
            // F1 Reservations
            Global.LogText = @"Waiting for F1 Reservations Report to display";
            WriteToLogFile.Run();
            while (!repo.ShellRoot.SalesButtonF1.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.SalesButtonF1.Click();
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.ReservationsTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.ReservationsTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                       // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display F1 Reservations Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            Thread.Sleep(1000);
            repo.ShellRoot.Self.PressKeys("{Escape}");
            Global.LogText = @"Waiting for Circle of Life to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.CircleOfLifeTaskBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.CircleOfLifeTaskBar.Enabled)
            {
                Thread.Sleep(100);
            }
            // F2 Power Up Rewards
            Global.LogText = @"Waiting for F2 Power Up Rewards Report to display";
            WriteToLogFile.Run();
            while (!repo.ShellRoot.FiveToDriveButtonF2.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.FiveToDriveButtonF2.Click();
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.PowerUpRewardsTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.PowerUpRewardsTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                       // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display F2 Power Up Rewards Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            Thread.Sleep(1000);
            repo.ShellRoot.Self.PressKeys("{Escape}");
            Global.LogText = @"Waiting for Circle of Life to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.CircleOfLifeTaskBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.CircleOfLifeTaskBar.Enabled)
            {
                Thread.Sleep(100);
            }
            // Exit Circle of Life Report
            GoHome();

            //
            // Team F5 Report
            //
            Global.LogText = @"Waiting for Team F5 Report to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.TeamF5Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.TeamF5.Enabled)
            {
                Thread.Sleep(100);
            }
            Thread.Sleep(100);
            repo.ShellRoot.TeamF5.Click("53;11");
            Thread.Sleep(100);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.TeamTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.TeamTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display Team F5 Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            Global.LogText = @"Waiting for Performance Dashboard Menu to display";
            WriteToLogFile.Run();
            Thread.Sleep(100);
            // Sub report
            // F1 Collectible Sales
            Global.LogText = @"Waiting for F1 Collectible Sales Report to display";
            WriteToLogFile.Run();
            repo.ShellRoot.Self.PressKeys("{F1}");
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.CollectiblesSalesDollarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.CollectiblesSalesDollar.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);                       // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Display F1 Collectible Sales Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            Thread.Sleep(1000);
            repo.ShellRoot.Self.PressKeys("{Escape}");
            Global.LogText = @"Waiting for Circle of Life to display";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.TeamTitleBarInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.TeamTitleBar.Enabled)
            {
                Thread.Sleep(100);
            }
            // Exit Team Report
            GoHome();

            // My Report
            Global.LogText = @"Waiting for My Report Report to display";
            WriteToLogFile.Run();
            repo.ShellRoot.Icon.Click("1;22");
            Delay.Milliseconds(200);
            repo.ShellRoot.MyREPORT.Click("127;23");
            Delay.Milliseconds(200);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.EmployeeComparisonCtrlPlusTInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.EmployeeComparisonCtrlPlusT.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display My Report Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();
            while (Host.Local.TryFindSingle(repo.ShellRoot.EmployeeComparisonCtrlPlusTInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            // My Goals
            Global.LogText = @"Waiting for My Goals Report to display";
            WriteToLogFile.Run();
            repo.ShellRoot.Icon.Click("1;22");
            Delay.Milliseconds(200);
            repo.ShellRoot.Text.Click("38;9");
            Delay.Milliseconds(200);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.EntireStoreInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.EntireStore.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display My Goals Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();

            // My Schedule Planner
            Global.LogText = @"Waiting for My Schedule Planner Report to display";
            WriteToLogFile.Run();
            repo.ShellRoot.Icon.Click("1;22");
            Delay.Milliseconds(200);
            repo.ShellRoot.Text1.Click("87;6");
            Delay.Milliseconds(200);
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            while (!Host.Local.TryFindSingle(repo.ShellRoot.SchedulePlannerHeaderInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            while (!repo.ShellRoot.SchedulePlannerHeader.Enabled)
            {
                Thread.Sleep(100);
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Display My Schedule Planner Report";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();
            GoHome();
        }
コード例 #2
0
ファイル: fnScenario21_WIS.cs プロジェクト: joeyrodrigue/PAL
        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 *****************
        }
コード例 #3
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 13 - eMail ******************
            Global.CurrentScenario = 13;

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

            Global.ScenarioExecuted = true;

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

            if (Global.CombinedIPOS)
            {
                repo.GoToBackOffice.Click();
                Thread.Sleep(200);
            }

            // 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 = @"---> fnDoScenario13 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 13 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

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

                Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IPOS270141HomeScreen.Element1' at 269;333.", repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo, new RecordItemIndex(0));
                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();
                Global.LogText = @"Clicking on Back Office link";
                WriteToLogFile.Run();
                repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Click();
                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 = "eMail:";
                DumpStatsQ4.Run();
            }
            else
            {
                repo.IPOSScreen.Self.Click();
            }

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

//            Global.LogText = @"Waiting for F6 Cover Artl";
//			WriteToLogFile.Run();
//              while(!Host.Local.TryFindSingle(repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo.AbsolutePath.ToString(), out element))
//            {
//              Thread.Sleep(100);
//            }

            Global.LogText = @"Clicking on F6 Live-eMail";
            WriteToLogFile.Run();

            if (Global.DomesticRegister)
            {
                while (!Host.Local.TryFindSingle(repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }                                            // change 1/8/17
                repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.PressKeys("{F6}");
            }
            else
            {
// 08-13-2018	repo.IPOSHomeScreen.InternationalIPOS.PressKeys("{F6}");
                repo.IPOSScreen.Self.PressKeys("{F6}");
            }

            Thread.Sleep(100);
            Global.LogText = @"logging in";
            WriteToLogFile.Run();
            Keyboard.Press("psu");
            Thread.Sleep(100);
            Keyboard.Press("advanced{Return}");

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F6] Live eMail and login";
            Global.Module = "eMail:";
            DumpStatsQ4.Run();

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

            Global.LogText = @"Waiting for eMail listing";
            WriteToLogFile.Run();
//			while(!repo.MailViewer.Self.Enabled)
//			while(!repo.MailViewer1.Self.Enabled)
            while (!Host.Local.TryFindSingle(repo.MailViewer.EmailScreenTitleInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "display eMail listing";
            Global.Module = "eMail:";
            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 = "eMail:";
            DumpStatsQ4.Run();

            Keyboard.Press("{Escape}");

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

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

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

            if (Global.CombinedIPOS)
            {
                repo.BackOffice275111HomeScreen.Self.Focus();
                repo.BackOffice275111HomeScreen.Self.Click();
                Keyboard.Press("{F5}");
                Thread.Sleep(200);
                if (Host.Local.TryFindSingle(repo.ReservationDeposit.WrongBusinessDateInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F5}");
                    Thread.Sleep(200);
                }
            }

            return;

            // ***********End Scenario 13*****************
        }
コード例 #4
0
        public void Run()
        {       //*****************Start  Scenario 33 - Retech - Simple One SKU Pay with Cash ******************
            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 = 33;

            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 = @"---> fnDoScenario33 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 33 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);
                    if (MystopwatchF1.ElapsedMilliseconds > 1000)
                    {
                        Keyboard.Press("{F1}");
                        Thread.Sleep(100);
                        MystopwatchF1.Reset();
                        MystopwatchF1.Start();
                    }
                }

                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();
            }

            Global.CurrentSKU = Global.S4Sku1;
            EnterSKU.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 33";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            if (!Global.AbortScenario)
            {
                // Write out metrics buffer
                WriteOutStatsQ4Buffer.Run();
            }
            else
            {
                Global.Q4StatBuffer = "";
            }

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

            Thread.Sleep(2000);

            // ***********End Scenario 33*****************
        }
コード例 #5
0
        public void Run()
        {       //**************Start  fnScenario30 Special Production Issues Test**********************
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            Global.CurrentScenario = 30;
            Global.AbortScenario   = false;

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

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

            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();

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

            //#####################################################################################
            //	Production Issue: 1705/01 9/13 Access Lock Bug
            //	1.	Add SKU 930586 to the order.
            //	2.	Add a PUR pro customer to the order.
            //	3.	Pay $10.00 with cash.
            //	4.	Pay the rest with debit.
            bool Do_Issue_1705_01 = true;
            //#####################################################################################

            //#####################################################################################
            //	Production Issue: 5886/01 8/10 Access Lock Bug Reg 1 Trans 14
            //	1.	Add a PUR pro customer to the order.
            //	2.	Return SKU 953162 as defective.
            //	3.	Purchase SKU 953162.
            bool Do_Issue_5886_01 = true;
            //#####################################################################################

            //#####################################################################################
            //	Production Issue: 3432/01 6/21 Missing Transaction Tr5
            //	1.	Add a PUR pro customer to the order.
            //	2.	Trade SKU 112321
            //	3.	Trade SKU 954010
            //	4.	Trade SKU 109523
            //	5.	Trade SKU 954013
            //	6.	Trade SKU 109536
            //	7.	Trade SKU 103080
            //	8.	Trade SKU 107399
            //	9.	Purchase SKU 109386
            //	10.	Purchase SKU 101820
            //	11.	Pre-Order SKU 113170, with a deposit of $9.92
            //	12.	Pay the rest with cash.
            bool Do_Issue_3432_01 = true;

            //#####################################################################################

            // Exedute the issue tests
            if (Do_Issue_1705_01)
            {
                Issue_1705_01();
            }
            if (Do_Issue_5886_01)
            {
                Issue_5886_01();
            }
            if (Do_Issue_3432_01)
            {
                Issue_3432_01();
            }

            Global.LogText = "<--- fnDoScenario30 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 30 OUT", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));
        }
コード例 #6
0
        public void Run()
        {       //*****************Start  Scenario 40 - Retech - Card Balance ******************
            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();
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();

            Global.CurrentScenario = 43;

            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 = @"---> fnDoScenario43 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 40 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Start


            // Check card balance
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            repo.ShellView.CardBalanceButton.Click();
            Thread.Sleep(100);
            repo.CardBalanceInquiryView.AccountNumber.TextValue = "3876608052056";
            repo.CardBalanceInquiryView.AccountNumber.PressKeys("{Enter}");
            while (!repo.CardBalanceInquiryView.PowerUpRewardsCardBalanceText.Visible)
            {
                Thread.Sleep(1000);
            }
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Check Card Balance";
            Global.Module = "Check Card Balance";
            DumpStatsQ4.Run();
            Global.CurrentMetricDesciption = "Module Total Time";
            DumpStatsQ4.Run();
            Thread.Sleep(2000);
            Keyboard.Press("{Escape}");


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

            if (!Global.AbortScenario)
            {
                // Write out metrics buffer
                WriteOutStatsQ4Buffer.Run();
            }
            else
            {
                Global.Q4StatBuffer = "";
            }

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

            Thread.Sleep(2000);

            // ***********End Scenario 43*****************
        }
コード例 #7
0
        public void Run()
        {       //*****************Start  Scenario 40 - Retech - PRP ******************
            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();
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();

            Global.CurrentScenario = 42;

            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 = @"---> fnDoScenario42 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 40 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();


            // Add PRP
            EnterPRPSKU();

/*
 *                      // Price override
 *          MystopwatchQ4.Reset();
 *                      MystopwatchQ4.Start();
 *
 *                      string TextAmt = repo.Retech.NetTotal.TextValue.Substring(1,repo.Retech.NetTotal.TextValue.Length - 1);
 *                      string TextTotAmt = repo.Retech.TotalPurchases.TextValue.Substring(1,repo.Retech.TotalPurchases.TextValue.Length - 1);
 *                      decimal DecAmt = Convert.ToDecimal(TextAmt);
 *                      decimal DecTotAmt = Convert.ToDecimal(TextTotAmt);
 *                      decimal UseAmt =    DecTotAmt - DecAmt + 1.00m;
 *                      Global.SpecialPayThisAmount = Convert.ToString(UseAmt);
 *
 *                      ProductionIssueFunctions.SpecialPriceOverride(1.00m);  // lower the price so not so many code F4 alerts
 *
 *                      TimeMinusOverhead.Run((float) MystopwatchQ4.ElapsedMilliseconds);  // Subtract overhead and store in Global.Q4StatLine
 *              Global.CurrentMetricDesciption = "Price Overide";
 *              Global.Module = "Price Overide";
 *              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 42";
            Global.Module = "Total Time";
            DumpStatsQ4.Run();

            if (!Global.AbortScenario)
            {
                // Write out metrics buffer
                WriteOutStatsQ4Buffer.Run();
            }
            else
            {
                Global.Q4StatBuffer = "";
            }

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

            Thread.Sleep(2000);

            // ***********End Scenario 42*****************
        }
コード例 #8
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);
        }
コード例 #9
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 18 - Transaction Journal ******************
            Global.CurrentScenario = 18;

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

            Global.ScenarioExecuted = true;

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

            if (Global.CombinedIPOS)
            {
                repo.GoToBackOffice.Click();
                Thread.Sleep(200);
            }

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

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

            Stopwatch MystopwatchQ4 = new Stopwatch();

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

            Stopwatch MystopwatchModuleTotal = new Stopwatch();

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

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

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IPOS270141HomeScreen.Element1' at 269;333.", repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo, new RecordItemIndex(0));
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Clicking on Back Office link";
            WriteToLogFile.Run();
            repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Click();
            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 = "Journal:";
            DumpStatsQ4.Run();

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

            Global.LogText = @"Waiting for F4 Transaction Journal";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            Global.LogText = @"Clicking on F4 Transaction Journal";
            WriteToLogFile.Run();
            repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.PressKeys("{F4}");
            Thread.Sleep(100);
            Global.LogText = @"logging in";
            WriteToLogFile.Run();
            Keyboard.Press("psu");
            Thread.Sleep(100);
            Keyboard.Press("advanced{Return}");

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F4] View Journal and login";
            Global.Module = "Journal:";
            DumpStatsQ4.Run();

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

            Global.LogText = @"Waiting for Transaction Journal screen";
            WriteToLogFile.Run();
            //while(!repo.MailViewer.EmailHeader.Enabled)
            //while(!Host.Local.TryFindSingle(repo.ReservationDeposit.SelectTheTransactionYouWishToRepriInfo.AbsolutePath.ToString(), out element))
            //while(!Host.Local.TryFindSingle(repo.FormPOS.TransactionJournalTitleInfo.AbsolutePath.ToString(), out element))
            //while(!Host.Local.TryFindSingle(repo.ReservationDeposit.ButtonF10JournalTapeInfo.AbsolutePath.ToString(), out element))
            //while(!Host.Local.TryFindSingle(repo.FormPOS.ButtonF10JournalTapeInfo.AbsolutePath.ToString(), out element))

            // NOTE different object XPath for ReTEch 7.0.0.14 and 7.0.102.30
            if (Global.RetechVersion.Substring(0, 5) == "7.0.0")
            {             // 7.0.0.14
                while (!Host.Local.TryFindSingle(repo.JournalPrinterLabelsInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
            }
            else
            {             //7.0.102.30
                while (!Host.Local.TryFindSingle(repo.ButtonF10JournalTapeInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "display Journal listing";
            Global.Module = "Journal:";
            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 = "Journal:";
            DumpStatsQ4.Run();

            Keyboard.Press("{Escape}");

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

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

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

            if (Global.CombinedIPOS)
            {
                repo.BackOffice275111HomeScreen.Self.Focus();
                repo.BackOffice275111HomeScreen.Self.Click();
                Keyboard.Press("{F5}");
                Thread.Sleep(200);
                if (Host.Local.TryFindSingle(repo.ReservationDeposit.WrongBusinessDateInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F5}");
                    Thread.Sleep(200);
                }
            }

            return;

            // ***********End Scenario 18*****************
        }
コード例 #10
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 20 - HR Workday Employee List ******************
            Global.CurrentScenario = 20;

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

            Global.ScenarioExecuted = true;

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

            if (Global.CombinedIPOS)
            {
                repo.GoToBackOffice.Click();
                Thread.Sleep(200);
            }

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

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

            Stopwatch MystopwatchQ4 = new Stopwatch();

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


            Stopwatch MystopwatchModuleTotal = new Stopwatch();

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

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

                Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IPOS270141HomeScreen.Element1' at 269;333.", repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo, new RecordItemIndex(0));
                MystopwatchQ4.Reset();
                MystopwatchQ4.Start();
                Global.LogText = @"Clicking on Back Office link";
                WriteToLogFile.Run();
                repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Click();
                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 = "Employee List:";
                DumpStatsQ4.Run();
            }



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

            Global.LogText = @"Clicking on F7 BackOffice";
            WriteToLogFile.Run();

            if (Global.DomesticRegister)
            {
                repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.PressKeys("{F7}");
            }
            else
            {
                repo.InternationalHomeScreen.Click();
                Delay.Milliseconds(50);
                Keyboard.Press("{F7}");
            }

            Thread.Sleep(100);
            Global.LogText = @"logging in";
            WriteToLogFile.Run();
            Keyboard.Press("psu");
            Thread.Sleep(100);
            Keyboard.Press("advanced{Return}");
            Global.LogText = @"Waiting for BackOffice menu";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.ButtonF8HumanResourcesInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F7] Back Office and login";
            Global.Module = "Employee List:";
            DumpStatsQ4.Run();



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

            Global.LogText = @"Clicking on F8 Human Resources";
            WriteToLogFile.Run();
            while (!repo.ButtonF8HumanResources.Enabled)
            {
                Thread.Sleep(100);
            }
            repo.ButtonF8HumanResources.Click();
            Global.LogText = @"Waiting for HR Functions Menu";
//			while(!repo.BackOffice.ButtonF8HumanResources.Enabled)
//			{ Thread.Sleep(100); }
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.HRSelectDialog.HRFunctionsWorkdayF1Info.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "[F8] Display HR Menu";
            Global.Module = "Employee List:";
            DumpStatsQ4.Run();



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

            Global.LogText = @"Clicking on F1 Workday";
            WriteToLogFile.Run();
            while (!repo.HRSelectDialog.HRFunctionsWorkdayF1.Enabled)
            {
                Thread.Sleep(100);
            }
            repo.HRSelectDialog.HRFunctionsWorkdayF1.Click();
            Global.LogText = @"Waiting for Workday Emplayee List";
            WriteToLogFile.Run();
            while (!Host.Local.TryFindSingle(repo.EmployeeList.LblTitleInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "display eMail listing";
            Global.Module = "Employee List:";
            DumpStatsQ4.Run();



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

            repo.EmployeeList.LblTitle.PressKeys("{Escape}"); // Employee List
            Thread.Sleep(100);

            repo.HRSelectDialog.HRFunctionsMenu.PressKeys("{Escape}"); // HR Functions
            Thread.Sleep(100);

            repo.BackOffice.BackOffice.PressKeys("{Escape}"); // BackOffice Menu
            Thread.Sleep(100);

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "ESC three screens";
            Global.Module = "Employee List:";
            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 = "Employee List:";
            DumpStatsQ4.Run();

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

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

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

            if (Global.CombinedIPOS)
            {
                repo.BackOffice275111HomeScreen.Self.Focus();
                repo.BackOffice275111HomeScreen.Self.Click();
                Keyboard.Press("{F5}");
                Thread.Sleep(200);
                if (Host.Local.TryFindSingle(repo.ReservationDeposit.WrongBusinessDateInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F5}");
                    Thread.Sleep(200);
                }
            }

            return;

            // ***********End Scenario 20*****************
        }
コード例 #11
0
        public void Run()
        {       //**************Start  Scenario 36 - Customer Lookup - Item Lookup - Void transaction**********************
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

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

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

            Global.CurrentScenario = 36;

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

            Global.ScenarioExecuted = true;

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

            Global.DoDumpStats     = true;
            Global.PhoneNumbertype = "";             // all types

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

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

            Mystopwatch.Reset();
            Stopwatch MystopwatchQ4 = new Stopwatch();

            MystopwatchQ4.Reset();
            Stopwatch MystopwatchTT = new Stopwatch();

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

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

            Global.LogText = @"Search for xbox";
            WriteToLogFile.Run();

            int NumberRecordsFound = 0;

            MystopwatchQ4.Reset();
            if (Global.DomesticRegister)
            {
                // Search for XBOX Description
                Thread.Sleep(50);
                repo.Retech.FindAProductCtrlPlusS.Click("19;5");
                Thread.Sleep(50);
                Keyboard.Press("xbox{Return}");
                MystopwatchQ4.Start();
                Global.LogText = @"Wait for search to finish";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.RetechQuickSearchView.DisplayedCountInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }

                string SearchCount = repo.RetechQuickSearchView.DisplayedCount.TextValue;
                NumberRecordsFound = Convert.ToInt32(SearchCount.Substring(0, SearchCount.IndexOf(" ")));
            }
            else                // International
            {
// 08-14-2018           repo.IPOSHomeScreen.InternationalIPOS.PressKeys("{F10}");  // Select Item Lookup
                repo.IPOSScreen.Self.PressKeys("{F10}");
                repo.ReservationDeposit.InternationalLookupDescription.TextValue = "xbox";
                repo.ReservationDeposit.InternationalLookupDescription.PressKeys("{F12}");
                MystopwatchQ4.Start();
                Global.LogText = @"Wait for search to finish";
                WriteToLogFile.Run();
                int LastNumberRecordsFound = 0;
                do
                {                       // wait for count to stop changing
                    LastNumberRecordsFound = repo.InternationalSearchCount.Items.Count;
                    Thread.Sleep(100);
                    NumberRecordsFound = repo.InternationalSearchCount.Items.Count;
                } while (LastNumberRecordsFound != NumberRecordsFound);
            }

            // Q4 stats
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            float RecordsPerSecond = NumberRecordsFound / Global.TempFloat;

            Global.Q4StatLine = RecordsPerSecond.ToString("R");
            Global.CurrentMetricDesciption = @"Records/Second";
            Global.Module = "Item Search";
            DumpStatsQ4.Run();

            Keyboard.Press("{Escape}");

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

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

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

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

            //***********End Scenario 36***************
        }
コード例 #12
0
        public void Run()
        {       //*****************Start  Scenario 37 - Retech - Reserve Pickup ******************
            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();
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();

            Global.CurrentScenario = 37;

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

            Global.ScenarioExecuted = true;

            //string ReservePickupPhoneNumber = "9727651234";
            string ReservePickupPhoneNumber = "406254111" + Global.RegisterNumber;

            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 = @"---> fnDoScenario37 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 37 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Start

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

            //#### Reserve the item
            StartTransaction.Run();
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Start Transaction";
            Global.Module = "Reserve:";
            DumpStatsQ4.Run();

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

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

            repo.Retech.FindAProductCtrlPlusS.Click("19;5"); // click in search box
            Thread.Sleep(100);
            Keyboard.Press("{F2}");                          // Upcoming
            Thread.Sleep(100);



// ########################################################
            // Line item: repo.RetechQuickSearchView.SearchResultsView.ListBoxItem;
            // Price: repo.RetechQuickSearchView.SearchResultsView.NewPrice;
            // PreOrder: repo.RetechQuickSearchView.SearchResultsView.PreOrder;
            // SKU: repo.RetechQuickSearchView.SearchResultsView.NewSku;
            // Number of items in list: repo.RetechQuickSearchView.DisplayedCount;
            //      string SearchCount = repo.RetechQuickSearchView.DisplayedCount.TextValue;
            //		NumberRecordsFound = Convert.ToInt32(SearchCount.Substring(0,SearchCount.IndexOf(" ")));

            //repo.RetechQuickSearchView.FirstPreOrderItem.Click();  // Click on first pre-order item

            bool PreOrderFound = false;

            Global.LogText = @"Searching for PreOrder item in list";
            WriteToLogFile.Run();

            while (!PreOrderFound)
            {
                // Search for and select the first PRE-ORDER item > $10.00
                List             list  = "/form[@automationid='QuickSearchView']/?/?/list[@automationid='SearchResultsView']";
                IList <ListItem> items = list.Items;
                foreach (ListItem EachItem in list.Items)
                {
                    string TextAmt = EachItem.Children[1].Children[0].GetAttributeValue <string>("Caption");    // Price
                    TextAmt = TextAmt.Substring(1, TextAmt.Length - 1);                                         // remove $
                    decimal DecAmt = Convert.ToDecimal(TextAmt);                                                // convert to decimal

                    string TheCaption = EachItem.Children[1].Children[1].GetAttributeValue <string>("Caption"); // Item type looking for PRE-ORDER

                    if (DecAmt > 10.00m && TheCaption == "PRE-ORDER")
                    {
                        EachItem.Click();
                        PreOrderFound = true;
                        break;
                    }
                }

                if (!PreOrderFound)
                {                  // page down on list of items
                    repo.ShellView.SearchResultsView.Click("627;44");
                    Delay.Milliseconds(200);
                    Keyboard.Press("{Next}");
                }
            }

            Thread.Sleep(100);
            Keyboard.Press("{Escape}");              // Escape from search box
            Thread.Sleep(100);

            // Process age verification if exists
            if (Host.Local.TryFindSingle(repo.Retech.AgeVerifiedCommand1Info.AbsolutePath.ToString(), out element))
            {
                repo.Retech.AgeVerifiedCommand1.Click();
                Thread.Sleep(100);
            }



            // Get the Initial Deposit amout from the screen
            Global.SpecialPayThisAmount = repo.Retech.DepositText.TextValue.Substring(1);

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Reserve Item";
            Global.Module = "Reserve:";
            DumpStatsQ4.Run();

            // Select Customer
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            repo.Retech.SelectCustomer.Click();
            Thread.Sleep(100);
            repo.Retech.ButtonContent.Click("105;10");             // Search for Customer
            Thread.Sleep(100);
            // repo.RetechFindCustomerView.CustomerLookupTxt.PressKeys("9727651234{Enter}"); 12-13-18
            repo.RetechFindCustomerView.CustomerLookupTxt.TextValue = ReservePickupPhoneNumber;
            repo.RetechFindCustomerView.Self.PressKeys("{Enter}");

            while (!Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            repo.RetechFindCustomerView.ListBoxItem.Click();             // accept customer
            Thread.Sleep(500);


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

            // Process continue 1
            if (Host.Local.TryFindSingle(repo.Retech.ContinueButtonCommand1Info.AbsolutePath.ToString(), out element))
            {
                repo.Retech.ContinueButtonCommand1.Click();
                Thread.Sleep(200);
            }

            // Process continue 2
            if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
            {
                repo.ContinueButtonCommand.Click();
                Thread.Sleep(200);
            }

            // Process SMS text message - not interested
            if (Host.Local.TryFindSingle(repo.Retech.NotInterestedCommandInfo.AbsolutePath.ToString(), out element))
            {
                repo.Retech.NotInterestedCommand.Click();
                Thread.Sleep(200);
            }



            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Select Customer";
            Global.Module = "Reserve:";
            DumpStatsQ4.Run();

            // Check for Product Replacement Plan
            if (Host.Local.TryFindSingle(repo.Retech.ProductReplacementContinueInfo.AbsolutePath.ToString(), out element))
            {
                repo.Retech.ProductReplacementContinue.Click();
                Thread.Sleep(200);
            }



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

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


            // Checkout and pay required deposit
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            Global.SpecialCheckingOut = false;
            Global.PayWithMethod      = "Cash";
            ProductionIssueFunctions.SpecialPreCheckOut();

            ProductionIssueFunctions.SpecialCheckForCodeF4Alert();

            repo.RetechLoginView.TxtPassword.PressKeys("{Escape}");             // initial sign on screen

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);    // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Pay deposit and checkout";
            Global.Module = "Reserve:";
            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 = "Reserve:";
            DumpStatsQ4.Run();

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



            // #####  Now do the pickup
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            StartTransaction.Run();

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Start Transaction 2";
            Global.Module = "Pick Up:";
            DumpStatsQ4.Run();

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

            // repo.Retech.FindCustomerTextBox.PressKeys("9727651234{Enter}"); // get the customer  12-13-18
            repo.Retech.FindCustomerTextBox.TextValue = ReservePickupPhoneNumber;
            repo.Retech.FindCustomerTextBox.PressKeys("{Enter}");

            while (!Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            repo.RetechFindCustomerView.ListBoxItem.Click();             // accept customer
            while (Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }

            // View customer details to get reserve item
            repo.Retech.ShowCustomerDetails.Click();
            while (!Host.Local.TryFindSingle(repo.CustomerDetailsView.OpenReservationListItemControlInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            // Get the reserved item
            repo.CustomerDetailsView.OpenReservationListItemControl.Click();              // Click on first reserved item
            repo.CustomerDetailsView.PickupReservation.Click();
            Thread.Sleep(100);
            repo.OptionSelectorView.StreetDatedProductConfirm.Click();             // Yes sell this street dated itme
            Thread.Sleep(100);
            Keyboard.Press("{Escape}");
            if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
            {
                repo.ContinueButtonCommand.Click();
                Thread.Sleep(200);
            }

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Get customer and pick up item";
            Global.Module = "Pick Up:";
            DumpStatsQ4.Run();

/*
 *                      // Price override
 *          MystopwatchQ4.Reset();
 *                      MystopwatchQ4.Start();
 *
 *                      ProductionIssueFunctions.SpecialPriceOverride(1.00m);  // lower the price so not so many code F4 alerts
 *
 *                      TimeMinusOverhead.Run((float) MystopwatchQ4.ElapsedMilliseconds);  // Subtract overhead and store in Global.Q4StatLine
 *              Global.CurrentMetricDesciption = "Price Overide";
 *              Global.Module = "Pick Up:";
 *              DumpStatsQ4.Run();
 */
            // Process age verification if exists
            if (Host.Local.TryFindSingle(repo.Retech.AgeVerifiedCommand1Info.AbsolutePath.ToString(), out element))
            {
                repo.Retech.AgeVerifiedCommand1.Click();
                Thread.Sleep(100);
            }
            // Process continue 2
            if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
            {
                repo.ContinueButtonCommand.Click();
                Thread.Sleep(200);
            }

            // Now pickup and pay total for item
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            Global.SpecialCheckingOut   = false;
            Global.PayWithMethod        = "Cash";
            Global.SpecialPayThisAmount = "All";
            repo.Retech.DataContextShowCheckoutViewCommand.Click();
            ProductionIssueFunctions.SpecialPreCheckOut();

            ProductionIssueFunctions.SpecialCheckForCodeF4Alert();

            repo.RetechLoginView.TxtPassword.PressKeys("{Escape}");          // initial sign on screen

            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds); // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Pay for picked up item";
            Global.Module = "Pick Up:";
            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 = "Pick Up:";
            DumpStatsQ4.Run();

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

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

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

            Thread.Sleep(2000);

            // ***********End Scenario 37*****************
        }
コード例 #13
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 17 - Transition Test IPOS <--> Retech ******************
            Global.CurrentScenario = 17;

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

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

            if (Global.CombinedIPOS)
            {
                repo.GoToBackOffice.Click();
                Thread.Sleep(200);
            }

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

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

            Stopwatch MystopwatchQ4 = new Stopwatch();

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

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IPOS270141HomeScreen.Element1' at 269;333.", repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo, new RecordItemIndex(0));
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Clicking on Back Office link";
            WriteToLogFile.Run();
            repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Click();
            Global.LogText = @"Waiting for Back Office home screen";
            WriteToLogFile.Run();
            while (!repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Enabled)
            {
                Thread.Sleep(100);
            }
            Delay.Milliseconds(200);


            if (Global.CombinedIPOS)
            {
                repo.BackOffice275111HomeScreen.Self.Focus();
                repo.BackOffice275111HomeScreen.Self.Click();
                Keyboard.Press("{F5}");
                Thread.Sleep(200);
                if (Host.Local.TryFindSingle(repo.ReservationDeposit.WrongBusinessDateInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F5}");
                    Thread.Sleep(200);
                }
            }

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

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

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



            return;

            // ***********End Scenario 17*****************
        }
コード例 #14
0
        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*****************
        }
コード例 #15
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();
            fnWriteToErrorFile       WriteToErrorFile       = new fnWriteToErrorFile();
            FnCommon14and15          CommonScenario14and15  = new FnCommon14and15();

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

            //*****************Start  Scenario 14 - Shift-F12 Performance Summary ******************
            Global.CurrentScenario = 14;

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

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

            if (Global.CombinedIPOS)
            {
                repo.GoToBackOffice.Click();
                Thread.Sleep(200);
            }

            // 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 = @"---> fnDoScenario14 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 14 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

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

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'IPOS270141HomeScreen.Element1' at 269;333.", repo.BackOffice275111HomeScreen.BackOffice275111HomeScreenInfo, new RecordItemIndex(0));
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Clicking on Back Office link";
            WriteToLogFile.Run();
            repo.BackOffice275111HomeScreen.BackOffice275111HomeScreen.Click();
            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 = "Dashboard:";
            DumpStatsQ4.Run();

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

            repo.BackOffice275111HomeScreen.Self.Click();

            Global.LogText = @"Clicking Shift-F12 Performance Summary";
            WriteToLogFile.Run();
            Keyboard.Press("{LShiftKey down}{F12}{LShiftKey up}");

            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
            Global.LogText = @"Waiting for UserID to be enabled";
            WriteToLogFile.Run();
            while (!repo.ShellRoot.TxtUserId.Enabled)
            {
                Thread.Sleep(100);
            }

            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Load Dashboard login";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();

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

            Global.LogText = @"Log into Back Office";
            WriteToLogFile.Run();
            repo.ShellRoot.TxtUserId.TextValue   = "psu";
            repo.ShellRoot.TxtPassword.TextValue = "advanced";
            Keyboard.Press("{Return}");

            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"Log in";
            Global.Module = "Dashboard:";
            DumpStatsQ4.Run();

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

            CommonScenario14and15.Run();

            // All Done
            Global.LogText = "Press Alt-F4 to exit Dashboard";
            Keyboard.Press("{Alt down}{F4}{Alt up}");


            while (!repo.BackOffice275111HomeScreen.Self.Enabled)
            {
                Thread.Sleep(100);
            }

            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 = "Dashboard:";
            DumpStatsQ4.Run();

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

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


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

            if (Global.CombinedIPOS)
            {
                repo.BackOffice275111HomeScreen.Self.Focus();
                repo.BackOffice275111HomeScreen.Self.Click();
                Keyboard.Press("{F5}");
                Thread.Sleep(200);
                if (Host.Local.TryFindSingle(repo.ReservationDeposit.WrongBusinessDateInfo.AbsolutePath.ToString(), out element))
                {
                    Keyboard.Press("{F5}");
                    Thread.Sleep(200);
                }
            }

            return;

            // ***********End Scenario 14*****************
        }
コード例 #16
0
        public void Run()
        {       //**************Start  Scenario 50 - Prepare for Performacne Dashboard test **********************
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

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

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

            Global.CurrentScenario = 50;

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

            Global.ScenarioExecuted = true;

            // Backoffice
            fnDoScenario13 DoScenario13 = new fnDoScenario13();
            fnDoScenario14 DoScenario14 = new fnDoScenario14();
            fnDoScenario15 DoScenario15 = new fnDoScenario15();
            fnDoScenario16 DoScenario16 = new fnDoScenario16();
            fnDoScenario18 DoScenario18 = new fnDoScenario18();
            fnDoScenario19 DoScenario19 = new fnDoScenario19();
            fnDoScenario20 DoScenario20 = new fnDoScenario20();
            fnDoScenario21 DoScenario21 = new fnDoScenario21();

            // Retech
            fnDoScenario33 DoScenario33 = new fnDoScenario33();
            fnDoScenario34 DoScenario34 = new fnDoScenario34();
            fnDoScenario36 DoScenario36 = new fnDoScenario36();
            fnDoScenario37 DoScenario37 = new fnDoScenario37();
            fnDoScenario47 DoScenario47 = new fnDoScenario47();

            for (Global.CurrentIteration = 1; Global.CurrentIteration <= 5; Global.CurrentIteration++)
            {
                // Back Office
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario13.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario18.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario19.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario20.Run(); EndScenarioCleanup();

                // ReTech
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario16.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario33.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario34.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario36.Run(); EndScenarioCleanup();
                //InitScenarioStart(); Global.IndirectCall = true; DoScenario47.Run(); EndScenarioCleanup();

                // Additional special data
                //Global.CurrentSKUOverideValue = "924089";  // Preowned
                //InitScenarioStart(); Global.IndirectCall = true; Global.CurrentSKUOveride = true; DoScenario33.Run(); EndScenarioCleanup();

                Global.CurrentSKUOverideValue            = "121407";       // Collectible
                InitScenarioStart(); Global.IndirectCall = true; Global.CurrentSKUOveride = true; Global.DoingCollectible = true; DoScenario33.Run(); EndScenarioCleanup();
            }



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

            //***********End Scenario 50 ***************
        }
コード例 #17
0
        public void Run()
        {       //*****************Start  Scenario 38 - Retech - Suspend Resume ******************
            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 = 38;

            // Get current register allowed to run Scenario 38 - Suspend/Resume
            string FileToUse       = "AllowedSuspendResumeRegister.txt";
            string AllowedRegister = "1";

            try
            {
                // Read in the allowed register
                using (System.IO.StreamReader RegisterScenarioFileGet = new System.IO.StreamReader(Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\" + FileToUse))
                {
                    AllowedRegister = RegisterScenarioFileGet.ReadLine();
                    RegisterScenarioFileGet.Close();
                }
            }
            catch
            {
                // Write out new allowed register
                using (System.IO.StreamWriter RegisterScenarioFilePut = new System.IO.StreamWriter(Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\" + FileToUse))
                {
                    RegisterScenarioFilePut.WriteLine(AllowedRegister);
                    RegisterScenarioFilePut.Close();
                }
            }

            bool OkForThisRegisterToRun = true;

            if (AllowedRegister != Global.RegisterNumber)
            {
                OkForThisRegisterToRun = false;
            }

            if (!Global.IndirectCall)
            {
                if (!Global.DoScenarioFlag[Global.CurrentScenario] || !OkForThisRegisterToRun)
                {
                    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();

            Stopwatch MystopwatchSusRes = new Stopwatch();

            Global.LogText = @"---> fnDoScenario38 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 38 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);
                    if (MystopwatchF1.ElapsedMilliseconds > 1000)
                    {
                        Keyboard.Press("{F1}");
                        Thread.Sleep(100);
                        MystopwatchF1.Reset();
                        MystopwatchF1.Start();
                    }
                }

                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();
            }

            Global.CurrentSKU = Global.S4Sku1;
            EnterSKU.Run();
            Thread.Sleep(100);


            // Suspend Transaction ---------------------------------------------------------------
            MystopwatchSusRes.Reset();
            MystopwatchSusRes.Start();

            //repo.Retech.DataContextSuspendOrderCommand.Click(); Thread.Sleep(100);
            Keyboard.Press(System.Windows.Forms.Keys.F11 | System.Windows.Forms.Keys.Control, 87, Keyboard.DefaultKeyPressTime, 1, true);
            repo.UserConfirmationView.ConfirSuspend.Click();  Thread.Sleep(100);
            while (!repo.RetechLoginView.TxtPassword.Enabled)
            {
                Thread.Sleep(100);
            }
            Keyboard.Press("{Escape}");

            TimeMinusOverhead.Run((float)MystopwatchSusRes.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Suspend";
            Global.Module = "Suspend";
            DumpStatsQ4.Run();

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

            Global.LogText = "Pausing after supend " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Thread.Sleep(4000);              // give some time for processkng

            // Resume Transaction -----------------------------------------------------------------------
            MystopwatchSusRes.Reset();
            MystopwatchSusRes.Start();

            Global.AbortScenario = false;
            ResumeTransaction();

            TimeMinusOverhead.Run((float)MystopwatchSusRes.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = "Resume";
            Global.Module = "Resume";
            DumpStatsQ4.Run();

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

            if (!Global.AbortScenario)
            {
                // @#@#@# 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 38";
                Global.Module = "Total Time";
                DumpStatsQ4.Run();

                if (!Global.AbortScenario)
                {
                    // Write out metrics buffer
                    WriteOutStatsQ4Buffer.Run();
                }
                else
                {
                    Global.Q4StatBuffer = "";
                }

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

            // When Suspend/Resume done allow next register to run it
            string StoreName  = Global.RegisterName.Substring(0, 8);
            int    MaxAllowed = 0;

            switch (StoreName)
            {
            case "USA00414":
                MaxAllowed = 3;
                break;

            case "USA04285":
                MaxAllowed = 3;
                break;

            case "USA01763":
                MaxAllowed = 6;
                break;

            case "USA02157":
                MaxAllowed = 2;
                break;
            }


            decimal DecAllowed = Convert.ToDecimal(AllowedRegister);

            if (DecAllowed + 1 > MaxAllowed)
            {
                DecAllowed = 1;
            }
            else
            {
                DecAllowed = DecAllowed + 1;
            }

            AllowedRegister = DecAllowed.ToString();

            // Write out new allowed register
            using (System.IO.StreamWriter RegisterScenarioFilePut = new System.IO.StreamWriter(Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\" + FileToUse))
            {
                RegisterScenarioFilePut.WriteLine(AllowedRegister);
                RegisterScenarioFilePut.Close();
            }

            Thread.Sleep(2000);

            // ***********End Scenario 38*****************
        }
コード例 #18
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*****************
        }
コード例 #19
0
        public void Run()
        {       //*****************Start  Scenario 35 - Retech - Simple One SKU pay with PURCC ******************
            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();
            FnWriteOutStatsQ4Buffer  WriteOutStatsQ4Buffer  = new FnWriteOutStatsQ4Buffer();
            fnUpdatePALStatusMonitor UpdatePALStatusMonitor = new fnUpdatePALStatusMonitor();
            FnCheckout         Checkout         = new FnCheckout();
            fnWriteToErrorFile WriteToErrorFile = new fnWriteToErrorFile();
            FnEnterSKU         EnterSKU         = new FnEnterSKU();

            Global.CurrentScenario = 35;

            if (!Global.DoScenarioFlag[Global.CurrentScenario])
//            if(Global.CurrentScenario != 9999)
            {
                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 = @"---> fnDoScenario35 Iteration: " + Global.CurrentIteration;
            WriteToLogFile.Run();
            Report.Log(ReportLevel.Info, "Scenario 35 IN", "Iteration: " + Global.CurrentIteration, new RecordItemIndex(0));

            // Start

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

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

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

            // Click on start a transaction
            while (!Host.Local.TryFindSingle(repo.Retech.StartATransactionInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
            repo.Retech.StartATransaction.Click();
            if (Host.Local.TryFindSingle(repo.GenericDialogView.CriticalErrorSavingTransactionCallHInfo.AbsolutePath.ToString(), out element))
            {
                repo.GenericDialogView.ErrorSavingButtonOK.Click();
                Thread.Sleep(200);
                Global.TempErrorString = "Error Saving Transaction";
                WriteToErrorFile.Run();
                Global.LogText = Global.TempErrorString;
                WriteToLogFile.Run();
            }
            MystopwatchF1.Reset();
            MystopwatchF1.Start();
            while (!Host.Local.TryFindSingle(repo.RetechLoginView.TxtPasswordInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
                if (MystopwatchF1.ElapsedMilliseconds > 1500)
                {
                    repo.Retech.StartATransaction.Click();
                    MystopwatchF1.Reset();
                    MystopwatchF1.Start();
                }
            }
            Global.TempFloat = (float)MystopwatchQ4.ElapsedMilliseconds / 1000;
            TimeMinusOverhead.Run((float)MystopwatchQ4.ElapsedMilliseconds);               // Subtract overhead and store in Global.Q4StatLine
            Global.CurrentMetricDesciption = @"[F5] Start Transaction";
            Global.Module = "Log On";
            DumpStatsQ4.Run();

            // Enter Password
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();
//            if(repo.RetechLoginView.UserId.TextValue == "")
//            {
//              repo.RetechLoginView.UserId.TextValue = "PSU";
//            }
            repo.RetechLoginView.TxtPassword.PressKeys("advanced{Return}");

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

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

            default:
                while (!repo.AddLineItemCommand.Enabled)
                {
                    if (Host.Local.TryFindSingle(repo.ContinueButtonCommandInfo.AbsolutePath.ToString(), out element))
                    {
                        repo.ContinueButtonCommand.Click();
                    }
                    Thread.Sleep(100);
                }
                break;
            }

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

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

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

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

            // Press F1 add item
            Keyboard.Press("{F1}");
            while (!repo.AddItemText.Enabled)
            {
                Thread.Sleep(100);
            }
            // Enter SKU
            Global.CurrentSKU = Global.S4Sku1;
            EnterSKU.Run();

            // Press F1 add item
            Keyboard.Press("{F1}");
            while (!repo.AddItemText.Enabled)
            {
                Thread.Sleep(100);
            }
            // Enter SKU cost 1 penny
            Global.CurrentSKU = "644917";
            EnterSKU.Run();

            // Return the SKU
            MystopwatchQ4.Reset();
            MystopwatchQ4.Start();

            // Press returns
            repo.Retech.ReturnsF4.Click();
            Thread.Sleep(100);

            // select add item and add the SKU
            repo.AddLineItemCommand.Click();
            //Thread.Sleep(100);
            repo.AddItemText.TextValue = Global.S4Sku1;
            Keyboard.Press("{Enter}");

            // Select Defective for retrun reason
            repo.ReturnReason.Click("246;16");
            repo.Retech.ListItemGameStopOESOrdersItemsRetur.Click("153;6");
            repo.ReturnReason.PressKeys("{LControlKey down}{LMenu down}");
            repo.ReturnReason.PressKeys("{LMenu up}{LControlKey up}");
            repo.Retech.DataContextShowCheckoutViewCommand.Click("93;62");
            repo.Retech.DataContextShowCheckoutViewCommand.Click("95;56");

            //Click on Scan or select receipt and select no receipt
            repo.Retech.SelectReceipt.Click("369;20");
            repo.Retech.NoReceiptAvailableCommand.Click("265;11");
            repo.Retech.SelectReceipt.PressKeys("{LControlKey down}{LMenu down}");
            repo.Retech.SelectReceipt.PressKeys("{LControlKey up}{LMenu up}");

            // Press F5 continue
            Keyboard.Press("{F5}");

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


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

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

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

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

            Thread.Sleep(2000);

            // ***********End Scenario 35*****************
        }