Exemplo n.º 1
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            System.Media.SoundPlayer PlaySound = new System.Media.SoundPlayer();

            // To generate the sound files go to  AT&T Labs Natural Voice Text-To-Speech site
            //		URL: http://www2.research.att.com/~ttsweb/tts/demo.php
            // Type in what you want it to say
            // Slect voice Mike US English
            // Press the download button to save an a .wav file and put file in Ranorex Automation directory

            string MyWavFilePath = Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\" + Global.WavFilePath;

            PlaySound.SoundLocation = MyWavFilePath;

            if (Global.DoRegisterSoundAlerts)
            {
                PlaySound.PlaySync();
            }
        }
Exemplo n.º 2
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

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

            // Write out metrics buffer
            // bool OpenFileForOutput = false;
            bool OpenFileForAppend = true;

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(Global.StatsFileNameQ4, OpenFileForAppend))
            {
                file.Write(Global.Q4StatBuffer);
            }

            Global.Q4StatBuffer = "";

            int aa = Global.ScenariosToday;

            Global.ScenariosToday++;                    // PAL Status Monitor
            aa = Global.ScenariosToday;

            Global.LogText = "OUT FnWriteOutStatsQ4Buffer";
            WriteToLogFile.Run();
            Global.LogFileIndentLevel--;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            // Get the register number from the register.ini file then init statfilename
            using (System.IO.StreamReader RegisterIniFile = new System.IO.StreamReader(@"C:\POS\register.ini"))
            {
                bool   LineFound = false;
                string InputLine = "";
                do
                {
                    InputLine = RegisterIniFile.ReadLine();
                    if (InputLine != "")
                    {
                        if (InputLine.Substring(0, 4) == "Num=")
                        {
                            LineFound             = true;
                            Global.RegisterNumber = InputLine.Substring(4, 1);
                        }
                    }
                    ;
                } while (!LineFound);
            }
        }
Exemplo n.º 4
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            // System.DateTime DateTimeNow = System.DateTime.Now;
            // System.TimeSpan TimeNow = DateTimeNow.TimeOfDay;

            // Write out failure to error .csv file	(Global.TempString contains text to be written)
            string TextForLog = Global.RegisterName + "," +
                                System.DateTime.Now.ToString() + "," +
                                Global.CurrentIteration + "," +
                                "Scenario: " + Global.CurrentScenario + "," +
                                "".PadLeft(Global.LogFileIndentLevel, ' ') + "".PadLeft(Global.LogFileIndentLevel, ' ') + Global.LogText;

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(Global.LogFileName, Global.OpenFileForAppend))
            { file.WriteLine(TextForLog); }

            int    a = Global.CurrentIteration;
            int    b = Global.CurrentScenario;
            string t = Global.LogText;

            Report.Log(ReportLevel.Info, "fnWriteToLogFile", "Iteration: " + Global.CurrentIteration + "  " +
                       "Scenario: " + Global.CurrentScenario +
                       " End: " + Global.IterationsText + "\n" +
                       Global.LogText, new RecordItemIndex(0));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            Global.LogFileName = Global.Register1DriveLetter + ":\\" + Global.ReportsFileDirectory + "\\Register" + Global.RegisterNumber + "Log.csv";

            // If stats file does not exist then create it and init with headers
            if (!File.Exists(Global.LogFileName))
            {
                // Init output .csv file
                using (System.IO.StreamWriter file = new System.IO.StreamWriter(Global.LogFileName, Global.OpenFileForOutput))
                {
                    file.WriteLine("Register" + "," +
                                   "Time" + "," +
                                   "Iteration" + "," +

                                   "Scenario" + "," +
                                   "Log Entry");
                }
            }
        }
