private List <string[]> VerifyFormContent() { System.Threading.Thread.Sleep(4000); 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.VerifyText(actualtext, expectedtext); string msg = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); } List <string[]> options = new List <string[]>(); options = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "labels"); for (int i = 0; i < options.Count; i++) { string elementname = options.ElementAt(i)[2]; string locatorname = options.ElementAt(i)[3]; bool status = SeleniumKeywords.IsElementPresent(pageName, locatorname); string msg = "Element : " + elementname + " not displayed"; result.Add(new string[] { msg, status.ToString() }); } return(result); }
public List <string[]> GetQuestionErrorMessage() { SeleniumKeywords.NavigateToIFrame("assessmentFrame"); System.Threading.Thread.Sleep(6000); Console.WriteLine("GetQuestionErrorMessage function started....."); SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); List <string[]> expectedresult = new List <string[]>(); List <string[]> result = new List <string[]>(); Console.WriteLine("GetQuestionErrorMessage data read function started....."); expectedresult = CSVReaderDataTable.GetCSVData("ProgressCheckinData", pageName, "errormsg"); for (int i = 0; i < expectedresult.Count; i++) { string elementname = expectedresult.ElementAt(i)[2]; string expelementtxt = expectedresult.ElementAt(i)[3]; string actualelementtxt = SeleniumKeywords.GetText(pageName, elementname); bool textmatch = SeleniumKeywords.VerifyText(actualelementtxt, expelementtxt); string msg = "Element : " + elementname + " , Expected : " + expelementtxt + " , Actual : " + actualelementtxt; result.Add(new string[] { msg, textmatch.ToString() }); Console.WriteLine(msg); } return(result); }
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); }
/// <summary> /// Verifies Contact Us Section footer elements /// </summary> public void ContactUsElements(List <string[]> ExpectedText) { for (int i = 0; i < ExpectedText.Count; i++) { string elementname = ExpectedText.ElementAt(i)[3]; string locatorname = ExpectedText.ElementAt(i)[4]; string expectedtext = ExpectedText.ElementAt(i)[5]; string actualtext = SeleniumKeywords.GetText(pageName, locatorname); bool textmatch = SeleniumKeywords.VerifyText(actualtext, expectedtext); softAssertions.Add("Element : " + elementname, expectedtext, actualtext, "equals"); } }
private List <String[]> VerifyElements() { System.Threading.Thread.Sleep(3000); List <string[]> result = new List <string[]>(); labeldata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "controls"); for (int i = 0; i < labeldata.Count; i++) { string elementname = labeldata.ElementAt(i)[2]; string elementlocatorname = labeldata.ElementAt(i)[3]; string expectedtext = labeldata.ElementAt(i)[4]; string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname); bool textmatch = SeleniumKeywords.VerifyText(actualtext, expectedtext); string msg = "Element: " + elementname + "Expected: " + expectedtext + "Actual: " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); } return(result); }
/// <summary> /// This method retun the text of the UI element and verify with the text specified in CommonContent file /// </summary> /// <returns>Return True if text match with text specified in csv file </returns> public List <string[]> VerifyLoginUIText() { uielementdata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "elementuitxt"); Console.WriteLine(uielementdata.Count); List <string[]> result = new List <string[]>(); for (int i = 0; i < uielementdata.Count; i++) { string elementname = uielementdata.ElementAt(i)[2]; string elementlocatorname = uielementdata.ElementAt(i)[3]; string expelementtxt = uielementdata.ElementAt(i)[4]; string actualelementtxt = SeleniumKeywords.GetText(pageName, elementlocatorname); bool textmatch = SeleniumKeywords.VerifyText(actualelementtxt, expelementtxt); string msg = "Element : " + elementname + " , Expected : " + expelementtxt + " , Actual : " + actualelementtxt; result.Add(new string[] { msg, textmatch.ToString() }); Console.WriteLine(msg); } return(result); }
public List <string[]> VerifyTosPage() { List <string[]> ExpectedText = new List <string[]>(); System.Threading.Thread.Sleep(4000); ExpectedText = CSVReaderDataTable.GetCSVData("CommonContent", currentClassName, "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(currentClassName, locatorname); bool textmatch = SeleniumKeywords.VerifyText(actualtext, expectedtext); string msg = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); } SeleniumKeywords.NavigateToPreviousPage(); return(result); }