private static void Wrapup() { By buttonWrapup = By.XPath("//button[contains(@id, 'btnWrapup') and not(contains(@id, 'info'))]"); if (Driver.wait.IsElementPresent(buttonWrapup)) { StepInfo currentStep = new StepInfo(); currentStep.controlName = "buttonWrapup"; currentStep.action = "Click"; currentStep.flags = "ifPresent"; currentStep.Execute(); currentStep = new StepInfo(); currentStep.controlName = "wrapupSelectDisposition"; currentStep.action = "SelectOptionByText"; currentStep.parameters = "X-Research"; currentStep.Execute(); // Locate and select YesNo Select option Yes currentStep = new StepInfo(); currentStep.controlName = "wrapupSelectYesNo"; currentStep.action = "SelectOptionByText"; currentStep.parameters = "Yes"; currentStep.Execute(); driver.Sleep(2); // Locate and click confirm button currentStep = new StepInfo(); currentStep.controlName = "wrapupConfirmButton"; currentStep.action = "Click"; currentStep.Execute(); } driver.Sleep(2); }
private static void Logout() { Wrapup(); // Locate and click logout button StepInfo currentStep = new StepInfo(); currentStep.controlName = "buttonLogout"; currentStep.action = "Click"; currentStep.Execute(); currentStep = new StepInfo(); currentStep.controlName = "buttonConfirm"; currentStep.action = "Click"; currentStep.Execute(); }
private static void Login() { StepInfo currentStep = null; if (stepInfo.parameters.Split(',').Length < 2) { throw new Exception("Invalid number of parameters supplied for Login keyword - Step: " + stepInfo.id); } string[] parameters = stepInfo.parameters.Split(','); string userName = parameters[0].Trim(); string password = parameters[1].Trim(); currentStep = new StepInfo(); currentStep.controlName = "inputUserName"; currentStep.action = "SendKeys"; currentStep.parameters = userName; currentStep.Execute(); currentStep = new StepInfo(); currentStep.controlName = "inputPassword"; currentStep.action = "SendKeys"; currentStep.parameters = password; currentStep.Execute(); driver.Sleep(1); currentStep = new StepInfo(); currentStep.controlName = "buttonLogin"; currentStep.action = "Click"; currentStep.Execute(); currentStep = new StepInfo(); currentStep.controlName = "loginButtonContinue"; currentStep.action = "Click"; currentStep.flags = "ifPresent"; currentStep.Execute(); }