コード例 #1
0
        public void Verify_CoachingSection()
        {
            string expectedtxt;

            expectedtxt = SeleniumKeywords.GetText(pageName, "coachingsection");
            Console.WriteLine(expectedtxt);
            softAssertion.Add("Coaching Section header", expectedtxt, "COACHING", "equals");
            expectedtxt = SeleniumKeywords.GetText(pageName, "coachingsectionsubheading");
            softAssertion.Add("Coaching Section header", expectedtxt, "Ask your Coach", "equals");
            expectedtxt = SeleniumKeywords.GetText(pageName, "coachingsectiontilesheading");
            softAssertion.Add("Coaching Section header", expectedtxt, "SCROLL THROUGH AVAILABLE GOALS", "equals");
            SeleniumKeywords.IsElementPresent(pageName, "coachingsectiontile");
        }
コード例 #2
0
        private void ValidateChartFilters()
        {
            List <string[]> chartfilterdata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerchartfilters");

            for (int i = 0; i < chartfilterdata.Count; i++)
            {
                string elementname        = chartfilterdata.ElementAt(i)[2];
                string elementlocatorname = chartfilterdata.ElementAt(i)[3];
                string expectedtext       = chartfilterdata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softAssertions.Add("Element : " + elementname, expectedtext, actualtext, "contains");
            }
        }
 private void ValidatePlanScreen()
 {
     System.Threading.Thread.Sleep(10000);
     plan = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "actions");
     for (int i = 0; i < plan.Count; i++)
     {
         string elementname        = plan.ElementAt(i)[2];
         string elementlocatorname = plan.ElementAt(i)[3];
         string expectedtext       = plan.ElementAt(i)[4];
         string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
         softassertions.Add(elementname, expectedtext, actualtext, "contains");
     }
 }
 private void ValidateGoalCompletionScreen()
 {
     Thread.Sleep(3000);
     goalcompletiondata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "completesetup");
     for (int i = 0; i < goalcompletiondata.Count; i++)
     {
         string elementname        = goalcompletiondata.ElementAt(i)[2];
         string elementlocatorname = goalcompletiondata.ElementAt(i)[3];
         string expectedtext       = goalcompletiondata.ElementAt(i)[4];
         string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
         softassertions.Add(elementname, expectedtext, actualtext, "contains");
     }
 }
        private void ValidateReportData()
        {
            List <string[]> reportdata = CSVReaderDataTable.GetCSVData("ProgressCheckinData", pageName, "managestressreportdata");

            for (int i = 0; i < reportdata.Count; i++)
            {
                string elementlocatorname = reportdata.ElementAt(i)[2];
                string expreportdata      = reportdata.ElementAt(i)[3];
                string actualreportdata   = SeleniumKeywords.GetText("CommonProgressCheckIn", elementlocatorname);

                softassertions.Add("Element : " + elementlocatorname, expreportdata, actualreportdata, "contains");
            }
        }
コード例 #6
0
 private void ValidateHistoryData(List <string[]> historydata)
 {
     System.Threading.Thread.Sleep(3000);
     for (int i = 0; i < historydata.Count; i++)
     {
         string elementname        = historydata.ElementAt(i)[2];
         string elementlocatorname = historydata.ElementAt(i)[3];
         string expected           = historydata.ElementAt(i)[4];
         System.Threading.Thread.Sleep(1000);
         string actual = SeleniumKeywords.GetText(pageName, elementlocatorname);
         softAssertion.Add(elementname, expected, actual, "Contains");
     }
 }/// <summary>
コード例 #7
0
        private void CompleteHA()
        {
            string ha_congratulations_text = SeleniumKeywords.GetText(pageName, "ha_congratulations_text");

            //bool textmatch = ha_congratulations_text.Contains("CONGRATULATIONS!");
            //string msg = "Element: HA_Congratulation_Text Expected: CONGRATULATIONS! Actual: " + ha_congratulations_text;
            //result.Add(new string[] { msg, textmatch.ToString() });
            softAssertions.Add("Element : ha_congratulations_text", "CONGRATULATIONS!", ha_congratulations_text, "contains");

            SeleniumKeywords.NavigateToDefaultContent();
            System.Threading.Thread.Sleep(5000);
            SeleniumKeywords.Click(pageName, "hacompletedclosebtn");
        }
コード例 #8
0
        public void Verify_CoursesSection()
        {
            string expectedtxt;

            expectedtxt = SeleniumKeywords.GetText(pageName, "coursessection");
            Console.WriteLine(expectedtxt);
            softAssertion.Add("Courses Section header", expectedtxt, "COURSES", "equals");
            expectedtxt = SeleniumKeywords.GetText(pageName, "coursessectionsubheading");
            softAssertion.Add("Courses Section header", expectedtxt, "Get Started Today", "equals");
            expectedtxt = SeleniumKeywords.GetText(pageName, "coursessectiontilesheading");
            softAssertion.Add("Courses Section header", expectedtxt, "SCROLL THROUGH AVAILABLE COURSES", "equals");
            SeleniumKeywords.IsElementPresent(pageName, "coursessectiontile");
        }