Exemplo n.º 6
0
        public void Run()
        {       // Wait for xx of yy to be all numeric, whick indicates that search is complete
            // Wait for xx of yy to only show yy then return yy in Global.RecordsFoundString and Global.RecordsFound
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            fnWriteToLogFile WriteToLogFile = new fnWriteToLogFile();

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

            RanorexRepository repo = new RanorexRepository();

            // Wait for xx of yy to be all numeric, whick indicates that search is complete
            while (!Regex.IsMatch(repo.ItemSearch.RawTextXXofYY.RawTextValue, @"^\d+$"))
            {
                Thread.Sleep(100);
            }

            Global.RecordsFoundString = repo.ItemSearch.RawTextXXofYY.RawTextValue;
            Global.RecordsFound       = Convert.ToInt32(repo.ItemSearch.RawTextXXofYY.RawTextValue);

            Global.LogFileIndentLevel--;
            Global.LogText = "OUT fnWaitForItemSearchToFinish";
            WriteToLogFile.Run();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            bool OpenFileForOutput = false;

            // bool OpenFileForAppend = true;

            Global.StatsFileNameQ4 = "C:\\" + Global.StatsFileDirectory + "\\AutomationMetrics.csv";

            // If stats file does not exist then create it and init with headers
            if (!File.Exists(Global.StatsFileNameQ4))
            {
                // Init output .csv file
                using (System.IO.StreamWriter file = new System.IO.StreamWriter(Global.StatsFileNameQ4, OpenFileForOutput))
                {
                    file.WriteLine("Test_ID" + "," +
                                   "Register_ID" + "," +
                                   "AutoVer_ID" + "," +
                                   "Scenario" + "," +
                                   "Module" + "," +
                                   "Metric Description" + "," +
                                   "Iteration" + "," +
                                   "Metric" + "," +
                                   "Metric Time"
                                   );
                }
            }
        }
Exemplo n.º 8
0
        // International CodeF4 Check ##############################################################################
        //
        public void InternationalCheckForCodeF4Alert()
        {
            RanorexRepository repo = new RanorexRepository();

            Ranorex.Unknown element = null;

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

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

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

                Keyboard.Press("psu");

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

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

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

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

                Keyboard.Press("{Escape}");
            }
        }
Exemplo n.º 9
0
        //
        // E N T E R   C U S T O M E R  ##############################################################################
        //
        public void SpecialEnterCustomer()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

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

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

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

            repo.RetechFindCustomerView.ListBoxItem.Click();

            while (Host.Local.TryFindSingle(repo.RetechFindCustomerView.ListBoxItemInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
        }
Exemplo n.º 10
0
        //
        // S T A R T   T R A N S A C T I O N ##############################################################################
        //
        public void SpecialStartTransaction()
        {
            RanorexRepository  repo             = new RanorexRepository();
            fnWriteToLogFile   WriteToLogFile   = new fnWriteToLogFile();
            FnStartTransaction StartTransaction = new FnStartTransaction();

            Global.LogText = @"Start Transaction";
            WriteToLogFile.Run();
            StartTransaction.Run();
        }
Exemplo n.º 11
0
        //
        // F I N A L   C H E C K   O U T ##############################################################################
        //
        public void SpecialFinalCheckOut()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

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

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

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

            default:
                Global.LogText = @"Clicking on Trades F3 Continue F5 button";
                WriteToLogFile.Run();
                repo.Retech.ContinueButtonCommandTrade_5_7_1_2.Click();
                Global.LogText = @"Waiting on CustomerInfoEditProfileIcon";
                WriteToLogFile.Run();
                while (!Host.Local.TryFindSingle(repo.EditProfileCommandInfo.AbsolutePath.ToString(), out element))
                {
                    Thread.Sleep(100);
                }
                break;
            }
        }
Exemplo n.º 12
0
        // ####################################################
        private void InitScenarioStart()
        {
            // Ranorex.Unknown element = null;
            RanorexRepository repo = new RanorexRepository();

            GlobalOverhead.Stopwatch.Reset();

            Global.IndirectCall      = false;                // 12-3-18
            Global.CurrentSKUOveride = false;                // 12-3-18
            Global.DoingCollectible  = false;                // 12-3/18
        }
Exemplo n.º 13
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            Ranorex.Unknown element = null;

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

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

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

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

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

                   )
            {
                Thread.Sleep(2000);
            }

            Report.Log(ReportLevel.Info, "OUT fnClearBrowserCache", "OUT fnClearBrowserCache", new RecordItemIndex(0));
        }
Exemplo n.º 14
0
        //
        // R E T U R N  S K U ##############################################################################
        //
        public void SpecialReturnSKUs()
        {
            RanorexRepository          repo                     = new RanorexRepository();
            fnWriteToLogFile           WriteToLogFile           = new fnWriteToLogFile();
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();

            Global.LogText = @"Starting Return";
            WriteToLogFile.Run();

            Global.SpecialReturningSKUs = true;
            SpecialEnterSKUs();
        }
Exemplo n.º 15
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            //System.DateTime DateTimeNow = System.DateTime.Now;
            //System.TimeSpan TimeNow = DateTimeNow.TimeOfDay;
            Global.ScenarioEndTime = System.DateTime.Now.ToString();
        }
