public Boolean VerifyContentSectionPresent() { bool status = SeleniumKeywords.IsElementPresent(pageName, "contentsection"); SeleniumKeywords.NavigateToPreviousPage(); return(status); }
public void VerifyLoginPageAllDevices(List <String[]> deviceDetails) { for (int i = 0; i < deviceDetails.Count; i++) { //if (i >= 6) //{ // ClickOnNextPage(); //} string devicetitle = deviceDetails.ElementAt(i)[2]; string devicename = deviceDetails.ElementAt(i)[4]; //string url= ClickOnDeviceConnectBtn(devicename); //System.Threading.Thread.Sleep(2000); string result = GetTitleofLoginPage(); Console.WriteLine("**********Page title: " + result); softAssertion.Add("Login Page Title", devicetitle, result, "contains"); string env = ConfigurationManager.AppSettings["environment"]; SeleniumKeywords.NavigateToPreviousPage(); //SeleniumKeywords.NavigateToUrl("https://" + env + "-member.onlifehealth.com/BioDevices/Management"); if (i >= 6 && i < deviceDetails.Count) { ClickOnNextPage(); } } }
public List <string[]> MyHealthPage() { List <string[]> ExpectedText = new List <string[]>(); ExpectedText = Framework.CSVReaderDataTable.GetCSVData("CommonContent", pageName, "headers"); Console.WriteLine("ExpectedText length : " + ExpectedText.Count); List <string[]> result = new List <string[]>(); for (int i = 0; i < ExpectedText.Count; i++) { string elementname = ExpectedText.ElementAt(i)[2]; string locatorname = ExpectedText.ElementAt(i)[3]; string expectedtext = ExpectedText.ElementAt(i)[4]; string actualtext = SeleniumKeywords.GetText(pageName, locatorname); bool textmatch = SeleniumKeywords.VerifyText(actualtext, expectedtext); string msg = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); } List <string[]> tile = new List <string[]>(); tile = Framework.CSVReaderDataTable.GetCSVData("CommonContent", pageName, "tileheader"); for (int i = 0; i < tile.Count; i++) { string elementname = tile.ElementAt(i)[2]; string locatorname = tile.ElementAt(i)[3]; bool status = SeleniumKeywords.IsElementPresent(pageName, locatorname); string msg = "Element : " + elementname + " not displayed"; Console.WriteLine("Element " + msg); result.Add(new string[] { msg, status.ToString() }); } SeleniumKeywords.NavigateToPreviousPage(); return(result); }
public List <string[]> VerifyHeaders() { List <string[]> ExpectedText = new List <string[]>(); ExpectedText = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "headers"); Console.WriteLine("ExpectedText length : " + ExpectedText.Count); List <string[]> result = new List <string[]>(); for (int i = 0; i < ExpectedText.Count; i++) { string elementname = ExpectedText.ElementAt(i)[2]; string locatorname = ExpectedText.ElementAt(i)[3]; string expectedtext = ExpectedText.ElementAt(i)[4]; string actualtext = SeleniumKeywords.GetText(pageName, locatorname); bool textmatch = SeleniumKeywords.VerifyTextContains(actualtext, expectedtext); string msg = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); } SeleniumKeywords.NavigateToPreviousPage(); return(result); }
public void ValidateReportBottomLinks(string clientname, string pageName1) { if (IsCoachingEnable(clientname)) { clientname = "Health Trust"; } else { //clientname = "Onlife Health"; } List <string[]> reportbottomlinks = CSVReaderDataTable.GetCSVData("ProgressCheckinReportData", pageName1, "reportbottomlinks", clientname); for (int i = 0; i < reportbottomlinks.Count; i++) { string reportbottomlinklocatorname = reportbottomlinks.ElementAt(i)[3]; string explinktext = reportbottomlinks.ElementAt(i)[4]; string actuallinktext = SeleniumKeywords.GetText("CommonProgressCheckIn", reportbottomlinklocatorname); softAssertions.Add("Element : " + reportbottomlinklocatorname, explinktext, actuallinktext, "contains"); SeleniumKeywords.Click("CommonProgressCheckIn", reportbottomlinklocatorname); if (explinktext == "RETURN TO DASHBOARD") { Page_HAPrompt pha = new Page_HAPrompt(); pha.GoToDashboard(); } string report_bootomlinks_locatorclass = reportbottomlinks.ElementAt(i)[5]; string navigated_page_element_locatorname = reportbottomlinks.ElementAt(i)[6]; string exp_navigated_page_elementtext = reportbottomlinks.ElementAt(i)[7]; string actual_navigated_page_elementtext = SeleniumKeywords.GetText(report_bootomlinks_locatorclass, navigated_page_element_locatorname); softAssertions.Add("Element : " + navigated_page_element_locatorname, exp_navigated_page_elementtext, actual_navigated_page_elementtext, "equals"); Console.WriteLine("Element: " + navigated_page_element_locatorname + " " + exp_navigated_page_elementtext + " " + actual_navigated_page_elementtext); if (explinktext != "RETURN TO DASHBOARD") { SeleniumKeywords.NavigateToPreviousPage(); } } }
public List <string[]> LearnMorePage() { List <string[]> tiles = new List <string[]>(); tiles = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "learnmore"); Console.WriteLine("ExpectedText length : " + tiles.Count); List <string[]> result = new List <string[]>(); for (int i = 0; i < tiles.Count; i++) { string elementname = tiles.ElementAt(i)[2]; string locatorname = tiles.ElementAt(i)[3]; //string expectedtext = ExpectedText.ElementAt(i)[4]; //string actualtext = SeKeywords.GetText(ElementLocator.GetLocator(pageName, locatorname), elementname); //bool textmatch = SeKeywords.VerifyText(actualtext, expectedtext); //string msg = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext; bool status = SeleniumKeywords.IsElementPresent(pageName, locatorname); string msg = "Element : " + elementname + "not found"; result.Add(new string[] { msg, status.ToString() }); } SeleniumKeywords.NavigateToPreviousPage(); return(result); }