//private int paramPierwszeRuchomePole; public SilverlightTableEditorWindow(WebDocument openWebsite, int?browserId, string idOkna = "", bool ignoreHeader = false, bool detailsPresenter = false, int ktoraTabelka = 0, bool emptyWindow = false, bool znajdzWKontenerze = true) : base(openWebsite, browserId) { _znajdzWKontenerze = znajdzWKontenerze; WaitForLoadInWindow(); if (idOkna != "") { _okno = OpenWebsite.FindSingle <Form>(string.Format(".//form/form[@name='{0}' and @visible='true']", idOkna)); } if (idOkna == "") { _okno = OpenWebsite.FindSingle <Form>(string.Format(".//form/form[@visible='true']")); } if (_znajdzWKontenerze) { _container = _okno.FindSingle <Container>(".//container[@automationid='scrollViewer' and @visible='true']"); } if (!emptyWindow) { InternalTable = PobierzTabelkeDoEdycji(detailsPresenter, ignoreHeader, ktoraTabelka); } paramDetailsPresenter = detailsPresenter; paramIgnoreHeader = ignoreHeader; paramKtoraTabelka = ktoraTabelka; }
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(); }
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 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(); }