Exemplo n.º 16
0
        //#####################################################################################
        //	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.
        //#####################################################################################
        private void Issue_3432_01()
        {
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();
            fnWriteToLogFile           WriteToLogFile           = new fnWriteToLogFile();

            RanorexRepository repo = new RanorexRepository();

            Global.LogText = " Start Issue_3432_01";
            WriteToLogFile.Run();

            ProductionIssueFunctions.SpecialStartTransaction();

            Global.SpecialCustomerPhoneNumber = "8175551133";
            ProductionIssueFunctions.SpecialEnterCustomer();

            Global.NumberSpecialTrades = 7;
            Global.SpecialTrades[1]    = "112321";
            Global.SpecialTrades[2]    = "954010";
            Global.SpecialTrades[3]    = "109523";
            Global.SpecialTrades[4]    = "954013";
            Global.SpecialTrades[5]    = "109536";
            Global.SpecialTrades[6]    = "103080";
            Global.SpecialTrades[7]    = "107399";
            ProductionIssueFunctions.SpecialEnterTradess();

            Global.NumberSpecialSKUs     = 3;
            Global.SpecialSKUs[1]        = "109386";
            Global.SpecialSKUs[2]        = "101820";
            Global.SpecialInitialDeposit = "9.92";
            Global.SpecialSKUs[3]        = "108274";       // Pre-Order item
            ProductionIssueFunctions.SpecialPurchaseSKUs();

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

            ProductionIssueFunctions.SpecialCheckForCodeF4Alert();

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

            Global.LogText = " End Issue_3432_01";
            WriteToLogFile.Run();

            if (Directory.Exists(Global.MiniDumpDirectory))
            {
                Environment.Exit(0);
            }
        }
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Global.PhoneMaxOffset            = 0;
            Global.TotalNumberOfPhoneNumbers = 0;

            using (System.IO.StreamReader PhoneNumberFile = new System.IO.StreamReader(Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\Input\PhoneNumbers.csv"))
            {
                Global.LogText = "IN fnReadPhoneNumbersFromCSVFile";
                WriteToLogFile.Run();
                Global.LogFileIndentLevel++;

                int    PhoneOffset = 1;
                string InputLine   = "";
                InputLine = PhoneNumberFile.ReadLine();                 // Skip first line it is the header

                for (PhoneOffset = 0; InputLine != null; PhoneOffset++)
                {
                    InputLine = PhoneNumberFile.ReadLine();
                    if (InputLine != null)
                    {                           // Loyalty ("Pro", "Basic") Non-Loyalty ("NonMemberGenesis", "NonMemberProfile") or "" for all
                        string[] Numbers = InputLine.Split(',');

                        Global.PhoneArrayLoyaltyPro[PhoneOffset]                 = Numbers[0];
                        Global.PhoneArrayLoyaltyProCard[PhoneOffset]             = Numbers[1];
                        Global.PhoneArrayLoyaltyBasic[PhoneOffset]               = Numbers[2];
                        Global.PhoneArrayLoyaltyBasicCard[PhoneOffset]           = Numbers[3];
                        Global.PhoneArrayNonLoyaltyNonMemberGenesis[PhoneOffset] = Numbers[4];
                        Global.PhoneArrayNonLoyaltyNonMemberProfile[PhoneOffset] = Numbers[5];

                        Global.PhoneMaxOffset            = PhoneOffset;
                        Global.TotalNumberOfPhoneNumbers = 4 * (Global.PhoneMaxOffset + 1);
                    }
                }
                PhoneNumberFile.Close();
            }


            Global.LogFileIndentLevel--;
            Global.LogText = "OUT fnReadPhoneNumbersFromCSVFile";
            WriteToLogFile.Run();
        }
        /// <summary>
        /// This method gets called right after the recording has been started.
        /// It can be used to execute recording specific initialization code.
        /// </summary>
        ///



        private void Init()
        {
            // Your recording specific initialization code goes here.


            //////////////////////////////////////////////////////////////////////////////////

            // PUT ANY CODE YOU WANT TO TEST HERE IT EXECUTES BEFORE ANY OTHER CODE



            Global.LogFileIndentLevel = 0;

            RanorexRepository repo = new RanorexRepository();



            string strMinute = System.DateTime.Now.Minute.ToString();
            int    intMinute = System.DateTime.Now.Minute;



//						string strCmdText;
//						strCmdText = @"wmic /output:aa.txt path win32_perfformatteddata_perfproc_process get Name, Caption, PercentProcessorTime, IDProcess /format:list";
//						System.Diagnostics.Process.Start("cmd.exe",strCmdText);



//          Bitmap image = Imaging.CaptureDesktopImage(new Rectangle());
//          image.Save("aTest.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);



//Report.Screenshot();

            //Ranorex.Unknown element = null;



//int a = 1;



            //int APlaceToBreakPoint = 1;

            //////////////////////////////////////////////////////////////////////////////////
        }
Exemplo n.º 19
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();

            if (Global.RegisterNumber == "1")
            {
                Global.Register1DriveLetter = "C";                                      //	Store stats on C drive for Register 1
            }
            else
            {
                Global.Register1DriveLetter = "D";                                      //	Store stats on D drive (shared) Register 1
            }
        }
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Global.PhoneMaxOffset           = 0;
            Global.TotalNumberSimpleOneSKUs = 0;

            using (System.IO.StreamReader SimpleOneSKUFile = new System.IO.StreamReader(Global.Register1DriveLetter + @":\" + Global.AutomationFileDirectory + @"\Input\SimpleOneSKUs.csv"))
            {
                Global.LogText = "IN fnReadSimpleOneSKUsFromCSVFile";
                WriteToLogFile.Run();
                Global.LogFileIndentLevel++;

                int    SKUOffset = 1;
                string InputLine = "";
                InputLine = SimpleOneSKUFile.ReadLine();                 // Skip first line it is the header

                for (SKUOffset = 0; InputLine != null; SKUOffset++)
                {
                    InputLine = SimpleOneSKUFile.ReadLine();
                    if (InputLine != null)
                    {
                        string[] Numbers = InputLine.Split(',');

                        Global.SimpleOneSku[SKUOffset]            = Numbers[0];
                        Global.SimpleOneSkuDescription[SKUOffset] = Numbers[1];

                        Global.TotalNumberSimpleOneSKUs = SKUOffset;
                    }
                }
                SimpleOneSKUFile.Close();
            }

            // Initialize first SKU offset
            Global.SimpleOneSKUsOffset = Convert.ToInt32(Global.RegisterNumber) - 1;

            Global.LogFileIndentLevel--;
            Global.LogText = "OUT fnReadSimpleOneSKUsFromCSVFile";
            WriteToLogFile.Run();
        }
Exemplo n.º 21
0
        // ####################################################
        private void EndScenarioCleanup()
        {
            Ranorex.Unknown   element        = null;
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

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

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

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

            if (Global.ScenarioExecuted & !Global.SwitchPauseBetweenScenariosOff)
            {
                Global.LogText = "Pausing in between scenarios";
                WriteToLogFile.Run();
                Thread.Sleep(45000);
            }
        }
Exemplo n.º 22
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.
        //#####################################################################################
        private void Issue_1705_01()
        {
            FnProductionIssueFunctions ProductionIssueFunctions = new FnProductionIssueFunctions();
            fnWriteToLogFile           WriteToLogFile           = new fnWriteToLogFile();

            RanorexRepository repo = new RanorexRepository();

            Global.LogText = " Start Issue_1705_01";
            WriteToLogFile.Run();

            ProductionIssueFunctions.SpecialStartTransaction();

            Global.NumberSpecialSKUs = 1;
            Global.SpecialSKUs[1]    = "930586";
            ProductionIssueFunctions.SpecialPurchaseSKUs();

            Global.SpecialCustomerPhoneNumber = "8175551133";
            ProductionIssueFunctions.SpecialEnterCustomer();

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

            Global.SpecialCheckingOut   = true;
            Global.PayWithMethod        = "Credit";
            Global.SpecialPayThisAmount = "All";
            ProductionIssueFunctions.SpecialPreCheckOut();

            ProductionIssueFunctions.SpecialCheckForCodeF4Alert();

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

            Global.LogText = " End Issue_1705_01";
            WriteToLogFile.Run();

            if (Directory.Exists(Global.MiniDumpDirectory))
            {
                Environment.Exit(0);
            }
        }
Exemplo n.º 23
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = RanorexRepository.Instance;

            fnWriteToLogFile WriteToLogFile = new fnWriteToLogFile();
            Stopwatch        MystopwatchCK  = new Stopwatch();

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

            repo.POSBrowserV25StorePortal.Self.Focus();
//			repo.POSBrowserV25StorePortal.POSBrowserV27RIStorePortal.Click();  // click on browser to make sure in focus
            Keyboard.Press("{F6}");

            repo.POSBrowserV25StorePortal.ExitEscInfo.SearchTimeout = 60000;
            MystopwatchCK.Reset();
            MystopwatchCK.Start();
            while (!repo.StorePortal.QAPOSReCommerce.Enabled)
            {
                Thread.Sleep(100);

                if (MystopwatchCK.ElapsedMilliseconds > 6000)
                {
                    repo.POSBrowserV25StorePortal.POSBrowserV27RIStorePortal.Click();                      // click on browser to make sure in focus
                    Keyboard.Press("{F6}");
                    Thread.Sleep(100);
                    MystopwatchCK.Reset();
                    MystopwatchCK.Start();
                }
            }
            repo.POSBrowserV25StorePortal.ExitEscInfo.SearchTimeout = 30000;

            Global.LogFileIndentLevel--;
            Global.LogText = "OUT fnBrowserGoHome";
            WriteToLogFile.Run();
        }
