public void EditAssetname() { //Click on Edit button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(30, "Locator"), ExcelLib.ReadData(30, "Value")); //Change asset name GlobalDefinition.GetClear(GlobalDefinition.driver, ExcelLib.ReadData(23, "Locator"), ExcelLib.ReadData(23, "Value")); GlobalDefinition.Textbox(GlobalDefinition.driver, ExcelLib.ReadData(23, "Locator"), ExcelLib.ReadData(23, "Value"), ExcelLib.ReadData(23, "Input")); //Click on save btn GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(31, "Locator"), ExcelLib.ReadData(31, "Value")); string Editasset = GlobalDefinition.GetTextValue(GlobalDefinition.driver, ExcelLib.ReadData(32, "Locator"), ExcelLib.ReadData(32, "Value")); if (Editasset == ExcelLib.ReadData(23, "Input")) { Base.test.Log(LogStatus.Pass, "Edit Asset successful"); } else { Base.test.Log(LogStatus.Fail, "Edit Asset unsuccessful"); } }
public void EditRoom_blank() { //Click on Edit Button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(15, "Locator"), ExcelLib.ReadData(15, "Value")); //Edit room name GlobalDefinition.GetClear(GlobalDefinition.driver, ExcelLib.ReadData(12, "Locator"), ExcelLib.ReadData(12, "Value")); //Click on update btn GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(13, "Locator"), ExcelLib.ReadData(13, "Value")); //Get text from alert string alert = GlobalDefinition.GetTextValue(GlobalDefinition.driver, ExcelLib.ReadData(16, "Locator"), ExcelLib.ReadData(16, "Value")); Base.test.Log(LogStatus.Pass, "Test Passed with alert message :" + alert); }
public void AddRoom_Invalid() {// Click on Add Room button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(5, "Locator"), ExcelLib.ReadData(5, "Value")); //Enter Room name //GlobalDefinition.Textbox(GlobalDefinition.driver, ExcelLib.ReadData(6, "Locator"), ExcelLib.ReadData(6, "Value"), ExcelLib.ReadData(6, "Input")); for (int i = 2; i<5; i++) { // Enter room name GlobalDefinition.Textbox(GlobalDefinition.driver, ExcelLib.ReadData(6, "Locator"), ExcelLib.ReadData(6, "Value"), ExcelLib.ReadData(i, "InValid_Name")); //Click on Color picker GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(7, "Locator"), ExcelLib.ReadData(7, "Value")); //Select the color IWebElement color = GlobalDefinition.driver.FindElement(By.XPath("//div[@class='k-hsv-gradient']")); color.GetCssValue("#804056"); color.Click(); // Click on apply button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(9, "Locator"), ExcelLib.ReadData(9, "Value")); //Click on save button Global.GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(10, "Locator"), ExcelLib.ReadData(10, "Value")); string alert = GlobalDefinition.GetTextValue(GlobalDefinition.driver, ExcelLib.ReadData(16, "Locator"), ExcelLib.ReadData(16, "Value")); Base.test.Log(LogStatus.Pass,"invalid input "+i+ "gets " + alert); //Close the alert GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(17, "Locator"), ExcelLib.ReadData(17, "Value")); // Clear the textbox GlobalDefinition.GetClear(GlobalDefinition.driver, ExcelLib.ReadData(6, "Locator"), ExcelLib.ReadData(6, "Value")); } }
public void EditRoom_Validdata() { //Click on Edit Button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(11, "Locator"), ExcelLib.ReadData(11, "Value")); //Edit room name GlobalDefinition.GetClear(GlobalDefinition.driver, ExcelLib.ReadData(12, "Locator"), ExcelLib.ReadData(12, "Value")); GlobalDefinition.Textbox(GlobalDefinition.driver, ExcelLib.ReadData(12, "Locator"), ExcelLib.ReadData(12, "Value"), ExcelLib.ReadData(12, "Input")); //Click on update btn GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(13, "Locator"), ExcelLib.ReadData(13, "Value")); // Checking if record created in the table String editValidation = GlobalDefinition.GetTextValue(GlobalDefinition.driver, ExcelLib.ReadData(14, "Locator"), ExcelLib.ReadData(14, "Value")); if (editValidation == ExcelLib.ReadData(12, "Input")) { Base.test.Log(LogStatus.Pass, "Room name edited to: " + ExcelLib.ReadData(12, "Input") + " successfully"); } else { Base.test.Log(LogStatus.Fail, "Edit Room name failed"); } }
public void EditRoom_InvalidData() { //Click on Edit Button GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(15, "Locator"), ExcelLib.ReadData(15, "Value")); for (int i = 2; i < 5; i++) { // Clear text GlobalDefinition.GetClear(GlobalDefinition.driver, ExcelLib.ReadData(12, "Locator"), ExcelLib.ReadData(12, "Value")); //enter data GlobalDefinition.Textbox(GlobalDefinition.driver, ExcelLib.ReadData(12, "Locator"), ExcelLib.ReadData(12, "Value"), ExcelLib.ReadData(i, "InValid_Name")); //Click on update btn GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(13, "Locator"), ExcelLib.ReadData(13, "Value")); //Get text from alert Thread.Sleep(1000); string alert = GlobalDefinition.GetTextValue(GlobalDefinition.driver, ExcelLib.ReadData(16, "Locator"), ExcelLib.ReadData(16, "Value")); Base.test.Log(LogStatus.Pass, "Test Passed with alert message : " + i + alert); //Close Alert GlobalDefinition.ActionButton(GlobalDefinition.driver, ExcelLib.ReadData(17, "Locator"), ExcelLib.ReadData(17, "Value")); } }