public static void AddEmployee(string id, string first, string last, string gender, string email, string phone, string DOB, string joindate, string department, string role) { CustomControls.click("/html[1]/body[1]/div[2]/nav[1]/div[1]/ul[1]/li[5]/a[1]/span[1]", propertytype.XPath); CustomControls.click("/html[1]/body[1]/div[2]/nav[1]/div[1]/ul[1]/li[5]/ul[1]/li[1]/a[1]", propertytype.XPath); Wait.ImplicitWait(10); CustomControls.Entertext("employee_number", id, propertytype.Id); CustomControls.Entertext("employee_first_name", first, propertytype.Id); CustomControls.Entertext("employee_last_name", last, propertytype.Id); if ((String.Equals(gender, "female"))) { CustomControls.click("/html[1]/body[1]/div[2]/div[2]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/fieldset[1]/div[5]/div[1]/div[2]/label[1]", propertytype.XPath); } CustomControls.Entertext("employee_email_id", email, propertytype.Id); CustomControls.Entertext("employee_phone_number", phone, propertytype.Id); CustomControls.Entertext("employee_dob", DOB, propertytype.Id); CustomControls.Entertext("employee_status_date", joindate, propertytype.Id); CustomControls.Selectdropdown("employee_department", department, propertytype.Id); CustomControls.Selectdropdown("employee_job_title", role, propertytype.Id); //submit CustomControls.clickable("/html[1]/body[1]/div[2]/div[2]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/button[2]", propertytype.XPath); Wait.ImplicitWait(10); //ok CustomControls.click("/html/body/div[8]/div[7]/button[2]", propertytype.XPath); Wait.ImplicitWait(10); //Goback to dashboard CustomControls.click("/html/body/div[2]/nav/div/ul/li[3]/a", propertytype.XPath); }