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(); } }
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(); }
public void CheckFileFolderExist(string path) { // press Window E open file explorer Ranorex.Keyboard.Press("{LWin down}e{LWin up}"); Delay.Milliseconds(1000); System.Diagnostics.Debug.WriteLine(path); // split path into item string[] dir = path.Split('\\'); string fileExplorerXpath = null; for (int i = 0; i < dir.Count(); i++) { System.Diagnostics.Debug.WriteLine(dir[i]); if (i == 0) { repo.Explorer.ToolBar1001.Click(); Ranorex.Keyboard.Press(dir[i]); Ranorex.Keyboard.Press("{Return}"); fileExplorerXpath = "/form[@processname='explorer' and @title~'" + "(" + dir[i] + ")']"; } else { // find file explorer Ranorex.Form fileExplorer = null; Ranorex.Core.Element element = Host.Local.FindSingle(fileExplorerXpath, 5000); if (element != null) { fileExplorer = element; } // check if folder exist string folderXpath = "element[@class='ShellTabWindowClass']//element[@instance='1']/container[@caption='ShellView']/list/listitem[@text='" + dir[i] + "']"; try{ ListItem folder = fileExplorer.FindSingle <ListItem>(folderXpath, 5000); folder.DoubleClick(); Delay.Milliseconds(500); } catch (ElementNotFoundException ex) { // report fail Report.Log(ReportLevel.Failure, "Folder not found: " + path); throw ex; } fileExplorerXpath = "/form[@processname='explorer' and @title='" + dir[i] + "']"; } } // report success Report.Log(ReportLevel.Success, "Install the DHS content to: " + path); // close file explorer repo.Explorer.Close.Click(); }
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 CheckDigitalSignature() { string path = @"C:\Program Files\Dell\Dell Help & Support"; string fileName = @"Microsoft.Win32.TaskScheduler.dll"; // press Window E open file explorer Ranorex.Keyboard.Press("{LWin down}e{LWin up}"); Delay.Milliseconds(1000); System.Diagnostics.Debug.WriteLine(path); // split path into item string[] dir = path.Split('\\'); Ranorex.Form fileExplorer = null; string fileExplorerXpath = null; for (int i = 0; i < dir.Count(); i++) { System.Diagnostics.Debug.WriteLine(dir[i]); if (i == 0) { repo.Explorer.ToolBar1001.Click(); Ranorex.Keyboard.Press(dir[i]); Ranorex.Keyboard.Press("{Return}"); fileExplorerXpath = "/form[@processname='explorer' and @title='" + "OS (" + dir[i] + ")']"; } else { // find file explorer fileExplorer = null; Ranorex.Core.Element element = Host.Local.FindSingle(fileExplorerXpath, 5000); if (element != null) { fileExplorer = element; } // check if folder exist string folderXpath = "element[@class='ShellTabWindowClass']//element[@instance='1']/container[@caption='ShellView']/list/listitem[@text='" + dir[i] + "']"; try{ ListItem folder = fileExplorer.FindSingle <ListItem>(folderXpath, 5000); folder.DoubleClick(); Delay.Milliseconds(500); } catch (ElementNotFoundException ex) { // report fail Report.Log(ReportLevel.Failure, "Folder not found: " + path); throw ex; } fileExplorerXpath = "/form[@processname='explorer' and @title='" + dir[i] + "']"; } } // select file Microsoft.Win32.TaskScheduler.dll, open property Ranorex.Keyboard.Press("Microsoft"); // check if folder exist string fileXpath = "element[@class='ShellTabWindowClass']//element[@instance='1']/container[@caption='ShellView']/list/listitem[@text='" + fileName + "']"; ListItem file = fileExplorer.FindSingle <ListItem>(fileXpath, 5000); file.Click(); Delay.Milliseconds(200); // open property Ranorex.Keyboard.Press("{RMenu down}{Return}{RMenu up}"); Delay.Milliseconds(200); repo.MicrosoftWin32TaskSchedulerDllProper.DigitalSignatures.Click(); Delay.Milliseconds(200); Cell nameOfSigner = repo.MicrosoftWin32TaskSchedulerDllProper.Self.FindSingle <Cell>(@"container[@caption='Digital Signatures']//cell[@text='Name of signer:']/following-sibling::cell[][1]"); nameOfSigner.Click(); string expectedNameOfSigner = "Dell Inc"; string actualNameOfSigner = nameOfSigner.Text; Report.Info("Launch SHD install location and check Digital Signaltures:"); Report.Log((actualNameOfSigner == expectedNameOfSigner)?ReportLevel.Success:ReportLevel.Failure, "Check name of Signer actual= " + actualNameOfSigner + ", expected = " + expectedNameOfSigner); repo.MicrosoftWin32TaskSchedulerDllProper.Close.Click(); Delay.Milliseconds(1000); // close file explorer repo.Explorer.Close.Click(); }
public void CloseUpdateCheckDialog(Ranorex.Core.RxPath myPath, Ranorex.Core.Element myElement) { myElement.As <Ranorex.Button>().Click(); }
public void checkFolderExits(string path, string action) { // press Window E open file explorer Ranorex.Keyboard.Press("{LWin down}e{LWin up}"); Delay.Milliseconds(1000); System.Diagnostics.Debug.WriteLine(path); // split path into item string[] dir = path.Split('\\'); string fileExplorerXpath = null; bool found = true; for (int i = 0; i < dir.Length; i++) { System.Diagnostics.Debug.WriteLine(dir[i]); if (i == 0) { repo.Explorer.ToolBar1001.Click(); Ranorex.Keyboard.Press(dir[i]); Ranorex.Keyboard.Press("{Return}"); fileExplorerXpath = "/form[@processname='explorer' and @title='" + "OS (" + dir[i] + ")']"; } else { // find file explorer Ranorex.Form fileExplorer = null; Ranorex.Core.Element element = Host.Local.FindSingle(fileExplorerXpath, 5000); if (element != null) { fileExplorer = element; } // check if folder exist string folderXpath = "element[@class='ShellTabWindowClass']//element[@instance='1']/container[@caption='ShellView']/list/listitem[@text='" + dir[i] + "']"; try{ ListItem folder = fileExplorer.FindSingle <ListItem>(folderXpath, 5000); if (i < dir.Length - 1) { folder.DoubleClick(); Delay.Milliseconds(500); } } catch (ElementNotFoundException) { // report fail // Report.Log(ReportLevel.Failure, "Folder not found: " + path); found = false; break; // throw ex; } fileExplorerXpath = "/form[@processname='explorer' and @title='" + dir[i] + "']"; } } // report if (action.Equals("No")) { Report.Log((found == false)?ReportLevel.Success:ReportLevel.Failure, "Check Folder not Exist: " + path); } else { Report.Log((found == true)?ReportLevel.Success:ReportLevel.Failure, "Check Folder Exist: " + path); } // close file explorer repo.Explorer.Close.Click(); }