コード例 #9
0
        private void ValidatePlanScreen()
        {
            List <string[]> result = new List <string[]>();

            actiondata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "actions");
            for (int i = 0; i < actiondata.Count; i++)
            {
                string elementname        = actiondata.ElementAt(i)[2];
                string elementlocatorname = actiondata.ElementAt(i)[3];
                string expectedtext       = actiondata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add(elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #10
0
 private void ValidateIncentiveHistoryUiData()
 {
     List<string[]> historyuidata = new List<string[]>();
     historyuidata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "incentivehistoryuidata");
     for (int i = 0; i < historyuidata.Count; i++)
     {
         string elementname = historyuidata.ElementAt(i)[2];
         string elementlocatorname = historyuidata.ElementAt(i)[3];
         string expectedtext = historyuidata.ElementAt(i)[4];
         string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname);
         
         softAssertions.Add("Element : " + elementlocatorname, expectedtext, actualtext, "contains");
     }
 }
        private void ValidateActionsAdded()
        {
            System.Threading.Thread.Sleep(2000);
            List <string[]> result = new List <string[]>();

            actions = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "actionitems");
            for (int i = 0; i < actions.Count; i++)
            {
                string elementname        = actions.ElementAt(i)[2];
                string elementlocatorname = actions.ElementAt(i)[3];
                string expectedtext       = actions.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add(elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #12
0
        private void ValidateGoalCompletionScreen()
        {
            System.Threading.Thread.Sleep(4000);
            List <string[]> result = new List <string[]>();

            remove = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "plan");
            for (int i = 0; i < remove.Count; i++)
            {
                string elementname        = remove.ElementAt(i)[2];
                string elementlocatorname = remove.ElementAt(i)[3];
                string expectedtext       = remove.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add(elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #13
0
        public void VerifyRemovePopUp()
        {
            List <string[]> removedata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "removepopup");

            Thread.Sleep(2000);
            for (int i = 0; i < removedata.Count; i++)
            {
                string elementname        = removedata.ElementAt(i)[2];
                string elementlocatorname = removedata.ElementAt(i)[3];
                string expectedtext       = removedata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);

                softassertions.Add("Element : " + elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #14
0
        private void TakeCourse()
        {
            List <string[]> coursedata = CSVReaderDataTable.GetCSVData("CourseContent", pageName, "coursedata");

            for (int i = 0; i < coursedata.Count; i++)
            {
                string elementname        = coursedata.ElementAt(i)[2];
                string elementlocatorname = coursedata.ElementAt(i)[3];
                string exptext            = coursedata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add("Element : " + elementlocatorname, exptext, actualtext, "equals");
            }

            StartLessonReading();
            cc.ConfirmCourse();
        }
コード例 #15
0
        public void VerifySetUpCancelScreen()
        {
            //ClickCancelBtn();
            Thread.Sleep(2000);
            List <string[]> canceldata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "goalsetupcancel");

            for (int i = 0; i < canceldata.Count; i++)
            {
                string elementname        = canceldata.ElementAt(i)[2];
                string elementlocatorname = canceldata.ElementAt(i)[3];
                string expectedtext       = canceldata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);

                softassertions.Add("Element : " + elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #16
0
        private void ValidateSpanishConversion()
        {
            updatedata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "spdata");
            List <string[]> result = new List <string[]>();

            System.Threading.Thread.Sleep(5000);
            for (int i = 0; i < updatedata.Count; i++)
            {
                string elementname  = updatedata.ElementAt(i)[2];
                string expectedtext = updatedata.ElementAt(i)[4];
                string locatorname  = updatedata.ElementAt(i)[3];
                Console.WriteLine(updatedata.Count);
                string updatetext = SeleniumKeywords.GetText(pageName, locatorname);
                softAssertions.Add("Element : " + elementname, expectedtext, updatetext, "contains");
            }
        }
コード例 #17
0
        /// <summary>
        /// Method verfies pending request displayed after request sent
        /// </summary>
        /// <param name="emailid"></param>
        private void VerifyPendingRequest(string emailid)
        {
            //Thread.Sleep(5000);
            string eid = SeleniumKeywords.GetText(pageName, "pendinguserid");

            softAssertion.Add("Element: pendinguserid", emailid, eid, "contains");
            pendingdata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "pendingdata");
            for (int i = 0; i < remove.Count; i++)
            {
                string elementname        = remove.ElementAt(i)[2];
                string elementlocatorname = remove.ElementAt(i)[3];
                string expectedtext       = remove.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softAssertion.Add("Element: " + elementlocatorname, expectedtext, actualtext, "contains");
            }
        }
コード例 #18
0
        private void StartLessonReading()
        {
            for (int i = 1; i <= 12; i++)
            {
                Console.WriteLine("Value of i : " + i);
                List <string[]> courselessondata = CSVReaderDataTable.GetCSVData("CourseContent", pageName, "courselesson" + i + "data");
                Console.WriteLine(courselessondata.Count);
                for (int j = 0; j < courselessondata.Count; j++)
                {
                    Console.WriteLine("Value of j : " + j);
                    string elementname        = courselessondata.ElementAt(j)[2];
                    string elementlocatorname = courselessondata.ElementAt(j)[3];
                    string exptext            = courselessondata.ElementAt(j)[4];
                    if (!(exptext.Trim().Equals("no_element")))
                    {
                        string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname);
                        softassertions.Add("Element : " + elementlocatorname, exptext, actualtext, "equals");
                    }

                    if (j == 1)
                    {
                        Console.WriteLine("Clicking lesson1link ..... ");
                        SeleniumKeywords.Click(pageName, "lesson" + i + "link");
                    }
                    else if (j == 2)
                    {
                        Console.WriteLine("Clicking Startlessonlink ..... ");
                        cc.ClickStartLessonButton();
                        //SeleniumKeywords.Click(pageName, "weightcourse_startlesson_btn");
                    }
                    if (j >= 3 && j < courselessondata.Count - 1)
                    {
                        Console.WriteLine("Clicking Nextlessonlink ..... ");
                        System.Threading.Thread.Sleep(2000);
                        cc.ClickNextButton();
                        //SeleniumKeywords.Click(pageName, "weightcourse_nextlesson_btn");
                    }
                    else if (j == courselessondata.Count - 1)
                    {
                        Console.WriteLine("Clicking Finishlessonlink ..... ");
                        cc.ClickFinishButton();
                        //SeleniumKeywords.Click(pageName, "weightcourse_finishlesson_btn");
                    }
                    System.Threading.Thread.Sleep(5000);
                }
            }
        }
コード例 #19
0
        private void VerifyFinancialWellBeingTilesData(string category)
        {
            List <string[]> finwellbeingscreendata = new List <string[]>();

            finwellbeingscreendata = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, category);

            System.Threading.Thread.Sleep(4000);
            for (int i = 0; i < finwellbeingscreendata.Count; i++)
            {
                string elementname        = finwellbeingscreendata.ElementAt(i)[2];
                string elementlocatorname = finwellbeingscreendata.ElementAt(i)[3];
                string expectedtext       = finwellbeingscreendata.ElementAt(i)[4];
                string inputvariable      = finwellbeingscreendata.ElementAt(i)[5];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname, inputvariable);
                softAssertions.Add("Element : " + elementlocatorname, expectedtext, actualtext, "contains");
            }
        }
コード例 #20
0
        /// <summary>
        /// This method validate all the blank error messages(Online display name and Email id) in My profile section
        /// </summary>
        /// <returns></returns>
        private void ValidateMyProfBlankErroMsg()
        {
            List <string[]> result = new List <string[]>();

            mperrordata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "mperrormsg");
            ClickMyProfEditBtn();
            ClearOnlineDisplayName();
            ClearEmailId();
            for (int i = 0; i < mperrordata.Count; i++)
            {
                string elementname        = mperrordata.ElementAt(i)[2];
                string elementlocatorname = mperrordata.ElementAt(i)[3];
                string errortext          = mperrordata.ElementAt(i)[4];
                string actualerrortext    = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softAssertions.Add("Element : " + mperrordata.ElementAt(i)[2], errortext, actualerrortext, "equals");
            }
        }
        private List <String[]> VerifyActions()
        {
            List <string[]> result = new List <string[]>();

            actiondata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "actions");
            for (int i = 0; i < actiondata.Count; i++)
            {
                string elementname        = actiondata.ElementAt(i)[2];
                string elementlocatorname = actiondata.ElementAt(i)[3];
                string expectedtext       = actiondata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                bool   textmatch          = SeleniumKeywords.VerifyTextContains(actualtext, expectedtext);
                string msg = "Element: " + elementname + "Expected: " + expectedtext + "Actual: " + actualtext;
                result.Add(new string[] { msg, textmatch.ToString() });
            }
            return(result);
        }
