/// <summary> /// This method will fill Progress Check In Questionnaire /// then submit form by clicking 'continue' button /// </summary> private void FillProgressCheckIn() { Console.WriteLine("Switching to iframe ..... "); System.Threading.Thread.Sleep(4000); SeleniumKeywords.NavigateToIFrame("assessmentFrame"); System.Threading.Thread.Sleep(5000); //Fill ProgressCheckIn questionnaire SeleniumKeywords.SetText(pageName, "heightfeettxt", "4"); //Fill height in feet SeleniumKeywords.SetText(pageName, "heightinchestxt", "10"); //Fill height in inches SeleniumKeywords.SetText(pageName, "weightpoundstxt", "380"); //Fill weight in pounds SeleniumKeywords.SetText(pageName, "waistinchestxt", "40"); //Fill waist in inches SeleniumKeywords.Click(pageName, "dietarylotsofimprovementradio"); //Select 'lots of improvement' for dietary SeleniumKeywords.SetText(pageName, "moderatehourstxt", "0"); //Fill moderate hours SeleniumKeywords.SetText(pageName, "moderateminstxt", "0"); //Fill moderate minutes SeleniumKeywords.SetText(pageName, "vigoroushourstxt", "0"); //Fill vigorous hours SeleniumKeywords.SetText(pageName, "vigorousmintxt", "0"); //Fill vigorous minutes SeleniumKeywords.Click(pageName, "currentloseweightradio"); //Select 'lose weight' SeleniumKeywords.Click(pageName, "manageweightyesradio"); //Select 'yes' for manage weight SeleniumKeywords.Click(pageName, "beginrightnowradio"); //Select 'right now' SeleniumKeywords.Click(pageName, "confidentyesradio"); //Select 'yes' SeleniumKeywords.Click(pageName, "dietschallengecheckbx"); //Check 'diets' SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button }
public void GoToProgressCheckin() { SeleniumKeywords.Click(pageName, "lesson1link"); SeleniumKeywords.Click(pageName, "startlesson_btn"); System.Threading.Thread.Sleep(3000); SeleniumKeywords.Click(pageName, "clickherelink"); }
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); }
/// <summary> /// This method is use to click on update Button on tracker page /// </summary> public void ClickUpdateButton() { //SeKeywords.MoveToElement(ElementLocator.GetLocator(pageName, "updatebtn")); Thread.Sleep(4000); SeleniumKeywords.Click(pageName, "updatebtn"); Thread.Sleep(4000); }
/// <summary> /// Verify error messages on Login Preference page /// </summary> /// <param name="errmsgs"></param> public void VerifyErrorMsgs(List <String[]> errmsgs) { ClickSaveAndContinue(); Thread.Sleep(2000); for (int i = 0; i < errmsgs.Count(); i++) { string elementname = errmsgs.ElementAt(i)[2]; string locatorname = errmsgs.ElementAt(i)[3]; string expectedmsg = errmsgs.ElementAt(i)[4]; string actualmsg = SeleniumKeywords.GetText(pageName, locatorname); softAssertion.Add(elementname, expectedmsg, actualmsg, "equals"); } Thread.Sleep(2000); if (GlobalVariables.clientname.ToLower().Equals("nissan")) { //Click Login Preference Back button SeleniumKeywords.Click(pageName, "loginpref_backbtn"); //Click User Agreement Cancel Button ClickUACancelButton(); } else { //Click Login Preference Cancel Button ClickLoginPrefCancel(); } }
public void RemoveAction() { for (int i = 0; i < 3; i++) { SeleniumKeywords.Click(pageName, "removeactionbtn"); } }
private void FillEmotionalHealthModule() { System.Threading.Thread.Sleep(3000); //SeleniumKeywords.NavigateToIFrame("assessmentFrame"); List <string[]> haelements = new List <string[]>(); haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "emotionalhealthmodule"); for (int i = 0; i < haelements.Count; i++) { string elementname = haelements.ElementAt(i)[2]; string elementlocatorname = haelements.ElementAt(i)[3]; string variablevalue = haelements.ElementAt(i)[4]; JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue); SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue); } //SeleniumKeywords.Click(pageName, "emotionalhealth_no_lostallinterest"); //SeleniumKeywords.Click(pageName, "emotionalhealth_no_feltdepressed_feltokaysometimes"); //SeleniumKeywords.Click(pageName, "emotionalhealth_no_feltdepressed_muchofthetime"); //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_unabletocontrolthings"); //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_handlepersonalproblems"); //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_thingsgoingyourway"); //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_difficultiespillingup"); SeleniumKeywords.IframeScrollDown(); SeleniumKeywords.Click(pageName, "saveandcontinuebtn"); }
/// <summary> /// Method verified the new members journey recommendations /// </summary> /// <param name="journeydata"></param> public void VerifyNewMemberJourney(List <string[]> journeydata) { Console.WriteLine("Total Count: " + journeydata.Count()); int no_of_tiles_in_a_page = 6; int index = 0; for (int i = 0; i < journeydata.Count; i = i + 6) { if ((i % no_of_tiles_in_a_page) == 0) { Console.WriteLine("divisible by 6"); for (int j = 0; j < no_of_tiles_in_a_page; j++) { Console.WriteLine("Here index : " + index); string elementname = journeydata.ElementAt(index)[2]; string elementlocatorname = journeydata.ElementAt(index)[3]; bool elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]); string varvalue1 = journeydata.ElementAt(index)[5]; string varvalue2 = journeydata.ElementAt(index)[6]; Console.WriteLine("varvalue1 : " + varvalue1 + ",, varvalue2 : " + varvalue2); bool actualelementpresent; if (elementdisplayedstatus == true) { actualelementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2); } else { actualelementpresent = SeleniumKeywords.IsElementNotPresent(pageName, elementlocatorname, varvalue1, varvalue2); } softAssertions.Add(index + " Element : " + elementname, elementdisplayedstatus, actualelementpresent, "equals"); index++; //System.Threading.Thread.Sleep(3000); } if ((i + no_of_tiles_in_a_page) < (journeydata.Count - 1)) { Console.WriteLine(journeydata.Count.ToString() + "," + (i + no_of_tiles_in_a_page).ToString()); SeleniumKeywords.Click(pageName, "journeyslidernextbtn"); //System.Threading.Thread.Sleep(3000); } } else { Console.WriteLine("Not divisible by 6"); int no_of_rest_tiles = i % no_of_tiles_in_a_page; for (int j = 0; j < no_of_rest_tiles; j++) { Console.WriteLine("There index : " + index); string elementname = journeydata.ElementAt(index)[2]; string elementlocatorname = journeydata.ElementAt(index)[3]; bool elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]); string varvalue1 = journeydata.ElementAt(index)[5]; string varvalue2 = journeydata.ElementAt(index)[6]; bool elementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2); softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals"); index++; } } } }
private void FillProgressCheckIn() { Console.WriteLine("Switching to iframe ..... "); System.Threading.Thread.Sleep(8000); SeleniumKeywords.NavigateToIFrame("assessmentFrame"); System.Threading.Thread.Sleep(12000); SeleniumKeywords.Click(pageName, "fruitconsumeradiobtn"); SeleniumKeywords.Click(pageName, "fruitjuicestatusradiobtn"); SeleniumKeywords.Click(pageName, "vegetablesconsumeradiobtn"); SeleniumKeywords.Click(pageName, "DietVegiecontainsradiobtn"); SeleniumKeywords.Click(pageName, "grainsconsumeradiobtn"); SeleniumKeywords.Click(pageName, "wholegrainsconsumeradiobtn"); SeleniumKeywords.Click(pageName, "dairyprodconsumeradiobtn"); SeleniumKeywords.Click(pageName, "poultryconsumeradiobtn"); SeleniumKeywords.Click(pageName, "unsaturatedfatconsumeradiobtn"); SeleniumKeywords.Click(pageName, "saturatedfatconsumeradiobtn"); SeleniumKeywords.Click(pageName, "sodiumconsumeradiobtn"); SeleniumKeywords.Click(pageName, "sugarconsumeradiobtn"); SeleniumKeywords.Click(pageName, "alcoholconsumeradiobtn"); SeleniumKeywords.Click(pageName, "currentweightsatisfactionstatusradiobtn"); SeleniumKeywords.SetText(pageName, "currentweighttb", "180"); SeleniumKeywords.SetText(pageName, "heightinfeettb", "5"); SeleniumKeywords.SetText(pageName, "heightininchtb", "5"); SeleniumKeywords.SetText(pageName, "modactivityhrstb", "5"); SeleniumKeywords.SetText(pageName, "modactivitymintb", "5"); SeleniumKeywords.SetText(pageName, "vigactivityhrstb", "5"); SeleniumKeywords.SetText(pageName, "vigactivitymintb", "5"); SeleniumKeywords.Click(pageName, "improvinghabitstatusradiobtn"); SeleniumKeywords.Click(pageName, "wellbalancedliferadiobtn"); SeleniumKeywords.Click(pageName, "wellbalancedeatingradiobtn"); SeleniumKeywords.Click(pageName, "challengeeatingcheckbox"); SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button }
private void FillDietModule() { System.Threading.Thread.Sleep(3000); //SeleniumKeywords.NavigateToIFrame("assessmentFrame"); List <string[]> haelements = new List <string[]>(); haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "dietmodule"); for (int i = 0; i < haelements.Count; i++) { string elementname = haelements.ElementAt(i)[2]; string elementlocatorname = haelements.ElementAt(i)[3]; string variablevalue = haelements.ElementAt(i)[4]; JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue); SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue); } //SeleniumKeywords.Click(pageName, "diet_3servings_fruit"); //SeleniumKeywords.Click(pageName, "diet_3servings_vegetables"); //SeleniumKeywords.Click(pageName, "diet_3servings_wholegrains"); //SeleniumKeywords.Click(pageName, "diet_2servings_diaryproducts"); //SeleniumKeywords.Click(pageName, "diet_3servings_fish"); //SeleniumKeywords.Click(pageName, "diet_yes_continueeatinghabits"); SeleniumKeywords.IframeScrollDown(); SeleniumKeywords.Click(pageName, "saveandcontinuebtn"); }
public void trackChallenge(List <string[]> historyheader, List <string[]> historydata) { Common com = new Common(); com.ClickChallengesMenu(); if (GlobalVariables.clientname.ToLower().Equals("meabt")) { SeleniumKeywords.Click(pageName, "submenuchallenges"); } ClickOnInProgressChallenge("The Mindful Bite"); CommonTracker ct = new CommonTracker(); DateTime currentdate = DateTime.Today; string calenderdefaultdate = SeleniumKeywords.GetAttributeValue("Common", "calenderdatepicker", "value"); string currentdt = String.Format("{0:MM/dd/yyyy}", currentdate); softAssertion.Add("Date Picker", currentdt, calenderdefaultdate, "equal"); ClickOnYesBtn(); JavaScriptKeywords.SetTextByControlId("DataPointDate", com.GetDate()[2]); ClickOnUpdateBtn(); ct.ClickViewHistory(); ValidateHistoryHeader(historyheader); // Step 2: Verify History data historydata.ElementAt(0)[4] = Convert.ToDateTime(com.GetDate()[2]).ToString("dddd, MMM dd yyyy"); ValidateHistoryData(historydata); }
/// <summary> /// Method to send Connection Request /// </summary> /// <param name="email"></param> private void SendConnectionRequest(string email) { Thread.Sleep(2000); //JavaScriptKeywords.SetTextInElement(pageName, "connectionstextbox", email); SeleniumKeywords.SetText(pageName, "connectionstextbox", email); SeleniumKeywords.Click(pageName, "searchbtn"); }
private void AddActions() { for (int i = 1; i <= 4; i++) { SeleniumKeywords.Click(pageName, "actionitem"); } }
private void VerifyMoreResourcesTile(string viewbtn_elementlocatorname, string viewbtn_varinputvalue, string category) { SeleniumKeywords.Click(pageName, viewbtn_elementlocatorname, viewbtn_varinputvalue); Console.WriteLine("Switch to second tab"); SeleniumKeywords.SwitchToTab(2); List <string[]> finwellbeingmoreresources = new List <string[]>(); finwellbeingmoreresources = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, category); System.Threading.Thread.Sleep(4000); for (int i = 0; i < finwellbeingmoreresources.Count; i++) { string elementname = finwellbeingmoreresources.ElementAt(i)[2]; string elementlocatorname = finwellbeingmoreresources.ElementAt(i)[3]; string expected_display_status = finwellbeingmoreresources.ElementAt(i)[4]; Boolean actual_display_status = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname); softAssertions.Add("Element : " + elementname, expected_display_status, actual_display_status.ToString(), "equals"); } Console.WriteLine("Close Current Tab"); SeleniumKeywords.CloseCurrentTab(); SeleniumKeywords.SwitchToTab(1); Console.WriteLine("Switch to first tab"); }
/// <summary> /// This method clicks on Course menu item /// </summary> public void ClickCourseMenu() { OpenHamMenu(); Thread.Sleep(2000); SeleniumKeywords.Click(pageName, "menucourselnk"); Thread.Sleep(2000); }
private void FillHistoryModule() { System.Threading.Thread.Sleep(5000); //SeleniumKeywords.NavigateToIFrame("assessmentFrame"); List <string[]> haelements = new List <string[]>(); haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "historymodule"); for (int i = 0; i < haelements.Count; i++) { string elementname = haelements.ElementAt(i)[2]; string elementlocatorname = haelements.ElementAt(i)[3]; string variablevalue = haelements.ElementAt(i)[4]; JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue); SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue); } //SeleniumKeywords.Click(pageName, "history_no_cancer"); //SeleniumKeywords.Click(pageName, "history_no_heartdisease"); //SeleniumKeywords.Click(pageName, "history_no_osteoporosis"); //SeleniumKeywords.Click(pageName, "history_no_migraine"); //SeleniumKeywords.Click(pageName, "history_no_arthritis"); //SeleniumKeywords.Click(pageName, "history_no_asthma"); //SeleniumKeywords.Click(pageName, "history_no_backpain"); SeleniumKeywords.IframeScrollDown(); SeleniumKeywords.Click(pageName, "saveandcontinuebtn"); }
private void ClickActionTiles() { for (int i = 1; i <= 4; i++) { System.Threading.Thread.Sleep(2000); SeleniumKeywords.Click(pageName, "actionitem"); } }
}/// <summary> /// /// refresh the connected device /// </summary> /// <returns></returns> public Boolean VerifyRefreshConnection() { ClickOnDeviceMetaball(); SeleniumKeywords.Click(pageName, "device_Refresh_Connection_lnk"); Boolean result = VerifyDeviceConnected(); return(result); }
}/// <summary> /// Verify the thisr party challenge popup for Nucore client /// </summary> public void VerifyThirdPartypopup() { Boolean result; result = SeleniumKeywords.IsElementPresent(pageName, "thirdpartychallengespopup"); softAssertion.Add("Third Party Challenges popup", true, result, "equals"); SeleniumKeywords.Click(pageName, "thirdpartychallengespopupok"); }
/// <summary> /// This method click on the Footer Dashboard Link /// </summary> public void ClickFooterDashboardLink() { Page_HAPrompt hAPrompt = new Page_HAPrompt(); Thread.Sleep(6000); SeleniumKeywords.Click(pageName, "fdashboardlnk"); hAPrompt.GoToDashboard(); }
/// <summary> /// This method clicks the GoToDashboard Btn present on HA prompt screen /// </summary> public void GoToDashboard() { Thread.Sleep(3000); if (SeleniumKeywords.GetPageTitle().Contains("HA Prompt")) { SeleniumKeywords.Click(pageName, "dashboardbtn"); } }
private void AddActions() { for (int i = 0; i < 5; i++) { System.Threading.Thread.Sleep(3000); SeleniumKeywords.Click("CommonGoals", "actionitem"); } }
private void AddActions() { for (int i = 0; i < 4; i++) { System.Threading.Thread.Sleep(3000); SeleniumKeywords.Click(pageName, "actionitem"); } }
/// <summary> /// Click user agreement Continue button /// </summary> public void ClickUAContinue() { Thread.Sleep(3000); if (SeleniumKeywords.GetPageTitle().Contains("Agreement")) { SeleniumKeywords.Click(pageName, "uacheckbx"); SeleniumKeywords.Click(pageName, "uacontinuebtn"); } }
public void ChangeConnectionCircle(string circle) { // Click connected member option SeleniumKeywords.Click(pageName, "connection_membermenu"); // Select Circle SeleniumKeywords.Click(pageName, "connection_circle", circle); //Thread.Sleep(3000); SeleniumKeywords.Click(pageName, "connection_membermenu"); }
/// <summary> /// Verified recommendations in journey banner /// </summary> /// <param name="journeydata"></param> public void VerifyJourneyBanner(List <string[]> journeydata) { int no_of_tiles_in_a_page = 3; int index = 0; for (int i = 0; i < (journeydata.Count / 2); i = i + 3) { if ((i % no_of_tiles_in_a_page) == 0) { Console.WriteLine("divisible by 3"); for (int j = 0; j < no_of_tiles_in_a_page; j++) { Console.WriteLine("Here index : " + index); string elementname = journeydata.ElementAt(index * 2)[2]; //string elementlocatorname = journeydata.ElementAt(index)[3]; bool elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index * 2)[4]); string varvalue1 = journeydata.ElementAt(index * 2)[5]; Console.WriteLine("varvalue1 : " + varvalue1); bool actualelementpresent; if (elementdisplayedstatus == true) { actualelementpresent = SeleniumKeywords.IsElementPresent(pageName, "bannertile", varvalue1); } else { actualelementpresent = SeleniumKeywords.IsElementNotPresent(pageName, "bannertile", varvalue1); } softAssertions.Add(index + " Element : " + elementname, elementdisplayedstatus, actualelementpresent, "equals"); index++; //System.Threading.Thread.Sleep(3000); } if ((i + 3) < ((journeydata.Count / 2) - 1)) { SeleniumKeywords.Click(pageName, "bannernextbtn"); //System.Threading.Thread.Sleep(3000); } } else { Console.WriteLine("Not divisible by 3"); int no_of_rest_tiles = i % no_of_tiles_in_a_page; for (int j = 0; j < no_of_rest_tiles; j++) { Console.WriteLine("There index : " + index); string elementname = journeydata.ElementAt(index * 2)[2]; string elementlocatorname = journeydata.ElementAt(index * 2)[3]; bool elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index * 2)[4]); string varvalue1 = journeydata.ElementAt(index * 2)[5]; bool elementpresent = SeleniumKeywords.IsElementPresent(pageName, "bannertile", varvalue1); softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals"); index++; } } } }
private void FillFeedbackForm() { SeleniumKeywords.Click(pageName, "contentexcellentrb"); SeleniumKeywords.Click(pageName, "designexcellentrb"); SeleniumKeywords.Click(pageName, "usabilityexcellentrb"); SeleniumKeywords.Click(pageName, "overallexcellentrb"); SeleniumKeywords.SetText(pageName, "commenttxtarea", "Performing Automated Test"); SeleniumKeywords.Click(pageName, "submitbtn"); SeleniumKeywords.Click(pageName, "closebtn"); }
/// <summary> /// call by TC_VerifyCertificate /// </summary> public void verifyCertificatePage() { Thread.Sleep(3000); Boolean result; SeleniumKeywords.Click("Common", "fcertificatelnk"); result = SeleniumKeywords.IsElementPresent(pageName, "certificates_header"); softAssertions.Add("Element : Certificate Page Header", true, result, "equals"); result = SeleniumKeywords.IsElementPresent(pageName, "certificates_header"); softAssertions.Add("Element : Certificate Page Text", true, result, "equals"); }
/// <summary> /// This method will click on Login Button /// It passes the locator and name of the login btn to SeKeyword click Btn /// </summary> private void ClickLogin() { if (GlobalVariables.environment.ToLower() == "sa" || GlobalVariables.environment.ToLower() == "staging" || GlobalVariables.environment.ToLower() == "prod" || GlobalVariables.environment.ToLower() == "production") { SeleniumKeywords.Click(pageName, "loginsubmitbtn"); } else { SeleniumKeywords.Click(pageName, "oldloginbtn"); } }
public void ConfirmCourse() { bool elementpresent = SeleniumKeywords.IsElementPresent(pageName, "course_confirm_popup_text"); softassertions.Add("Element : course_confirm_popup_text", true, elementpresent, "equals"); elementpresent = SeleniumKeywords.IsElementPresent(pageName, "course_confirm_nothankyou_btn"); softassertions.Add("Element : course_confirm_nothankyou_btn", true, elementpresent, "equals"); SeleniumKeywords.Click(pageName, "course_confirm_yesiamsure_btn"); Thread.Sleep(25000); }