public void edit() { //click the create button Administrator.Click(); //click the employee button Employee.Click(); Thread.Sleep(3000); //click the lastPage button lastPage.Click(); //click the edit button EditButtton.Click(); userName.Click(); userName.Clear(); userName.SendKeys("Testers"); //click the Save button Save.Click(); //click the Back to list button BackToList.Click(); }
public void EditAction() { //click the create button Administrator.Click(); //click the employee button Employee.Click(); Thread.Sleep(3000); //click the lastPage button lastPage.Click(); //click the edit button EditButtton.Click(); //change the new contact information ContactPath.SendKeys("123456"); //click the Save button Save.Click(); //click the Back to list button BackToList.Click(); }
/// <summary> /// Fills in hospital details and click create. /// </summary> public void FillInHospitalDetailsAndClickCreate() { Text.SendKeys(hospital); DisplayOrder.SendKeys(PageHelper.RandomNumber(2)); PageHelper.PickRandomValueFromDropList(Type); ReferenceNo.SendKeys("Ref" + PageHelper.RandomString(5)); CreateHospitalButton.Click(); BackToList.Click(); }
/// <summary> /// Fills in report period details and click create. /// </summary> public void FillInReportPeriodDetailsAndClickCreate() { var dateString = BeginsOn.Text; var endDate = PageHelper.ConvertDateToFormat(dateString, "dd/MM/yyyy"); var eDate = endDate.AddDays(2).ToString("dd/MM/yyyy"); Name.SendKeys(endDate.ToString("dd/MM") + " - " + eDate.Substring(0, 5)); Description.SendKeys(rDescription); Driver.ExecuteJavaScript(@"$('#EndsOn').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#SubmissionDueDate').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#PaymentDate').val('" + eDate + "')"); CalendarYear.Clear(); CalendarYear.SendKeys(endDate.Year.ToString()); FiscalYear.Clear(); FiscalYear.SendKeys(endDate.Year.ToString()); CreateReportingPeriodButton.Click(); BackToList.Click(); }
/// <summary> /// Search and edit the report period. /// </summary> public void SearchAndEditTheReportPeriod() { ReportPeriodSearch.SendKeys(rDescription); EditButton.Click(); var dateString = EditedBeginsOn.GetAttribute("value"); var endDate = PageHelper.ConvertDateToFormat(dateString, "dd/MM/yyyy"); var eDate = endDate.AddDays(2).ToString("dd/MM/yyyy"); Description.Clear(); Description.SendKeys("Edited" + rDescription); Driver.ExecuteJavaScript(@"$('#EndsOn').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#SubmissionDueDate').val('" + eDate + "')"); Driver.ExecuteJavaScript(@"$('#PaymentDate').val('" + eDate + "')"); CalendarYear.SendKeys("2018"); FiscalYear.SendKeys("2018"); SaveReportingPeriodButton.Click(); BackToList.Click(); }
public void Addemployee() { //Administrator Administrator.Click(); //Administrator.WaitForElement(TimeSpan.FromSeconds(10)); //Go to Employee Employee.WaitForElement(TimeSpan.FromSeconds(3)); Employee.Click(); //Crate new Employee Create.Click(); Name.SendKeys("Industry"); userName.SendKeys("Connect23"); Contact.SendKeys("0123456789"); Password.SendKeys("Abcd@1234)"); RetypePassword.SendKeys("Abcd@1234)"); Save.Click(); BackToList.Click(); //lastPage.Click(); //Validation if (CommonDriver.driver.FindElement(By.XPath("//*[@id='container']/p/a")).Text == "Create") { Console.WriteLine("Employee Created Successfully"); } else { Console.WriteLine("Fail to create Employee"); } }
// codes of the delete actions public void AddEmployee() { //click the create button Administrator.Click(); //click the employee button Employee.Click(); //click the Create button Create.Click(); //create the Name String NameT = "testers"; Thread.Sleep(2000); Name.SendKeys("testers"); //create the username userName.SendKeys("testerss"); //create the contact Contact.SendKeys("1234"); //create the password Password.SendKeys("Sa1234567"); //retypepassword RetypePassword.SendKeys("Sa1234567"); //click the Save button Save.Click(); //back to the previous page BackToList.Click(); Thread.Sleep(2000); //validation //if (CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[1]/td[1]")).Text == NameT) //{ // Console.WriteLine("the new user is located in the first page"); //} //else //{ // Thread.Sleep(2000); // lastPage.Click(); // if (CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[2]/td[1]")).Text == NameT) // { // Console.WriteLine("the new user is created succefully"); // } // else // { // Console.WriteLine("the new user is not existing, the test faild"); // } //} //var testpage = CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[1]/td[1]")).Text; //Assert.AreEqual(NameT, testpage); }