コード例 #22
0
        /// <summary>
        /// Method is use to verify order of Left Menu option
        /// </summary>
        /// <param name="expected"></param>
        public void Verify_LeftMenuOptionsOrder(List <String[]> expected)
        {
            string actualtxt;
            string elementname, locatorname;
            string locatorindex;
            string expectedtxt;

            for (int i = 0; i < expected.Count; i++)
            {
                elementname  = expected.ElementAt(i)[3];
                locatorname  = expected.ElementAt(i)[4];
                expectedtxt  = expected.ElementAt(i)[5];
                locatorindex = expected.ElementAt(i)[6];
                actualtxt    = SeleniumKeywords.GetText(pageName, locatorname, locatorindex);
                softAssertion.Add(elementname, expectedtxt, actualtxt, "contains");
            }
        }
        private List <String[]> ValidateSetUpScreen()
        {
            System.Threading.Thread.Sleep(5000);
            List <string[]> result = new List <string[]>();

            set = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "setup");
            for (int i = 0; i < set.Count; i++)
            {
                string elementname        = set.ElementAt(i)[2];
                string elementlocatorname = set.ElementAt(i)[3];
                string expectedtext       = set.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pageName, elementlocatorname);
                bool   textmatch          = SeleniumKeywords.VerifyTextContains(actualtext, expectedtext);
                string msg = "Element: " + elementname + "Expected: " + expectedtext + "Actual: " + actualtext;
                result.Add(new string[] { msg, textmatch.ToString() });
            }
            return(result);
        }
