internal void EditRequestMethod() { try { ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantMyRequest"); //validate if User is on My requests page Driver.driver.PageSource.Contains("My Requests"); //Get Job Description from Excel sheet and search TxtSearchBar.SendKeys(ExcelLib.ReadData(2, "Job Description")); BtnSearch.Click(); Driver.wait(2); LnqSortBy.Click(); //validate if Job Description is as selected string JobDescription = Driver.driver.FindElement(By.XPath("html/body/div/section/div[1]/div[5]/div[1]/div/div/div/div[2]/div[3]/div/div[2]/span")).Text; JobDescription.Contains(ExcelLib.ReadData(2, "Job Description")); //Edit the Job Description and Submit the form LnqEdit.Click(); TxtDescription.SendKeys(ExcelLib.ReadData(2, "New Description")); BtnSave.Submit(); //Validate the success message //string message = Driver.driver.FindElement(By.XPath("html/body/div/section/div[3]/div[2]/form")).Text; string message = Driver.driver.SwitchTo().Alert().Text; Assert.AreEqual(message, "Item edited successfully"); } catch (Exception Ex) { throw Ex; } }
internal void EditApplication() { try { LnqEdit.Click(); //validate page navigation bool bPage = Driver.driver.PageSource.Contains("Edit Rental Appliaction"); if (bPage) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Navigated to Edit Rental Application Page"); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Page details not verified"); } ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantDetails"); //Verify if the Tenant Count field is enalbled bool bEnableField = TxtNoOfTenant.Enabled; if (bEnableField) { TxtNoOfTenant.SendKeys(ExcelLib.ReadData(2, "NoOfTenants")); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Tenant Count Field not enabled"); } bool bEnableNote = TxtNotes.Enabled; if (bEnableNote) { TxtNotes.SendKeys(ExcelLib.ReadData(2, "Notes")); Driver.wait(2); BtnSave.Submit(); //validate the success message?? } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Notes field not enabled"); } } catch (Exception Ex) { string exceptionMsg = Ex.Message; } }