Ejemplo n.º 1
0
        public void AddCertificate()
        {
            //Populate the Excel Sheet
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
            GlobalDefinitions.Wait();
            CertificateLink.Click();

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

            for (int rowNum = 2; rowNum <= loopNum; rowNum++)
            {
                GlobalDefinitions.Wait();
                AddNewCerti.Click();
                EnterCerti.SendKeys(ExcelLib.ReadData(rowNum, "Certificate"));
                CertiFrom.SendKeys(ExcelLib.ReadData(rowNum, "CertificateFrom"));

                IWebElement   CertYearDrpdwn = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='certificationYear']"));
                SelectElement chooseCertYear = new SelectElement(CertYearDrpdwn);
                //select.SelectByText(ConstantHelpers.LevelFluent);
                var CertYearData = ExcelLib.ReadData(rowNum, "CertYear");
                chooseCertYear.SelectByValue(CertYearData);
                AddCertiBtn.Click();
            }
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("added"));
            Console.WriteLine(AlertText);
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Certificate Added successfully");
        }
Ejemplo n.º 2
0
        public void SearchSkill()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "SearchSkill");
            GlobalDefinitions.Wait();
            TxtSearcSkill.SendKeys(ExcelLib.ReadData(2, "Category"));
            SearchIcon.Click();
            //Checking the right page
            Assert.AreEqual("Search", GlobalDefinitions.driver.Title);
            Base.test = Base.extent.StartTest("On Share Search page");
            TxtSubCategory.SendKeys(ExcelLib.ReadData(2, "SubCategory"));
            SearchUser.SendKeys(ExcelLib.ReadData(2, "SearchUser"));
            IList <IWebElement> optionsToSelect = GlobalDefinitions.driver.FindElements(By.XPath("//input[@placeholder='Search user']"));

            foreach (IWebElement options in optionsToSelect)
            {
                Console.WriteLine(options);
                if (options.Text.Equals(SearchUser))
                {
                    Console.WriteLine("Trying to select: " + SearchUser);
                    options.Click();
                    break;
                }
            }
            Onsite.Click();
            Online.Click();
            ShowAll.Click();
        }
Ejemplo n.º 3
0
        internal void DeleteEducation()
        {
            GlobalDefinitions.Wait(2000);

            eduTab.Click();


            GlobalDefinitions.Wait(1000);
            var table = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table"));

            var eduList = table.FindElements(By.TagName("tbody")).ToList();

            for (int i = 1; i <= eduList.Count; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                GlobalDefinitions.Wait(1000);
                Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "Spanish";
                if (ActualValue.Text == "India")

                {
                    _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[6]/span[2]")).Click();
                    //   CommonMethods.test.Log(LogStatus.Pass, "Test Passed");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "deleted");
                    // Console.WriteLine("Success");
                    break;
                    // return;
                }
            }
        }
Ejemplo n.º 4
0
 internal void EditProfile()
 {
     //Populate the Excel Sheet
     Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
     GlobalDefinitions.Wait();
     EditProfileicon.Click();
     EditFirstName.Clear();
     EditFirstName.SendKeys(ExcelLib.ReadData(2, "FirstName"));
     EditLasttName.Clear();
     EditLasttName.SendKeys(ExcelLib.ReadData(2, "LastName"));
     ProfileSaveBtn.Click();
     GlobalDefinitions.driver.Navigate().Refresh();
     GlobalDefinitions.Wait();
     Availability.Click();
     AvailabilityTime.SendKeys(ExcelLib.ReadData(2, "Availability"));
     Hours.Click();
     AvailabilityHour.SendKeys(ExcelLib.ReadData(2, "SelectHours"));
     GlobalDefinitions.Wait();
     EarnTarget.Click();
     AvailabilityTarget.SendKeys(ExcelLib.ReadData(2, "EarnTraget"));
     GlobalDefinitions.Wait();
     DescriptionBtn.Click();
     TxtDescription.Clear();
     GlobalDefinitions.Wait();
     TxtDescription.SendKeys(ExcelLib.ReadData(2, "EditDesc"));
     DesSaveButton.Click();
 }