Exemplo n.º 24
0
        // ####################################################
        private void EndScenarioCleanup()
        {
            Ranorex.Unknown   element = null;
            RanorexRepository repo    = new RanorexRepository();

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

            Global.IndirectCall      = false;                // 12-3-18
            Global.CurrentSKUOveride = false;                // 12-3-18
            Global.DoingCollectible  = false;                // 12-3/18
        }
Exemplo n.º 25
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo = new RanorexRepository();


            // Sample call
            //	fnUpdateItemMDB UpdateItemMDB = new fnUpdateItemMDB();
            //	Global.SQLCommand = "update sku set EnforceStreetDate = false where EnforceStreetDate = true";
            //	UpdateItemMDB.Run();

            string myConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
                                        "Data Source=" + Global.Register1DriveLetter + ":/pos/item.mdb;" +
                                        "Persist Security Info=True;" +
                                        "Jet OLEDB:Database Password=myPassword;";

            try
            {
                // Open OleDb Connection
                OleDbConnection myConnection = new OleDbConnection();
                myConnection.ConnectionString = myConnectionString;
                myConnection.Open();

                // Execute Queries
                OleDbCommand cmd = myConnection.CreateCommand();
                cmd.CommandText = Global.SQLCommand;
                OleDbDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);             // close conn after complete

                // Load the result into a DataTable
                //DataTable myDataTable = new DataTable();
                //myDataTable.Load(reader);
            }
            catch (Exception ex)
            {
                Console.WriteLine("OLEDB Connection FAILED: " + ex.Message);
            }
        }
