public void CreateTMnValidate() { //Class for Home page, // method to verify the home // method to click adminstration // method to click time n material HomePage homeInstance = new HomePage(driver); homeInstance.VerifyHomePage(); homeInstance.ClickAdminstration(); homeInstance.ClickTimenMaterial(); TimenMaterialPage tmPage = new TimenMaterialPage(); tmPage.ClickCreateNew(driver); tmPage.EnterValidDataandSave(driver); tmPage.ValidateData(driver); //tmPage.DeleteTMVadition(driver); //static class //StaticClass.StaticMethod(); //comment a line ctrl +k + c //uncomment a line ctrl +k + u }
static void Main(string[] args) { // Browser initiate IWebDriver driver = new ChromeDriver(); //navigate to horse-dev driver.Navigate().GoToUrl("http://horse-dev.azurewebsites.net/Account/Login?ReturnUrl=%2f"); //maximize t driver.Manage().Window.Maximize(); //access loginsucess method // an instance of class LoginPage loginInstance = new LoginPage(); loginInstance.LoginSuccess(driver); //Class for Home page, // method to verify the home // method to click adminstration // method to click time n material HomePage homeInstance = new HomePage(); homeInstance.VerifyHomePage(driver); homeInstance.ClickAdminstration(driver); homeInstance.ClickTimenMaterial(driver); TimenMaterialPage tmPage = new TimenMaterialPage(); tmPage.ClickCreateNew(driver); string code = "ICAug19"; string description = "Selenium Training"; string price = "$155.00"; tmPage.EnterValidDataandSave(driver, code, description, price); tmPage.ValidateData(driver, code, description, price); // to stop console from closing. Console.ReadLine(); //Close the driver driver.Quit(); //static class //StaticClass.StaticMethod(); //comment a line ctrl +k + c //uncomment a line ctrl +k + u }
public void EditnValidate() { HomePage homeInstance = new HomePage(driver); homeInstance.VerifyHomePage(); homeInstance.ClickAdminstration(); homeInstance.ClickTimenMaterial(); TimenMaterialPage tmPage = new TimenMaterialPage(driver); string result = tmPage.EditValidDataandSave("Material", "ICAug19", "Selenium Training", "$155.00", "Time", "ICAug19_edit", "Selenium Training Edit", "$200"); Assert.IsTrue("success" == result, "Edit failed"); Assert.IsTrue("RecordFound" == tmPage.ValidateData("Time", "ICAug19_edit", "Selenium Training Edit", "$200.00"), "Validate failed"); }
public void DeletenValidate() { HomePage homeInstance = new HomePage(driver); homeInstance.ClickAdminstration(); homeInstance.ClickTimenMaterial(); TimenMaterialPage tmPage = new TimenMaterialPage(driver); Assert.IsTrue("success" == tmPage.DeleteData("Material", "ICAug19", "Selenium Training", "$155.00", "ok"), "Delete Failed"); homeInstance.ClickAdminstration(); homeInstance.ClickTimenMaterial(); Assert.IsFalse("RecordFound" == tmPage.ValidateData("Material", "ICAug19", "Selenium Training", "$155.00"), "Validate Failed"); }
public void CreateTMnValidate() { string typecode = "Material"; string code = "ICAug19"; string description = "Selenium Training"; string price = "$155.00"; HomePage homeInstance = new HomePage(driver); homeInstance.VerifyHomePage(); homeInstance.ClickAdminstration(); homeInstance.ClickTimenMaterial(); TimenMaterialPage tmPage = new TimenMaterialPage(driver); tmPage.ClickCreateNew(); tmPage.EnterValidDataandSave(typecode, code, description, price); Assert.IsTrue("RecordFound" == tmPage.ValidateData(typecode, code, description, price), "Created record not found"); }