@Test public void executeProcess() throws FileNotFoundException, IOException, Exception { // Init case pages.gotoDefaultUrl(); pages.Login().loginUser("admin", "admin", "workflow", "English"); pages.Main().goHome(); pages.Main().goAdmin(); pages.Admin().goToLogs(); pages.Admin().showCaseScheduler(); caseStatus = pages.Admin().lastCreateCaseStatus(); String[] toArray = caseStatus.split(" "); int lastCaseNum = Integer.parseInt(toArray[1]); int currentCaseNum = lastCaseNum + 1; // form.sleep(20000); pages.CronExecute().execute("workflow"); Logger.addLog("run cron.php"); // form.sleep(20000); pages.gotoDefaultUrl(); pages.Login().loginUser("admin", "admin", "workflow", "English"); pages.Main().goHome(); pages.Main().goAdmin(); pages.Admin().goToLogs(); pages.Admin().showCaseScheduler(); caseStatus = pages.Admin().lastCreateCaseStatus(); Assert.assertEquals( "Case " + Integer.toString(currentCaseNum) + " Started successfully", caseStatus); // form.sleep(20000); pages.InputDocProcess().switchToDefault(); pages.Main().logout(); }
/** Click toolbar button */ public void clickButton() throws Exception { WebElement cellButton = null; Logger.addLog("click button"); this.browserInstance.turnOffImplicitWaits(); this.toolbarCellOptions = this.toolbarCell.findElements(By.cssSelector(".x-btn")); this.browserInstance.turnOnImplicitWaits(); if (this.toolbarCellOptions.size() > 0) { Logger.addLog("button element found!!!"); // an element was found cellButton = this.toolbarCellOptions.get(0); cellButton.findElement(By.cssSelector("button")).click(); } else { throw new Exception("Button not found!!"); } // x-btn x-btn-text-icon // click the element if is a button }