Ejemplo n.º 5
0
        public void AddLanguage()
        {
            //Populate the Excel Sheet
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
            GlobalDefinitions.Wait();


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

            for (int rowNum = 2; rowNum <= loopNum; rowNum++)
            {
                GlobalDefinitions.Wait();
                AddNewLangBtn.Click();
                AddLangText.SendKeys(ExcelLib.ReadData(rowNum, "Language"));

                //ChooseLang.SendKeys(ExcelLib.ReadData(2, "ChooseLangLevel"));
                ChooseLang.Click();


                //Selecting the language level
                IWebElement   LanguageLevelDrpdwn = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='level']"));
                SelectElement chooseLanguageLevel = new SelectElement(LanguageLevelDrpdwn);
                //select.SelectByText(ConstantHelpers.LevelFluent);
                var languageLevelData = ExcelLib.ReadData(rowNum, "ChooseLangLevel");
                chooseLanguageLevel.SelectByValue(languageLevelData);

                AddLang.Click();
            }
            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Languages added successfully");
        }
Ejemplo n.º 6
0
        internal void EditEducation()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Education");
            GlobalDefinitions.Wait(2000);
            //clicking on Education Tab
            eduTab.Click();
            GlobalDefinitions.Wait(2000);
            //click on modify button
            editEdu.Click();
            //*[@id="account-profile-section"]/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[1]/tr/td[6]/span[1]/i
            //*[@id="account-profile-section"]/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[2]/tr/td[6]/span[1]/i

            IWebElement modify2 = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[1]/tr/td/div[1]/div[2]/select"));

            //modify2.Clear();
            //*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[5]/tr/td/div[1]/div[2]/select
            SelectElement clickThis2 = new SelectElement(modify2);

            clickThis2.SelectByText("India");

            //   _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[5]/tr/td/div[3]/input[1]")).Click();
            _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[1]/tr/td/div[3]/input[1]")).Click();
            //Start the Reports
            //CommonMethods.ExtentReports();
            GlobalDefinitions.Wait(1000);
            // CommonMethods.test = CommonMethods.extent.StartTest("modify a education Details");

            int count;

            GlobalDefinitions.Wait(1000);

            count = 1;
            count++;
            int i;

            for (i = 1; i <= count++; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                GlobalDefinitions.Wait(1000);
                Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "sitar";
                if (ActualValue.Text == "India")

                {
                    //  CommonMethods.test.Log(LogStatus.Pass, "Test Passed, modified Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "modified");
                    Console.WriteLine("Success");
                    break;
                }


                else
                {
                    Console.WriteLine("Failed");
                }
            }
        }
Ejemplo n.º 7
0
        public void ThenCertificateDetailsGetsUpdatedSuccessfully()
        {
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("updated"));
            Console.WriteLine(AlertText);
        }
Ejemplo n.º 8
0
        public void ThenTheSellerLanguageDeatilsGetsDeletedSuccessfully()
        {
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("deleted"));
            Console.WriteLine(AlertText);
        }
Ejemplo n.º 9
0
        public void ThenASellerLanguageGetsUpdatedSuccessfully()
        {
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("updated"));
            Console.WriteLine(AlertText);
            //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Language Updated Successfully");
        }
Ejemplo n.º 10
0
        public void ThenACertificateDetailsGetsAddedSuccessfully()
        {
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("added"));
            Console.WriteLine(AlertText);
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Skills deleted successfully");
        }
Ejemplo n.º 11
0
        public void DeleteCertificate()
        {
            //for deleting Certificate details
            GlobalDefinitions.Wait();
            CertificateLink.Click();
            DeleteCerti.Click();
            IWebElement DeleteAlertPopup  = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      ExpectedAlertText = DeleteAlertPopup.Text;

            Assert.IsTrue(ExpectedAlertText.Contains("deleted"));
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Certificate Edited successfully");
        }
Ejemplo n.º 12
0
        public void ThenSkillDetailsGetsDeletedSuccessfully()
        {
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("deleted"));
            Console.WriteLine(AlertText);
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Adding is successful");
            //GlobalDefinitions.Wait();
            //Base.TearDown();
        }
