Пример #1
0
 public static void CloseUpdateCheckDialog(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement)
 {
     //Report.Info("Found popup warningWizard dialog windows1");
     Report.Failure("Found popup WarningWizard dialog windows");
     //myElement.CaptureCompressedImage();
     Report.Screenshot("WarningWizard", myElement, true);
     myElement.As <Ranorex.Button>().Click();
 }
        private static void confirmChangingVersion(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElemen)
        {
            Report.Log(ReportLevel.Info, "Comfirming changing version.");
            Report.Screenshot();

            if (repo.MyAssaysAnalysis.ButtonOKInfo.Exists())
            {
                repo.MyAssaysAnalysis.ButtonOK.Click();
            }
        }
Пример #3
0
        private static void CloseAllWindows(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElemen)
        {
            Report.Log(ReportLevel.Info, "Closing all MyAssays windows.");
            Report.Screenshot();
            Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Text='The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.') on item 'MyAssaysDesktopSetup.SetupUnableText'.", repo.MyAssaysDesktopSetup.SetupUnableTextInfo);
            Validate.Attribute(repo.MyAssaysDesktopSetup.SetupUnableTextInfo, "Text", "The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.");

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'MyAssaysDesktopSetup.ButtonOK'.", repo.MyAssaysDesktopSetup.ButtonOKInfo);
            repo.MyAssaysDesktopSetup.ButtonOK.Press();
        }
Пример #4
0
        private static void CloseAllMyAssaysWindows(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElemen)
        {
            Report.Log(ReportLevel.Info, "Closing all MyAssays windows.");
            Report.Screenshot();

            if (repo.MyAssaysDesktopSetup.RadioButtonCloseTheApplicationsAndAtInfo.Exists())
            {
                Report.Log(ReportLevel.Info, "Found some files that need be deleted but are in use now.");
//		            Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Text='Files in Use') on item 'MyAssaysDesktopSetup.FilesInUseText'.", repo.MyAssaysDesktopSetup.FilesInUseTextInfo);
//		            Validate.Attribute(repo.MyAssaysDesktopSetup.FilesInUseTextInfo, "Text", "Files in Use");
                var button = repo.MyAssaysDesktopSetup.ButtonOK;
                button.EnsureVisible();
                Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'MyAssaysDesktopSetup.ButtonOK' at 23;9.", repo.MyAssaysDesktopSetup.ButtonOKInfo);
                button.Press();
            }
        }
 public void CloseUpdateCheckDialog(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement)
 {
     myElement.As <Ranorex.Button>().Click();
 }
        private void Init(Ranorex.Core.RxPath myPath)
        {
            // Your recording specific initialization code goes here.
            try
            {
                string        imageFolderPath = Environment.CurrentDirectory + @"\Log\Error Image\" + System.DateTime.Today.ToString("yyyyMMdd") + @"\";
                DirectoryInfo di       = new DirectoryInfo(imageFolderPath);
                string        jobPath  = "";
                string        savePath = "";


                if (myPath.ToString().Contains("Vision "))
                {
                    jobPath = @"Vision Error_";
                    JobLoading_Repository.Instance.SPIGUI.VisionErrorPopup.VisionErrorTitle.Click();
                }
                else if (myPath.ToString().Contains("Error Report"))
                {
                    jobPath = @"Crash_";
                    JobLoading_Repository.Instance.CrashUI.ErrorReport.Self.Click();
                }
                else if (myPath.ToString().Contains("KSMARTVisionApp"))
                {
                    jobPath = @"KSMARTVisionApp Crash_";
                    JobLoading_Repository.Instance.KSMARTVisionApplication.KSMARTVisionApplication.Click();
                }
                else if (myPath.ToString().Contains("KSmart connection disconn"))
                {
                    jobPath = @"KSMARTVisionApp Crash_";
                    JobLoading_Repository.Instance.KSmartConnectionDisconnected.TitleBar.Click();
                }


                //string[] imageNames = jobPath.Split('\\');
                //string imageName = imageNames[imageNames.Length - 1];
                //imageName = imageName.Substring(0, imageName.Length - 4) + "_";

                if (di.Exists == false)
                {
                    di.Create();
                }

                Bitmap btMain = new Bitmap(WinForms.Screen.PrimaryScreen.Bounds.Width, WinForms.Screen.PrimaryScreen.Bounds.Height);
                using (Graphics g = Graphics.FromImage(btMain))
                {
                    g.CopyFromScreen(WinForms.Screen.PrimaryScreen.Bounds.X, WinForms.Screen.PrimaryScreen.Bounds.Y, 0, 0, btMain.Size, CopyPixelOperation.SourceCopy);
                    //Picture Box Display
                    savePath = imageFolderPath + jobPath + System.DateTime.Now.ToString("yyyyMMddHHmmss") + "_" + Converting.label1.Text;
                    btMain.Save(savePath + @".png");
                }

                Delay.Seconds(3);
                if (myPath.ToString().Contains("Vision "))
                {
                    JobLoading_Repository.Instance.SPIGUI.VisionErrorPopup.ButtonOK.Click();
                }
                else if (myPath.ToString().Contains("Error Report"))
                {
                    JobLoading_Repository.Instance.CrashUI.ErrorReport.DumpSaveBtn.Click(Location.CenterLeft);
                    JobLoading_Repository.Instance.CrashUI.ErrorReportDetails.Export.Click();
                    JobLoading_Repository.Instance.CrashUI.SaveAs.InputPathText.Click();
                    JobLoading_Repository.Instance.CrashUI.SaveAs.InputPathText.TextValue = "";
                    //Keyboard.Press(imageFolderPath + imageName + System.DateTime.Now.ToString("yyyyMMddHHmmss"));
                    JobLoading_Repository.Instance.CrashUI.SaveAs.InputPathText.TextValue = savePath;
                    JobLoading_Repository.Instance.CrashUI.SaveAs.ButtonSave.Click();
                    JobLoading_Repository.Instance.CrashUI.ErrorReportDetails.Close.Click();
                    JobLoading_Repository.Instance.CrashUI.ErrorReport.Close.Click();
                    if (Ranorex.Validate.Exists(JobLoading_Repository.Instance.CrashUI.ErrorReport.SelfInfo, "Text", false))
                    {
                        Process[] process = Process.GetProcessesByName("CrashSender1403");
                        if (process.GetLength(0) > 0)
                        {
                            process[0].Kill();
                            Delay.Seconds(5);
                        }
                    }
                }
                else if (myPath.ToString().Contains("KSMARTVisionApp"))
                {
                    JobLoading_Repository.Instance.KSMARTVisionApplication.KSMARTVisionApplication.Click();
                    Keyboard.Press(WinForms.Keys.Escape);

                    cm.SPIGUION();
                }
                else if (myPath.ToString().Contains("KSmart connection disconn"))
                {
                    JobLoading_Repository.Instance.KSmartConnectionDisconnected.ReportButton.Click();
                    JobLoading_Repository.Instance.KSmartConnectionDisconnected.OKButton.Click();
                }
            }
            catch (Exception ex)
            {
                Log.LogWrite(ex.ToString());
            }
        }