Пример #1
0
        public void DeleteEducation()
        {
            GlobalDefinitions.Wait();
            EducationLink.Click();
            //for deleting Education details
            //IWebElement Delete = GlobalDefinitions.driver.FindElement(By.XPath("//tbody[1]//tr[1]//td[6]//span[2]//i[1]"));
            GlobalDefinitions.Wait();
            DeleteEdu.Click();

            IWebElement DeleteAlertPopup  = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      ExpectedAlertText = DeleteAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(ExpectedAlertText.Contains("removed"));
            //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Education deleted successfully");
        }
Пример #2
0
        public void EditEduaction()
        {
            {
                Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
                GlobalDefinitions.Wait();
                EducationLink.Click();

                //for editing Education details
                IList <IWebElement> rows = GlobalDefinitions.driver.FindElements(By.XPath(".//tr"));

                //This loop finds the first row which' title matches sRowValue
                for (int i = 1; i < rows.Count; i++)
                {
                    String sValue = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'MIT')]")).Text;
                    if (sValue == "MIT")
                    {
                        IWebElement Edit = GlobalDefinitions.driver.FindElement(By.XPath("//tbody[1]//tr[1]//td[6]//span[1]//i[1]"));
                        Edit.Click();
                        //EditEdu.Click();
                        EnterUniversity.Clear();
                        EnterUniversity.SendKeys(ExcelLib.ReadData(7, "College"));
                        //Select Title from Dropdown
                        IWebElement   TitleLevelDrpdwn    = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='title']"));
                        SelectElement chooseEduTitleLevel = new SelectElement(TitleLevelDrpdwn);
                        var           EduTitleLevelData   = ExcelLib.ReadData(rowNum, "Title");
                        chooseEduTitleLevel.SelectByValue(EduTitleLevelData);
                        UpdateEdu.Click();
                        break;
                    }
                }
            }

            IWebElement UpdateAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText        = UpdateAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("updated"));
            Console.WriteLine(AlertText);
            //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Education Updated successfully");
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Skills deleted successfully");
        }
Пример #3
0
        public void AddEducation()
        {
            //Populate the Excel Sheet
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
            GlobalDefinitions.Wait();
            EducationLink.Click();

            //loop for multiple data getting added at single shot
            int loopNum = Base.RowCount + 2;

            for (int rowNum = 2; rowNum <= loopNum; rowNum++)
            {
                GlobalDefinitions.Wait();
                AddNewEducation.Click();
                EnterUniversity.SendKeys(ExcelLib.ReadData(rowNum, "College"));
                //Select country from dropdown
                IWebElement   EduLevelDrpdwn = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='country']"));
                SelectElement chooseEduLevel = new SelectElement(EduLevelDrpdwn);
                var           EduLevelData   = ExcelLib.ReadData(rowNum, "Country");
                chooseEduLevel.SelectByValue(EduLevelData);

                //Select Title from Dropdown
                IWebElement   TitleLevelDrpdwn    = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='title']"));
                SelectElement chooseEduTitleLevel = new SelectElement(TitleLevelDrpdwn);
                //select.SelectByText(ConstantHelpers.LevelFluent);
                var EduTitleLevelData = ExcelLib.ReadData(rowNum, "Title");
                chooseEduTitleLevel.SelectByValue(EduTitleLevelData);
                GlobalDefinitions.Wait();
                //Enter Degree

                EduDegree.SendKeys(ExcelLib.ReadData(rowNum, "Degree"));

                //Select Title from Dropdown
                IWebElement   YearDrpdwn    = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='yearOfGraduation']"));
                SelectElement chooseEduYear = new SelectElement(YearDrpdwn);
                //select.SelectByText(ConstantHelpers.LevelFluent);
                var EduYearData = ExcelLib.ReadData(rowNum, "Year");
                chooseEduYear.SelectByValue(EduYearData);
                AddSkill.Click();
            }
            //Asserting the Language text
            String ExpectedLanguage = ExcelLib.ReadData(2, "College");
            String ActualLanguage   = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'MIT')]")).Text;

            Assert.AreEqual(ActualLanguage, ExpectedLanguage);
            Console.WriteLine("Education" + " " + ActualLanguage + " " + "is added");
            GlobalDefinitions.Wait();
            String ExpectedLanguage1 = ExcelLib.ReadData(3, "College");
            String ActualLanguage1   = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Raisoni')]")).Text;

            Assert.AreEqual(ActualLanguage1, ExpectedLanguage1);
            Console.WriteLine("Education" + " " + ActualLanguage1 + " " + "is added");
            GlobalDefinitions.Wait();
            String ExpectedLanguage2 = ExcelLib.ReadData(4, "College");
            String ActualLanguage2   = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'IC')]")).Text;

            Assert.AreEqual(ActualLanguage2, ExpectedLanguage2);
            Console.WriteLine("Education" + " " + ActualLanguage2 + " " + "is added");
            //saving screenshot
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Education Added successfully");
        }