Ejemplo n.º 13
0
        internal void EditCertification()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Certificate");
            certTab.Click();
            //click on modify button
            _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[3]/tr/td[4]/span[1]/i")).Click();

            //clear and enter new data
            IWebElement certificationmodify = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[3]/tr/td/div/div/div[1]/input"));

            certificationmodify.Clear();
            certificationmodify.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "certificationmodify"));

            _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[3]/tr/td/div/span/input[1]")).Click();

            int count;

            //Start the Reports
            //  CommonMethods.ExtentReports();
            GlobalDefinitions.Wait(1000);
            // CommonMethods.test = CommonMethods.extent.StartTest("modify a certification Details");

            GlobalDefinitions.Wait(1000);

            count = 1;
            count++;
            int i;

            for (i = 1; i <= count++; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[5]/div[1]/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                GlobalDefinitions.Wait(1000);
                Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "sitar";
                if (ActualValue.Text == "QTP")
                {
                    // CommonMethods.test.Log(LogStatus.Pass, "Test Passed, modified Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "modified");
                    Console.WriteLine("Success");
                    return;
                }


                else
                {
                    Console.WriteLine("Failed");
                }
            }
        }
Ejemplo n.º 14
0
        internal void DeleteLanguage()
        {
            //for deleting skill details
            GlobalDefinitions.Wait();

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

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("deleted"));
            Console.WriteLine(AlertText);
            //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Language deleted successfully");
        }
Ejemplo n.º 15
0
        internal void AddLanguage()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Language");
            GlobalDefinitions.Wait(1500);
            // Click on Profile tab
            profTab.Click();
            //Click on Add New button
            profAddNew.Click();
            //Add Language
            addLang.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "addLang"));
            //Click on Language Level
            langLevel.Click();

            //Choose the language level
            IWebElement Lang = _driver.FindElements(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/div/div[2]/select/option"))[1];

            Lang.Click();

            //Click on Add button
            addBtn.Click();
            int count;

            count = 1;
            count++;
            int i;

            for (i = 1; i <= count++; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                Thread.Sleep(1000);
                //string actualvalue = "ActualValue.Text";
                //Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "Spanish";
                if (ActualValue.Text == "Spanish")
                //Assert.AreEqual(actualvalue, "Spanish");
                {
                    // CommonMethods.test.Log(LogStatus.Pass, "Test Passed, added Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "added");
                    Console.WriteLine("Passed");
                    return;
                }

                else
                {
                    Console.WriteLine("Failed");
                }
            }
        }
Ejemplo n.º 16
0
 public void DeleteListing()
 {
     delete.Click();
     GlobalDefinitions.Wait();
     GlobalDefinitions.driver.FindElement(By.XPath("//button[@class='ui icon positive right labeled button']")).Click();
     Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Skills deleted Successfully");
     try
     {
         String ActLang2 = (GlobalDefinitions.driver.FindElement(By.XPath("//tbody//tr[1]//td[2]"))).Text;
         Assert.AreNotEqual(ActLang2, ExcelLib.ReadData(3, "Title"));
     }
     catch
     {
         Assert.True(true, "Element not found");
     }
 }
Ejemplo n.º 17
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");
        }
Ejemplo n.º 18
0
        internal void DeleteLanguage()
        {
            //click on profile tab
            profTab.Click();
            //click on Language tab
            _driver.FindElement(By.XPath("//a[@class='item active']")).Click();

            _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[2]/tr/td[3]/span[2]/i")).Click();

            //Start the Reports
            // CommonMethods.ExtentReports();
            GlobalDefinitions.Wait(1000);
            // CommonMethods.test = CommonMethods.extent.StartTest("delete a language Details");
            int count;

            // GlobalDefinitions.Wait(1000);

            count = 1;
            // count++;
            int i;

            for (i = 1; i <= count++; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                GlobalDefinitions.Wait(1000);
                Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "Spanish";
                if (ActualValue.Text == "Telugu")
                {
                    //CommonMethods.test.Log(LogStatus.Fail, "Test Failed, not deleted Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "notdeleted");
                    Console.WriteLine("Fail");
                    Assert.Fail("failed");
                    // return;
                }


                else
                {
                    //  CommonMethods.test.Log(LogStatus.Pass, "Test Passed");

                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "deleted");
                }
                // Console.WriteLine("Success");
            }
        }
