public static void Clear() { Wheels.Clear(); GoodsId.Clear(); Goods.Clear(); GoodsBundle.Clear(); Store.Clear(); Inventory.Clear(); Sound.Clear(); Sounds.Clear(); Question.Clear(); Degree.Clear(); AdChannelPostfix.Clear(); DailyTarget.Clear(); Language.Clear(); GameConst.Clear(); }
internal void UpdateEducation() { //Get the Education value needs to be updated string expectedInstituteName = ExcelLib.ReadData(2, "InstituteName"); string expectedTitle = ExcelLib.ReadData(2, "Title"); //Get the rows count in Education table IList <IWebElement> Tablerows = Driver.FindElements(By.XPath("//h3[contains(text(),'Education')]/../..//table/tbody/tr")); var rowCount = Tablerows.Count; //Get the actual Education value and compare with Education needs to be updated, if matches update the record for (int i = 1; i <= rowCount; i++) { string actualInstituteName = Driver.FindElement(By.XPath("//h3[contains(text(),'Education')]/../..//table/tbody[" + i + "]/tr/td[2]")).Text; string actualTitle = Driver.FindElement(By.XPath("//h3[contains(text(),'Education')]/../..//table/tbody[" + i + "]/tr/td[3]")).Text; if (expectedInstituteName.ToLower() == actualInstituteName.ToLower() && expectedTitle.ToLower() == actualTitle.ToLower()) { //Click on Edit icon Driver.FindElement(By.XPath("//h3[contains(text(),'Education')]/../..//table/tbody[" + i + "]/tr/td[6]/span[1]/i")).Click(); //Clear the existing values and add new value Extension.WaitForElementDisplayed(Driver, By.Name("instituteName"), 2); CollegeUniversityName.Clear(); CollegeUniversityName.SendKeys(ExcelLib.ReadData(2, "UpdateInstituteName")); SelectDropDown(Country, "SelectByText", ExcelLib.ReadData(2, "UpdateCountry")); SelectDropDown(Title, "SelectByText", ExcelLib.ReadData(2, "UpdateTitle")); Degree.Clear(); Degree.SendKeys(ExcelLib.ReadData(2, "UpdateDegree")); SelectDropDown(YearOfGraduation, "SelectByValue", ExcelLib.ReadData(2, "UpdateYearOfGraduation")); //Click update button UpdateEducationButton.Click(); Base.Image = SaveScreenShotClass.SaveScreenshot(Driver, "Report"); //Validate message Extension.MessageValidation("Education as been updated"); } } }
internal void EditEducation() { Commondriver.Excellib.PopulateInCollection(Base.Excelpath, "Education"); Commondriver.Wait(10); EducationEditiconFirst.Click(); CollegeName.Clear(); CollegeName.SendKeys(Commondriver.Excellib.ReadData(3, "CollegeName")); Commondriver.Wait(10); SelectElement country = new SelectElement(CountryDropdown); country.SelectByText(Commondriver.Excellib.ReadData(3, "CountryOfCollege")); SelectElement Titledrop = new SelectElement(TitleDropdown); Titledrop.SelectByText(Commondriver.Excellib.ReadData(3, "TitleDrop")); Degree.Clear(); Degree.SendKeys(Commondriver.Excellib.ReadData(3, "Degree")); Thread.Sleep(3000); SelectElement Yeardrop = new SelectElement(GradutionYearDropDown); Yeardrop.SelectByText(Commondriver.Excellib.ReadData(3, "Year")); Thread.Sleep(3000); UpdateButtonEducationData.Click(); Thread.Sleep(5000); }
internal void EduEdit() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[@data-tab='third']")); //Click Education tab ClickEdu.Click(); EditEdu.Click(); //Edit University University.Clear(); University.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "University")); //Edit Country GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//select[@name='country'])")); SelectElement Edit = new SelectElement(Country); Edit.SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "Country")); // Country.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Country")); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//select[@name='title'])")); //Edit Title // EditTitle.Click(); Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Title")); //Edit Degree Degree.Clear(); Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Degree")); //Edit year //EditYear.Click(); Year.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "YearOfGraduation")); //Click update UpdateEdu.Click(); }
static void Main(string[] args) { int option = 0; var a = ""; String b; DateTime dob; while (true) { Console.WriteLine("1. Enter Student Info "); Console.WriteLine("2. Enter Teacher Info "); Console.WriteLine("3. Enter Uprogram Info "); Console.WriteLine("4. Enter Degree Info "); Console.WriteLine("5. Enter Course Info \n"); Console.WriteLine("6. Show Student Info "); Console.WriteLine("7. Show Teacher Info "); Console.WriteLine("8. Show Uprogram Info "); Console.WriteLine("9. Show Degree Info "); Console.WriteLine("10. Show Course Info \n"); Console.WriteLine("11. Clear History"); Console.WriteLine("12. Input from file"); Console.WriteLine("0. Exit "); a = Console.ReadLine(); try { option = Int32.Parse(a); } catch (Exception e) { Console.WriteLine("Please give a valid input"); } if (option == 1) { Student student = new Student(); Console.WriteLine("#" + Student.Count + "\n"); Console.WriteLine("Enter First Name: "); a = Console.ReadLine(); student.setFirstName(a); Console.WriteLine("Enter Last Name: "); a = Console.ReadLine(); student.setLastName(a); Console.WriteLine("Enter Date of Birth: "); a = Console.ReadLine(); try { dob = DateTime.Parse(a); } catch (Exception e) { Console.WriteLine(e); } a = Console.ReadLine(); Console.WriteLine("Enter Address Line 01: "); student.setAddress01(a); a = Console.ReadLine(); Console.WriteLine("Enter Address Line 02: "); student.setAddress02(a); a = Console.ReadLine(); Console.WriteLine("Enter City: "); student.setCity(a); a = Console.ReadLine(); Console.WriteLine("Enter State: "); student.setState(a); a = Console.ReadLine(); Console.WriteLine("Enter Zip/Postal: "); student.setZip(a); a = Console.ReadLine(); Console.WriteLine("Enter Coutnry: "); student.setCountry(a); student.setStudentRecord(); } else if (option == 2) { Teacher teacher = new Teacher(); Console.WriteLine("#" + Teacher.Count + "\n"); Console.WriteLine("Enter First Name: "); a = Console.ReadLine(); teacher.setFirstName(a); Console.WriteLine("Enter Last Name: "); a = Console.ReadLine(); teacher.setLastName(a); Console.WriteLine("Enter Date of Birth: "); a = Console.ReadLine(); try { dob = DateTime.Parse(a); } catch (Exception e) { Console.WriteLine(e); } Console.WriteLine("Enter Address Line 01: "); a = Console.ReadLine(); teacher.setAddress01(a); Console.WriteLine("Enter Address Line 02: "); a = Console.ReadLine(); teacher.setAddress02(a); a = Console.ReadLine(); Console.WriteLine("Enter City: "); teacher.setCity(a); Console.WriteLine("Enter State: "); a = Console.ReadLine(); teacher.setState(a); Console.WriteLine("Enter Zip/Postal: "); a = Console.ReadLine(); teacher.setZip(a); Console.WriteLine("Enter Coutnry: "); a = Console.ReadLine(); teacher.setCountry(a); teacher.setTeacherRecord(); } else if (option == 3) { UProgram upr = new UProgram(); Console.WriteLine("#" + UProgram.Count + "\n"); Console.WriteLine("Enter Program Name: "); a = Console.ReadLine(); upr.setProgramName(a); Console.WriteLine("Enter Department Head: "); a = Console.ReadLine(); upr.setDepartmentHead(a); Console.WriteLine("Enter Degrees: "); a = Console.ReadLine(); upr.setDegrees(a); upr.setRecord(); } else if (option == 4) { Degree degree = new Degree(); Console.WriteLine("#" + Degree.Count + "\n"); Console.WriteLine("Enter Degree Name: "); a = Console.ReadLine(); degree.setDegreeName(a); Console.WriteLine("Enter Credits Required: "); a = Console.ReadLine(); degree.setCreditsRequired(a); degree.setRecord(); } else if (option == 5) { Course course = new Course(); Console.WriteLine("#" + Course.Count + "\n"); Console.WriteLine("Enter Course Name: "); a = Console.ReadLine(); course.setCourseName(a); Console.WriteLine("Enter Credits: "); a = Console.ReadLine(); course.setCredits(a); Console.WriteLine("Enter Duration In a Week: "); a = Console.ReadLine(); course.setDuration(a); Console.WriteLine("Enter Teacher: "); a = Console.ReadLine(); course.setTeacher(a); course.setRecord(); } else if (option == 6) { Student student = new Student(); student.showInfo(); } else if (option == 7) { Teacher teacher = new Teacher(); teacher.showInfo(); } else if (option == 8) { UProgram uprogram = new UProgram(); uprogram.showUProgramInfo(); } else if (option == 9) { Degree degree = new Degree(); degree.showDegrees(); } else if (option == 10) { Course course = new Course(); course.showCourseInformation(); } else if (option == 11) { String s = ""; Console.WriteLine("1. Student Info"); Console.WriteLine("2. Teacher Info"); Console.WriteLine("3. UProgram Info"); Console.WriteLine("4. Degree Info"); Console.WriteLine("5. Course Info"); a = Console.ReadLine(); option = Int32.Parse(a); if (option == 1) { Student st = new Student(); st.Clear(); } else if (option == 2) { Teacher tc = new Teacher(); tc.Clear(); } else if (option == 3) { UProgram up = new UProgram(); up.Clear(); } else if (option == 4) { Degree dg = new Degree(); dg.Clear(); } else if (option == 5) { Course cs = new Course(); cs.Clear(); } } else if (option == 12) { Console.WriteLine("1. Student info"); Console.WriteLine("2. Teacher info"); Console.WriteLine("3. UProgram info"); Console.WriteLine("4. Degree info"); Console.WriteLine("5. Course info"); a = Console.ReadLine(); option = Int32.Parse(a); if (option == 1) { Console.WriteLine("Enter file name from where to take input from: "); String s = Console.ReadLine(); Student student = new Student(); student.InputFromFile(s); } else if (option == 2) { Console.WriteLine("Enter file name from where to take input from: "); String s = Console.ReadLine(); Teacher student = new Teacher(); student.InputFromFile(s); } else if (option == 3) { Console.WriteLine("Enter file name from where to take input from: "); String s = Console.ReadLine(); UProgram student = new UProgram(); student.InputFromFile(s); } else if (option == 4) { Console.WriteLine("Enter file name from where to take input from: "); String s = Console.ReadLine(); Degree student = new Degree(); student.InputFromFile(s); } else if (option == 5) { Console.WriteLine("Enter file name from where to take input from: "); String s = Console.ReadLine(); Course student = new Course(); student.InputFromFile(s); } } else { break; } } Console.WriteLine("Press any key to close the program..."); Console.ReadKey(); }