コード例 #24
0
        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);
        }
        private void ValidateSetUpScreen()
        {
            System.Threading.Thread.Sleep(6000);
            plandata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "setup");
            for (int i = 0; i < plandata.Count; i++)
            {
                string elementname        = plandata.ElementAt(i)[2];
                string elementlocatorname = plandata.ElementAt(i)[3];
                string expectedtext       = plandata.ElementAt(i)[4];

                if (i == 5)
                {
                    expectedtext = Convert.ToDateTime(tdate).ToString("MMMM d, yyyy");
                }
                string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add(elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #26
0
        private void ValidateIncentiveHistoryDate()
        {
            List<string[]> historydate = new List<string[]>();
            historydate = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "incentivehistorydate");
            List<string> expdate_data = new List<string>();
            Common cmn = new Common();
            expdate_data.Add(cmn.GetCurrentYear());
            expdate_data.Add(cmn.GetCurrentMonth());
            expdate_data.Add(cmn.GetCurrentDay());
            for (int i = 0; i < historydate.Count; i++)
            {
                string elementname = historydate.ElementAt(i)[2];
                string elementlocatorname = historydate.ElementAt(i)[3];
                string expectedtext = expdate_data.ElementAt(i);
                string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname);

                softAssertions.Add("Element : " + elementlocatorname, expectedtext, actualtext, "equals");
            }
        }
コード例 #27
0
        /// <summary>
        /// This method validates the tracker history headers
        /// </summary>
        /// <param name="historydata"></param>
        /// <returns></returns>
        public void ValidateHistoryHeader(List <string[]> historydata, string pname)
        {
            string pagename = pageName;

            //ClickViewHistory();
            System.Threading.Thread.Sleep(2000);
            for (int i = 0; i < historydata.Count; i++)
            {
                string elementname        = historydata.ElementAt(i)[2];
                string elementlocatorname = historydata.ElementAt(i)[3];
                string expectedtext       = historydata.ElementAt(i)[4];
                string actualtext         = SeleniumKeywords.GetText(pagename, elementlocatorname);
                if (i == 2)
                {
                    pagename = pname;
                }
                softAssertions.Add("Element : " + elementname, expectedtext, actualtext, "contains");
            }
        }
コード例 #28
0
        /// <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);
        }
コード例 #29
0
        public List <string[]> VerifyHeader()
        {
            List <string[]> ExpectedText = new List <string[]>();

            ExpectedText = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "header");
            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() });
            }
            return(result);
        }
コード例 #30
0
        public void ValidateHAReport()
        {
            System.Threading.Thread.Sleep(3000);
            SeleniumKeywords.Click(pageName, "dashboard_ha_viewreportlink");
            System.Threading.Thread.Sleep(3000);
            List <string[]> hareports = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "hareports");

            for (int i = 0; i < hareports.Count; i++)
            {
                string elementlocatorname = hareports.ElementAt(i)[3];
                string expreportdata      = hareports.ElementAt(i)[4];
                string actualreportdata   = SeleniumKeywords.GetText(pageName, elementlocatorname);

                //bool textmatch = actualreportdata.Trim().Contains(expreportdata.Trim());
                //string msg = "Element : " + elementlocatorname + " , Expected : " + expreportdata + " , Actual : " + actualreportdata;
                //result.Add(new string[] { msg, textmatch.ToString() });

                softAssertions.Add("Element : " + elementlocatorname, expreportdata, actualreportdata, "contains");
            }
        }