Ejemplo n.º 19
0
        public void EditCertificate()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
            GlobalDefinitions.Wait();
            CertificateLink.Click();
            EditCerti.Click();
            EnterCerti.Clear();
            EnterCerti.SendKeys(ExcelLib.ReadData(7, "Certificate"));
            UpdateCerti.Click();
            IWebElement UpdateAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText        = UpdateAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("updated"));
            Console.WriteLine(AlertText);
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Certificate Edited successfully");
        }
Ejemplo n.º 20
0
        internal void AddSkill()
        {
            skillsButton.Click();
            GlobalDefinitions.Wait(1000);

            ShareSkillBtn.Click();

            nameField.SendKeys("selenium c#");

            levelField.Click();

            valueField.Click();

            addButton.Click();


            // CommonMethods.ExtentReports();
            // GlobalDefinitions.Wait(1000);
            //    CommonMethods.test = CommonMethods.extent.StartTest("Add a skill");


            GlobalDefinitions.Wait(2000);


            var table = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table"));

            var skillsList = table.FindElements(By.TagName("tbody")).ToList();

            for (int i = 1; i <= skillsList.Count; i++)
            {
                var skill = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));

                //create test cases
                if (skill.Text == "selenium c#")
                {
                    //    CommonMethods.test.Log(LogStatus.Pass, "Test Passed, Added a skill Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "SkillAdded");
                    break;
                }
                else
                {
                    //  CommonMethods.test.Log(LogStatus.Fail, "Test Failed, Skill is not added");
                    //Assert.Fail("failed");
                }
            }
        }
Ejemplo n.º 21
0
        internal void DeleteEducation()
        {
            GlobalDefinitions.Wait(3000);

            eduTab.Click();

            deleteEdu.Click();
            // CommonMethods.ExtentReports();
            Thread.Sleep(1000);
            // CommonMethods.test = CommonMethods.extent.StartTest("delete a education Details");

            int count;

            GlobalDefinitions.Wait(1000);

            count = 1;
            // count++;
            int i;

            for (i = 1; i <= count++; i++)
            {
                //string ActualValue = Driver.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;
                IWebElement ActualValue = _driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]"));
                GlobalDefinitions.Wait(1000);
                Console.WriteLine(ActualValue.Text);
                //string ExpectedValue = "Spanish";
                if (ActualValue.Text == "India")

                {
                    //CommonMethods.test.Log(LogStatus.Fail, "Test Failed, not deleted Successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "notdeleted");
                    Console.WriteLine("Fail");
                    Assert.Fail("failed");
                    // return;
                }


                else
                {
                    //   CommonMethods.test.Log(LogStatus.Pass, "Test Passed");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(_driver, "deleted");
                }
                // Console.WriteLine("Success");
            }
        }
Ejemplo n.º 22
0
        public void DeleteSkills()
        {
            GlobalDefinitions.Wait();
            SkillLink.Click();
            IWebElement Delete = GlobalDefinitions.driver.FindElement(By.XPath("//div[@class='ui bottom attached tab segment tooltip-target active']//tbody[1]//tr[1]//td[3]//span[2]"));

            Delete.Click();
            //for deleting skill details

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

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("deleted"));
            Console.WriteLine(AlertText);
            //Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Skills deleted successfully");
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Skills deleted successfully");
        }
Ejemplo n.º 23
0
        public void EditLanguage()
        {
            {
                Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
                GlobalDefinitions.Wait();        //for editing skill details
                EditLang.Click();
                AddLangText.Clear();
                AddLangText.SendKeys(ExcelLib.ReadData(7, "Language"));

                //Selecting the language level
                IWebElement   LanguageLevelDrpdwn = GlobalDefinitions.driver.FindElement(By.XPath("//select[@name='level']"));
                SelectElement chooseLanguageLevel = new SelectElement(LanguageLevelDrpdwn);
                //select.SelectByText(ConstantHelpers.LevelFluent);
                var languageLevelData = ExcelLib.ReadData(2, "ChooseLangLevel");
                chooseLanguageLevel.SelectByValue(languageLevelData);
                AddLang.Click();
            }
        }