Exemplo n.º 26
0
        // R E T U R N  S K U ##############################################################################
        //
        public void SpecialCheckForCodeF4Alert()
        {
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            Ranorex.Unknown element = null;

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

            // Press excape key on Another Transaction pop-up
            while (!Host.Local.TryFindSingle(repo.RetechLoginView.TxtPasswordInfo.AbsolutePath.ToString(), out element))
            {
                Thread.Sleep(100);
            }
        }
Exemplo n.º 27
0
        public void Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            RanorexRepository repo        = new RanorexRepository();
            SpeechSynthesizer Speech      = new SpeechSynthesizer();
            fnPlayWavFile     PlayWavFile = new fnPlayWavFile();

            // System.DateTime DateTimeNow = System.DateTime.Now;
            // System.TimeSpan TimeNow = DateTimeNow.TimeOfDay;

            // Play error sound
            Global.WavFilePath = "Error.wav";
            PlayWavFile.Run();

            // Write out failure to error .csv file	(Global.TempString contains text to be written)
            string TextToPrint = Global.RegisterName + "," +
                                 System.DateTime.Now.ToString() + "," +
                                 Global.CurrentIteration + "," +
                                 "Scenario: " + Global.CurrentScenario + "," +
                                 Global.TempErrorString;

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(Global.ErrorFileName, Global.OpenFileForAppend))
            { file.WriteLine(TextToPrint); }

            Global.ErrorsToday++;               // PAL Status Monitor

            if (Global.SwitchQuitRunningOnError)
            {
                if (Global.DoRegisterSoundAlerts)
                {
                    Speech.Speak("An error has occurred, aborting the run");
                }
                Environment.Exit(0);
            }
        }
Exemplo n.º 28
0
        private void GoHome()
        {
            Ranorex.Unknown   element        = null;
            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

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

            RanorexRepository repo           = new RanorexRepository();
            fnWriteToLogFile  WriteToLogFile = new fnWriteToLogFile();

            if (Global.IsPerformanceTest || Global.SwitchMetricOverRide)
            {           // Only write out metrics if doing performance testing
                Global.Q4StatBuffer = Global.Q4StatBuffer + Global.Test_ID + "," +
                                      Global.Register_ID + "," +
                                      Global.AutoVer_ID + "," +
                                      Global.CurrentScenario + "," +
                                      Global.Module + "," +
                                      Global.CurrentMetricDesciption + "," +
                                      Global.CurrentIteration + "," +
                                      Global.Q4StatLine + "," +
                                      System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") +
                                      "\r\n";
            }
        }
Exemplo n.º 30
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*****************
        }