public Create(WiniumMethods m, Actions action, ILog debugLog) { this.m = m; this.action = action; this.debugLog = debugLog; //make sure that window is maximized for elements to be visible window = m.Locate(By.Id("frmIntactMain")); if (m.IsElementPresent(By.Name("Maximize"), window)) { m.Click(By.Name("Maximize"), window); } }
/**THIS METHOD HAS TO BE RAN FIRST WITH TESTS, Logs into intact with admin login */ public void Login() //TODO: have to add connectToRemoteDesktop { method = MethodBase.GetCurrentMethod().Name; //both of these will most likely stay false all the time, but we can test either of them by changing value in app.config bool needToSetDB = ConfigurationManager.AppSettings.Get("setDataBase") == "true";; bool connectToRemote = ConfigurationManager.AppSettings.Get("connectToRemote") == "true"; Thread.Sleep(10000); m.SendKeys(By.Name(""), "admin"); if (!needToSetDB) { m.Click(By.Name("&Logon")); } else { SetDatabaseInformation(); m.Click(By.Name("&Logon")); } Thread.Sleep(2000); }
private void AddRecognition() { m.Click(By.Name("Recognize")); window = m.Locate(By.Id("frmMainInteractive")); Thread.Sleep(1500); window = m.Locate(By.Id("btnSelect"), window); m.Click(By.Name("Select All"), window); m.Click(By.Id("btnRecgonize")); Thread.Sleep(5000); m.Click(By.Id("btnClose")); }
/**This is going to a specified amount of definitions with random name for each blank. */ public void CreateNewDefinition(int?numberOfDefinitions = 1, string definitionName = "") { method = MethodBase.GetCurrentMethod().Name; Print(method, "Started"); //check if maximized window = m.Locate(By.Id("frmIntactMain")); if (m.IsElementPresent(By.Name("Maximize"), window)) { m.Click(By.Name("Maximize"), window); } window = m.Locate(By.Name("radMenu1"), window); m.Click(By.Name("&Administration"), window); window = m.Locate(By.Name("&Administration"), window); m.Click(By.Name("Definitions"), window); if (definitionName.Length < 2) { definitionName = "Test"; } for (int i = 0; i <= numberOfDefinitions; i++) { var num = new Random().Next().ToString(); window = m.Locate(By.Id("frmRulesList"), m.Locate(By.Id("frmIntactMain"))); m.Click(By.Id("btnAdd"), window); window = m.Locate(By.Name("Add Definition")); Print(method, "Definition name is " + definitionName + num); foreach (IWebElement element in window.FindElements(By.Name(""))) { if (element.Enabled == true) { try { element.SendKeys(definitionName + " " + num); } catch (Exception) { } } } m.Click(By.Name("&Save"), window); } m.Click(By.Name("&Close")); Print(method, "Finished"); }
public void OpenOrganizer() { method = MethodBase.GetCurrentMethod().Name; Print(method, " Started"); m.Click(By.Name("Organizer")); Print(method, " Finished"); }
/** * This method is going to add documents to batch review and then run through and both add a document to an existing document and attribute a new one. * Does usually run slow */ public void BatchReview() { method = MethodBase.GetCurrentMethod().Name; AddDocsToCollector(); window = m.Locate(By.Id("frmIntactMain")); window = m.Locate(By.Id("radPanelBar1"), window); window = m.Locate(By.Id("pageIntact"), window); window = m.Locate(By.Id("lstIntact"), window); m.Click(By.Name("Batch Review"), window); m.Click(By.Id("6")); Thread.Sleep(1000); m.Click(By.Id("6")); //attribute test from batch review... BatchAttribution(); //add to document test from batch review... AddDocBatchReview(); m.Click(By.Id("btnClose")); }