Ejemplo n.º 24
0
        public void ThenASkillDetailsGetsAddedSuccessfully()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");
            //Asserting the Language text

            String ActualSkill = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'C#')]")).Text;

            Assert.AreEqual(ActualSkill, ExcelLib.ReadData(2, "Skill"));
            Console.WriteLine("Skill" + " " + ActualSkill + " " + "is added");
            GlobalDefinitions.Wait();

            String ActualSkill1 = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'POM')]")).Text;

            Assert.AreEqual(ActualSkill1, ExcelLib.ReadData(3, "Skill"));
            Console.WriteLine("Skill" + " " + ActualSkill1 + " " + "is added");
            GlobalDefinitions.Wait();

            String ActualSkill2 = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Nunit')]")).Text;

            Assert.AreEqual(ActualSkill2, ExcelLib.ReadData(4, "Skill"));
            Console.WriteLine("Skill" + " " + ActualSkill2 + " " + "is added");
            //Reading Language Level from Data excel sheet



            //Asserting the Skill level
            String ActualLevel = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Intermediate')]")).Text;

            Assert.AreEqual(ActualLevel, ExcelLib.ReadData(2, "ChooseSkillLevel"));
            Console.WriteLine("Level" + " " + ActualLevel + " " + "is added");
            GlobalDefinitions.Wait();

            String ActualLevel1 = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Expert')]")).Text;

            Assert.AreEqual(ActualLevel1, ExcelLib.ReadData(3, "ChooseSkillLevel"));
            Console.WriteLine("Level" + " " + ActualLevel1 + " " + "is added");
            GlobalDefinitions.Wait();

            String ActualLevel2 = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Expert')]")).Text;

            Assert.AreEqual(ActualLevel2, ExcelLib.ReadData(4, "ChooseSkillLevel"));
            Console.WriteLine("Level" + " " + ActualLevel2 + " " + "is added");
            //Base.TearDown();
        }
Ejemplo n.º 25
0
        public void ThenANewLanguageGetsAddedSuccessfully()
        {
            //Asserting the Language text
            String ExpectedLanguage = ExcelLib.ReadData(2, "Language");
            String ActualLanguage   = GlobalDefinitions.driver.FindElement(By.XPath("//tbody//tr[1]//td[1]")).Text;

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

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

            Assert.AreEqual(ActualLanguage2, ExpectedLanguage2);
            Console.WriteLine("Language" + " " + ActualLanguage2 + " " + "is added");
            //Reading Language Level from Data excel sheet
            String languageLevelData = ExcelLib.ReadData(2, "ChooseLangLevel");


            //Asserting the Language level
            String ActualLevel = GlobalDefinitions.driver.FindElement(By.XPath("//tbody//tr[1]//td[2]")).Text;

            Assert.AreEqual(ActualLevel, languageLevelData);
            Console.WriteLine("Level" + " " + ActualLevel + " " + "is added");
            GlobalDefinitions.Wait();
            String languageLevelData1 = ExcelLib.ReadData(3, "ChooseLangLevel");
            String ActualLevel1       = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Conversational')]")).Text;

            Assert.AreEqual(ActualLevel1, languageLevelData1);
            Console.WriteLine("Level" + " " + ActualLevel1 + " " + "is added");
            GlobalDefinitions.Wait();
            String languageLevelData2 = ExcelLib.ReadData(4, "ChooseLangLevel");
            String ActualLevel2       = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Fluent')]")).Text;

            Assert.AreEqual(ActualLevel2, languageLevelData2);
            Console.WriteLine("Level" + " " + ActualLevel2 + " " + "is added");
            //Base.TearDown();
        }
Ejemplo n.º 26
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");
        }
        public void ThenAEducationDetailsGetsAddedSuccessfully()
        {
            //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");
        }
