Exemple #1
0
 public void SetEmployeeName(string employeeName)
 {
     SwitchToFrame();
     EmployeeName.Clear();
     EmployeeName.SendKeys(employeeName);
     SwitchToParent();
     driver.SwitchTo().Frame("noncoreIframe");
     Employee.Click();
     SwitchToParent();
 }
 private void NewRecord_Click(object sender, EventArgs e)
 {
     empl_ID.Clear();
     EmployeeName.Clear();
     Address.Clear();
     MobileNo.Clear();
     Email.Clear();
     BloodGroup.ResetText();
     Department.ResetText();
     DateOfJoining.ResetText();
     Salary.Clear();
     BasicWorkingTime.Clear();
     //this.Close();
     //EmployeeRegistration emp_registration = new EmployeeRegistration();
     //emp_registration.Show();
 }
Exemple #3
0
        public string AddUser(UserRole role, string employeeName, string userName, Status status, string password)
        {
            SelectElement select = new SelectElement(Role);

            select.SelectByText(role.ToString());

            EmployeeName.Clear();
            EmployeeName.SendKeys(employeeName);

            UserName.Clear();
            UserName.SendKeys(userName);

            select = new SelectElement(Status);
            select.SelectByText(status.ToString());

            Password.Clear();
            Password.SendKeys(userName);

            ConfirmPassword.Clear();
            ConfirmPassword.SendKeys(userName);

            SaveBtn.Click();

            try
            {
                return(string.Format("Error validating employee name: {0}", EmpNameValidationError.Text));
            }
            catch (NoSuchElementException) { }

            try
            {
                return(string.Format("Error validating user name: {0}", UsrNameValidationError.Text));
            }
            catch (NoSuchElementException) { }

            return("Success");
        }
Exemple #4
0
        public string ViewAttendanceRecord(string employeeName, string date, out List <string> records)
        {
            records = new List <string>();
            EmployeeName.Clear();
            EmployeeName.SendKeys(employeeName);

            Date.Clear();
            Date.SendKeys(date);

            ViewBtn.Click();

            try
            {
                return(ValidationError.Text);
            }
            catch (NoSuchElementException) { }

            IList <IWebElement> tableRows = ResultTable.FindElements(By.TagName("tr"));

            if (tableRows.Count < 2)
            {
                return("No Records Found");
            }

            if (tableRows[1].Text == "No Records Found" | tableRows[1].Text.Contains("No attendance records to display"))
            {
                return("No Records Found");
            }

            for (int i = 1; i < tableRows.Count; i++)
            {
                records.Add(tableRows[i].Text);
            }

            return("Success");
        }
Exemple #5
0
 private void ClearFields()
 {
     EmployeeName.Clear();
     EmployeeID.Clear();
 }