Ejemplo n.º 28
0
        public void EditSkills()
        {
            Global.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkills");

            GlobalDefinitions.Wait();
            SkillLink.Click();

            //This list gets the number of rows from the table
            //IList<IWebElement> rows = GlobalDefinitions.driver.FindElements(By.XPath(".//tr"));

            //This loop finds the first row which' title matches sRowValue
            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(),'C#')]")).Text;
                if (sValue == ExcelLib.ReadData(2, "Skill"))
                {
                    IWebElement Edit = GlobalDefinitions.driver.FindElement(By.XPath("//div[@class='ui bottom attached tab segment tooltip-target active']//tbody[1]//tr[1]//td[3]//span[1]//i[1]"));
                    Edit.Click();
                    AddSkillText.Clear();
                    AddSkillText.SendKeys(ExcelLib.ReadData(7, "Skill"));
                    UpdateSkill.Click();
                    break;
                }
            }
            GlobalDefinitions.Wait();
            IWebElement AddAlertPopup = GlobalDefinitions.driver.FindElement(By.ClassName("ns-box-inner"));
            String      AlertText     = AddAlertPopup.Text;

            GlobalDefinitions.Wait();
            Assert.IsTrue(AlertText.Contains("updated"));
            Console.WriteLine(AlertText);
            //saving screenshot
            var ScreenshotPath = Global.SaveScreenshot.SaveScreenshotClass(GlobalDefinitions.driver, "Edit is successful");
        }
Ejemplo n.º 29
0
        internal void DeleteShareSkill()
        {
            //Thread.Sleep(3000);
            GlobalDefinitions.Wait(3000);
            ManagementListingBtn.Click();
            //Thread.Sleep(2000);
            GlobalDefinitions.Wait(2000);


            try
            {
                //Thread.Sleep(1000);
                GlobalDefinitions.Wait(1000);


                var table = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody")); //table

                var manageListRow = table.FindElements(By.TagName("tr")).ToList();                                                   //all rows picked


                var isFound = false;
                // var rows = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr"));  //each row and coloum


                for (int i = 1; i <= manageListRow.Count; i++)
                {
                    var row = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]")); //each row and coloum

                    var columnList = row.FindElements(By.TagName("td")).ToList();                                                                    //all coloum

                    for (int j = 1; j <= columnList.Count; j++)
                    {
                        var oldManageList = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[" + j + "]"));  //each row and coloum

                        //click on edit button with specific row and column

                        if (oldManageList.Text == "Edited Code")
                        {
                            isFound = true;

                            _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[3]/i")).Click();   //Delete button
                            //IAlert alert = _driver.SwitchTo().Alert();
                            Thread.Sleep(2000);
                            _driver.FindElement(By.XPath("/html/body/div[2]/div/div[3]/button[2]")).Click();

                            //alert.Accept();

                            break;
                        }
                    }
                    if (isFound)
                    {
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 30
0
        internal void EditShareSkill()
        {
            //Thread.Sleep(3000);
            GlobalDefinitions.Wait(3000);
            ManagementListingBtn.Click();
            //Thread.Sleep(2000);
            GlobalDefinitions.Wait(2000);
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "EditShareSkill");

            try
            {
                //Thread.Sleep(1000);
                GlobalDefinitions.Wait(1000);


                var table = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody")); //table

                var manageListRow = table.FindElements(By.TagName("tr")).ToList();                                                   //all rows picked


                var isFound = false;
                // var rows = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr"));  //each row and coloum


                for (int i = 1; i <= manageListRow.Count; i++)
                {
                    var row = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]")); //each row and coloum

                    var columnList = row.FindElements(By.TagName("td")).ToList();                                                                    //all coloum

                    for (int j = 1; j <= columnList.Count; j++)
                    {
                        var oldManageList = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[" + j + "]"));  //each row and coloum

                        //click on edit button with specific row and column

                        if (oldManageList.Text == "Code")
                        {
                            isFound = true;

                            _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[2]/i")).Click();   //edit button



                            break;
                        }
                    }
                    if (isFound)
                    {
                        break;
                    }
                }

                if (isFound)
                {
                    Thread.Sleep(1000);
                    //Add Title {edit value update from (Code)}
                    EditTitle.Clear();
                    EditTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EditTitle"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Add Description
                    EditDescrp.Clear();
                    EditDescrp.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Service type
                    OneOff.Click();
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Skill Trade
                    EditCredit.Click();
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    Save.Click();
                }
                else
                {
                    Console.WriteLine("Test Fail, Edit un-successful");
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }