Beispiel #1
0
        internal void AddNewEdu()
        {
            //Add Education
            AddEducation.Click();

            //Add Education tab
            AddNewEducation.Click();

            //Enter the University
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose Country
            ChooseCountry.Click();
            Thread.Sleep(500);

            //Choose Country Level
            ChooseCountryOpt.Click();

            //Choose Title
            ChooseTitle.Click();
            Thread.Sleep(500);

            ChooseTitleOpt.Click();

            //Enter Degree
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Year of Graduation
            DegreeYear.Click();
            Thread.Sleep(500);
            DegreeYearOpt.Click();
            AddEdu.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Education successfully");
        }
        internal void EnterEducation()
        {
            //Populate the excel data

            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            // Refresh the page
            GlobalDefinitions.driver.Navigate().Refresh();
            //Click on Education button
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[3]", 10000);
            EducationBtn.Click();

            //Click on add new education
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/thead/tr/th[6]/div", 10000);
            AddNewEducationBtn.Click();

            //Choose country
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "country", 10000);
            SelectCountry.Click();
            new SelectElement(SelectCountry).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Country"));

            //Choose title
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "title", 10000);
            SelectTitle.Click();
            new SelectElement(SelectTitle).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            //Choose year
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "yearOfGraduation", 10000);
            YearOfGraduation.Click();
            new SelectElement(YearOfGraduation).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "YearOfGraduation"));

            //Choose institute name
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "instituteName", 10000);
            InstitName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose degree
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "degree", 10000);
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Click on add education
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='Add']", 10000);
            AddEdu.Click();
            Base.test.Log(LogStatus.Info, "Education Added successfully");
        }
Beispiel #3
0
        internal void Add_Education()
        {
            //read data from the excel
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddEduction");
            Thread.Sleep(1000);
            Education.Click();
            GlobalDefinitions.WaitForElement(Global.GlobalDefinitions.driver, "XPath", AddNewEducation.Text, 2000);
            AddNewEducation.Click();
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "university"));
            var countryOpt = new SelectElement(ChooseCountry);

            countryOpt.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "country"));
            var titleOpt = new SelectElement(ChooseTitle);

            titleOpt.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "degree"));
            var graduationOpt = new SelectElement(DegreeYear);

            graduationOpt.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "graduation year"));
            AddEdu.Click();
            Thread.Sleep(1000);
            //close the pop up window
            GlobalDefinitions.driver.FindElement(By.XPath("//a[@href ='#']")).Click();
        }
        internal void EditProfile()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            Thread.Sleep(1000);

            //Click on Edit button
            ProfileEdit.Click();

            //User's First Name
            FirstName.Clear();
            FirstName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "FirstName"));

            //User's Last Name
            LastName.Clear();
            LastName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "LastName"));

            //Save User's Details
            SaveUserDetails.Click();

            //Availability Time option
            Thread.Sleep(1500);
            AvailabilityTime.Click();
            AvailabilityTimeOpt.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"));


            //Availability Hours
            Thread.Sleep(2000);
            AvailabilityHours.Click();
            //Availability Hours option
            Availability.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Hours"));

            //Earn Target
            Thread.Sleep(2000);
            EarnTarget.Click();
            selectTarget.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EarnTarget"));

            //-----------------------------------------------------

            //IJavaScriptExecutor js = GlobalDefinitions.driver as IJavaScriptExecutor;
            //Thread.Sleep(1000);
            //js.ExecuteScript("window.scrollBy(0,100);");
            //Thread.Sleep(1000);


            //---------------------------------------------------------
            //Click on Add New Language button
            AddNewBtn.Click();
            Thread.Sleep(1000);
            //Enter the Language
            AddLangText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            //Choose Language
            ChooseLangLevel.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Level"));
            Thread.Sleep(1000);
            AddLang.Click();
            Base.test.Log(LogStatus.Info, "Added Language successfully");

            //-----------------------------------------------------------
            //Click on Add New Skill Button
            SkillTab.Click();
            AddNewSkillBtn.Click();
            //Enter the skill
            AddSkillText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));

            //Click the skill dropdown
            ChooseSkilllevel.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "SkillsLevel"));
            Thread.Sleep(500);
            //ChooseSkilllevel.Click();
            AddSkill.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Skills successfully");

            //---------------------------------------------------------
            //Add Education
            EducationTab.Click();
            AddNewEducation.Click();
            //Enter the University
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose Country
            ChooseCountry.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Country"));
            Thread.Sleep(500);


            //Choose Title
            ChooseTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            Thread.Sleep(500);


            //Enter Degree
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Year of Graduation
            DegreeYear.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "GraduateYear"));
            Thread.Sleep(500);

            AddEdu.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Education successfully");

            //-------------------------------------------------
            //Click on Certificate tab
            CertiTab.Click();

            //Click on add new
            AddNewCertibtn.Click();

            //Enter Certificate Name
            CertiName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certificate"));

            //Enter Certified from
            CertiFrom.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertifiedFrom"));

            //Enter the Year
            CertiYear.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CerYear"));;
            Thread.Sleep(500);

            //Click Add new
            AddCerti.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Certificate successfully");

            //-------------------------------------------------------------------------------
            //Add Description ICON
            DescrIco.Click();

            //Enter description
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            Thread.Sleep(500);

            //Click on Save
            Save.Click();
            Base.test.Log(LogStatus.Info, "Added Description successfully");
        }
        internal void EditProfile()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            Thread.Sleep(1000);

            //Click on Edit button
            ProfileEdit.Click();

            //Availability Time option
            Thread.Sleep(1500);
            Actions action = new Actions(GlobalDefinitions.driver);

            action.MoveToElement(AvailabilityTime).Build().Perform();
            Thread.Sleep(1000);
            IList <IWebElement> AvailableTime = AvailabilityTimeOpt.FindElements(By.TagName("div"));
            int count = AvailableTime.Count;

            for (int i = 0; i < count; i++)
            {
                if (AvailableTime[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"))
                {
                    AvailableTime[i].Click();
                    Base.test.Log(LogStatus.Info, "Select the available time");
                }
            }

            //Availability Hours
            AvailabilityHours.Click();
            //Availability Hours option
            AvailabilityHours.SendKeys(Keys.ArrowDown);
            AvailabilityHours.SendKeys(Keys.Enter);

            //Salary
            Salary.Click();
            //Choose the option from salary dropdown
            Salary.SendKeys(Keys.ArrowDown);
            Thread.Sleep(500);
            Salary.SendKeys(Keys.Enter);

            //Choose Location
            Thread.Sleep(1000);
            action.MoveToElement(Location).Build().Perform();
            Thread.Sleep(1000);
            IList <IWebElement> LocCountry = LocationOpt.FindElements(By.TagName("div"));
            int countrycount = LocCountry.Count;

            for (int i = 0; i < countrycount; i++)
            {
                if (LocCountry[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Country"))
                {
                    LocCountry[i].Click();
                    Base.test.Log(LogStatus.Info, "Selected Country");
                }
            }

            //Choose City
            Thread.Sleep(1000);
            action.MoveToElement(City).Build().Perform();
            Thread.Sleep(1000);
            IList <IWebElement> LocCity = CityOpt.FindElements(By.TagName("div"));
            int citycount = LocCity.Count;

            for (int i = 0; i < citycount; i++)
            {
                if (LocCity[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "City"))
                {
                    LocCity[i].Click();
                    Base.test.Log(LogStatus.Info, "Selected City");
                }
            }


            //---------------------------------------------------------
            //Click on Add New Language button
            AddNewLangBtn.Click();
            Thread.Sleep(1000);
            //Enter the Language
            AddLangText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            //Choose Lang
            ChooseLang.Click();
            Thread.Sleep(1000);
            ChooseLangOpt.Click();
            Thread.Sleep(500);
            AddLang.Click();
            Base.test.Log(LogStatus.Info, "Added Language successfully");

            //-----------------------------------------------------------
            //Click on Add New Skill Button
            AddNewSkillBtn.Click();
            //Enter the skill
            AddSkillText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));

            //Click the skill dropdown
            ChooseSkill.Click();
            Thread.Sleep(500);
            ChooseSkilllevel.Click();
            AddSkill.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Skills successfully");

            //---------------------------------------------------------
            //Add Education
            AddNewEducation.Click();
            //Enter the University
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose Country
            ChooseCountry.Click();
            Thread.Sleep(500);
            //Choose Country Level
            ChooseCountryOpt.Click();

            //Choose Title
            ChooseTitle.Click();
            Thread.Sleep(500);
            ChooseTitleOpt.Click();

            //Enter Degree
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Year of Graduation
            DegreeYear.Click();
            Thread.Sleep(500);
            DegreeYearOpt.Click();
            AddEdu.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Education successfully");

            //-------------------------------------------------
            //Add new Certificate
            AddNewCerti.Click();

            //Enter Certificate Name
            EnterCerti.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certificate"));

            //Enter Certified from
            CertiFrom.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertifiedFrom"));

            //Enter the Year
            CertiYear.Click();
            Thread.Sleep(500);
            CertiYearOpt.Click();
            AddCerti.Click();
            Thread.Sleep(500);
            Base.test.Log(LogStatus.Info, "Added Certificate successfully");

            //-----------------------------------------------------
            //Add Description
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            Thread.Sleep(500);
            Save.Click();
            Base.test.Log(LogStatus.Info, "Added Description successfully");
        }
        internal void EditProfile()
        {
            //Global.GlobalDefinitions.wait(20000);
            //Populate the Excel Sheet
            //GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");


            //Click on Edit button
            AvailabilityTimeEdit.Click();
            //Select
            AvailabilityTime.Click();
            //Availability option Full Time
            AvailabilityTimeOpt.Click();
            CommonMethods.test.Log(LogStatus.Info, "Availability updated");
            Console.WriteLine("Availability updated");



            /* // Actions action = new Actions(GlobalDefinitions.driver);
             * // action.MoveToElement(AvailabilityTime).Build().Perform();
             * Thread.Sleep(1000);
             * //IList<IWebElement> AvailableTime = AvailabilityTimeOpt.FindElements(By.TagName("div"));
             * IList<IWebElement> AvailableTime = GlobalDefinitions.driver.FindElements(By.XPath("//select[@name='availabiltyType']/option"));
             * int count = AvailableTime.Count;
             * for (int i = 0; i < count; i++)
             * {
             *    if (AvailableTime[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"))
             *    {
             *        AvailableTime[i].Click();
             *        CommonMethods.test.Log(LogStatus.Info, "Select the available time");
             *        Console.WriteLine(AvailableTime[i].Text);
             *        Console.WriteLine(count);
             *
             *    }
             * }*/
            Thread.Sleep(2000);
            //Availability Edit
            AvailabilityHoursEdit.Click();
            // Availability Hours option
            AvailabilityHoursDropDown.Click();
            //AvailabilityHours ASNeeded
            AvailabilityHours.Click();
            CommonMethods.test.Log(LogStatus.Info, "Hours updated");
            Console.WriteLine("Hours updated");

            //Salary
            SalaryEdit.Click();
            //Choose the option from salary dropdown
            SalaryDropdown.Click();
            //SalaryOpt-More than 1000 per month
            SalaryOpt.Click();
            CommonMethods.test.Log(LogStatus.Info, "Earn Target updated");
            Console.WriteLine("Earn Target updated");



            //---------------------------------------------------------
            //Click on Add New Language button
            AddNewLangBtn.Click();

            //Enter the Language
            //AddLangText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            //Choose Lang
            ChooseLang.Click();

            ChooseLangOpt.Click();

            AddLang.Click();
            CommonMethods.test.Log(LogStatus.Info, "Added Language successfully");
            Console.WriteLine("Added Language successfully");

            //-----------------------------------------------------------

            //Click on Skill Button
            SkillBtn.Click();

            //Click on Add New Skill Button
            AddNewSkillBtn.Click();

            //Enter the skill
            //AddSkillText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));

            //Click the skill dropdown
            ChooseSkill.Click();

            ChooseSkilllevel.Click();

            AddSkill.Click();

            CommonMethods.test.Log(LogStatus.Info, "Added Skills successfully");
            Console.WriteLine("Added Skills successfully");
            //---------------------------------------------------------
            //Click on Education Tab
            EduBtn.Click();
            //Add Education
            AddNewEducation.Click();
            //Enter the University
            //EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose Country
            ChooseCountry.Click();

            //Choose Country Level
            ChooseCountryOpt.Click();

            //Choose Title
            ChooseTitle.Click();

            ChooseTitleOpt.Click();

            //Enter Degree
            //Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Year of Graduation
            DegreeYear.Click();

            DegreeYearOpt.Click();
            AddEdu.Click();

            CommonMethods.test.Log(LogStatus.Info, "Added Education successfully");
            Console.WriteLine("Added Education successfully");

            //-------------------------------------------------
            //Click on Certificates Tab
            CertiBtn.Click();
            //Add new Certificate
            AddNewCerti.Click();

            //Enter Certificate Name
            //EnterCerti.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certificate"));

            //Enter Certified from
            //CertiFrom.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertifiedFrom"));

            //Enter the Year
            CertiYear.Click();

            CertiYearOpt.Click();
            AddCerti.Click();

            CommonMethods.test.Log(LogStatus.Info, "Added Certificate successfully");
            Console.WriteLine("Added Certificate successfully");

            //-----------------------------------------------------
        }
        internal void EditProfile()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "Profile");

            GlobalDefinitions.wait(60);

            //builder.MoveToElement(HoursEdit).Build().Perform();
            AvailabilityEdit.Click();
            HoursEdit.Click();
            EarnTargetEdit.Click();

            AvailabilityDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"));
            HoursDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Hours"));
            EarnTargetDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EarnTarget"));


            //---------------------------------------------------------
            #region Languages
            //Click on Add New Language button
            AddNewLangBtn.Click();

            GlobalDefinitions.wait(20);

            //Enter the Language
            AddLangText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            //Choose Language Level
            ChooseLang.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "LanguageLevel"));
            ChooseLang.Click();

            AddLang.Click();

            GlobalDefinitions.wait(10);

            Base.test.Log(LogStatus.Info, "Added Language successfully");

            #endregion
            //-----------------------------------------------------------
            #region Skills

            //Click on Skill Tab
            SkillTab.Click();

            //Click on Add New Skill Button
            AddNewSkillBtn.Click();

            GlobalDefinitions.wait(20);

            //Enter the skill
            AddSkillText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));

            //Click the skill dropdown
            ChooseSkill.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "SkillLevel"));
            ChooseSkill.Click();

            //Click Add button
            AddSkill.Click();

            GlobalDefinitions.wait(10);

            Base.test.Log(LogStatus.Info, "Added Skills successfully");

            #endregion
            //---------------------------------------------------------
            #region Education

            //EducationTab
            Educationtab.Click();

            //Add Education
            AddNewEducation.Click();

            GlobalDefinitions.wait(20);

            //Enter the University
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

            //Choose Country
            ChooseCountry.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Country"));
            ChooseCountry.Click();

            GlobalDefinitions.wait(10);

            //Choose Title
            ChooseTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            ChooseTitle.Click();

            GlobalDefinitions.wait(10);

            //Enter Degree
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

            //Year of Graduation
            DegreeYear.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "GraduationYear"));
            DegreeYear.Click();

            GlobalDefinitions.wait(10);

            //Click Add Button
            AddEdu.Click();

            GlobalDefinitions.wait(10);

            Base.test.Log(LogStatus.Info, "Added Education successfully");

            #endregion
            //-------------------------------------------------
            #region Certification

            //CertificationTab
            CertificationTab.Click();

            //Add new Certificate
            AddNewCerti.Click();

            //Enter Certificate Name
            EnterCerti.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certification"));

            //Enter Certified from
            CertiFrom.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certified From"));

            //Enter the Year
            CertiYear.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertYear"));
            CertiYear.Click();

            GlobalDefinitions.wait(10);

            AddCerti.Click();

            GlobalDefinitions.wait(10);

            Base.test.Log(LogStatus.Info, "Added Certificate successfully");

            #endregion
            //-----------------------------------------------------
            #region Description

            //Add Description
            DescriptionEdit.Click();

            GlobalDefinitions.wait(100);

            DescriptionWrite.Click();

            GlobalDefinitions.wait(120);

            DescriptionWrite.Clear();

            GlobalDefinitions.wait(60);

            DescriptionWrite.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            GlobalDefinitions.wait(30);

            Save.Click();

            Base.test.Log(LogStatus.Info, "Added Description successfully");

            #endregion
        }
Beispiel #8
0
        //Enter Profile detail
        internal void AddProfile()
        {
            // Populate the data in excel
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");

            #region profile details
            try
            {
                // click on availability edit
                //Thread.Sleep(1000);
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[2]/div/div/div/div/div/div[3]/div/div[2]/div/span/i", 10000);
                AvailabilityTimeEdit.Click();

                // Click on dropdown menu
                AvailabilityTime.Click();
                //Thread.Sleep(1000);
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "availabiltyType", 10000);
                //select availability time
                new SelectElement(AvailabilityTime).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "AvailableTime"));
                Base.test.Log(LogStatus.Info, "Select the available time");
            }

            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter Availability Type", ex.Message);
            }
            try
            {
                //Click on hours edit
                HourEdit.Click();

                //click on dropdownmenu
                AvailabilityHour.Click();

                //choose from dropdown hours
                Thread.Sleep(1000);
                new SelectElement(AvailabilityHour).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Hours"));
                Base.test.Log(LogStatus.Info, "Select the available time");
            }

            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter Availability Hours", ex.Message);
            }

            try
            {
                //click on Target edit
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[2]/div/div/div/div/div/div[3]/div/div[4]/div/span/i", 10000);
                SalaryEdit.Click();

                //click on Target salary dropdown
                SalarySelect.Click();

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "availabiltyTarget", 10000);
                //select salary
                new SelectElement(SalarySelect).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "EarnTarget"));
                Base.test.Log(LogStatus.Info, "Added Target successfully");
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter Earn Target", ex.Message);
            }
            //Click on location
            // Location.Click();
            #endregion

            #region AddLanguage

            try
            {
                //Click on language add new
                LangBtn.Click();
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/thead/tr/th[3]/div", 10000);
                AddNewLangBtn.Click();

                //Add new language
                AddLangText.Click();
                ChooseLang.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

                //Select language level
                ChooseLevel.Click();
                new SelectElement(ChooseLevel).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "LanguageLevel"));

                //Add Language
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='Add']", 10000);
                AddLang.Click();
                Base.test.Log(LogStatus.Info, "Added Language successfully");
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter/add Language", ex.Message);
            }
            #endregion

            #region AddSkills
            try
            {
                //Click on skill
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[2]", 10000);
                SkillBtn.Click();

                //Click on add new skill
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[3]/div/div[2]/div/table/thead/tr/th[3]/div", 10000);
                AddNewSkillBtn.Click();

                //Add new skill

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "name", 10000);
                AddSkillBox.Click();
                AddSkill.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));

                //Add skill level
                AddSkillLevel.Click();
                new SelectElement(AddSkillLevel).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SkillLevel"));

                //Click on add skill
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='Add']", 10000);
                AddSkillBtn.Click();
                Base.test.Log(LogStatus.Info, "Added skill successfully");
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter/add Skills", ex.Message);
            }
            #endregion
            #region Add Education
            try
            {
                //Click on Education button
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[3]", 10000);
                EducationBtn.Click();

                //Click on add new education
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[4]/div/div[2]/div/table/thead/tr/th[6]/div", 10000);
                AddNewEducationBtn.Click();

                //Choose country
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "country", 10000);
                SelectCountry.Click();
                new SelectElement(SelectCountry).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Country"));

                //Choose title
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "title", 10000);
                SelectTitle.Click();
                new SelectElement(SelectTitle).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

                //Choose year
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "yearOfGraduation", 10000);
                YearOfGraduation.Click();
                new SelectElement(YearOfGraduation).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "YearOfGraduation"));

                //Choose institute name
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "instituteName", 10000);
                InstitName.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));

                //Choose degree
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "degree", 10000);
                Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));

                //Click on add education
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='Add']", 10000);
                AddEdu.Click();
                Base.test.Log(LogStatus.Info, "Added Education successfully");
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter/add Education", ex.Message);
            }
            # endregion

            #region AddCertification
            try
            {
Beispiel #9
0
        internal void AddEducationAndCertification()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            Thread.Sleep(1000);

            //---------------------------------------------------------
            //Click on Education Tab
            EducationTab.Click();
            //Add Education
            AddNewEducation.Click();
            //Enter the University
            EnterUniversity.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "University"));
            Assert.That(EnterUniversity != null);

            //Select Country
            ChooseCountry.Click();
            //Choose Country Level
            ChooseCountry.SendKeys("India");
            //Select Title
            ChooseTitle.Click();
            //Choose Title
            ChooseTitle.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            //Enter Degree
            Degree.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Degree"));
            Assert.That(Degree != null);
            try
            {
                var Title  = GlobalDefinitions.driver.FindElement(By.XPath("(//TD[text()='B.A'])[1]")).Text;
                var Degree = GlobalDefinitions.driver.FindElement(By.XPath("(//TD[text()='B.Tech'])[2]")).Text;

                if (Title == "B.A" && Degree == "B.Tech")
                {
                    // Base.test.Log(LogStatus.Info, "Language is already Exist!");
                    Assert.Fail("Education Information is already Exist!");
                }
            }
            catch (Exception)
            {
                Base.test.Log(LogStatus.Info, "Can not find Information ");
            }
            //Year of Graduation
            DegreeYear.Click();
            DegreeYear.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            //Click on Add Button in Education Tab
            AddEdu.Click();
            Base.test.Log(LogStatus.Info, "Added Education successfully");

            //-------------------------------------------------
            //Click on Certificate tab
            CertificateTab.Click();
            //Add new Certificate
            AddNewCerti.Click();
            //Enter Certificate Name
            EnterCerti.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Certificate"));
            Assert.That(EnterCerti != null);
            try
            {
                var Certi = GlobalDefinitions.driver.FindElement(By.XPath("//TD[text()='ISTQB1']")).Text;
                if (Certi == "ISTQB1")
                {
                    // Base.test.Log(LogStatus.Info, "Language is already Exist!");
                    Assert.Fail("Certificate is already Exist!");
                }
            }
            catch (Exception)
            {
                Base.test.Log(LogStatus.Info, "Can not find the Certificate ");
            }
            //Enter Certified from
            CertiForm.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CertifiedForm"));
            Assert.That(CertiForm != null);

            //Enter the Year
            CertiYear.Click();
            CertiYear.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            //Click on Add Button in Certification Tab
            AddCerti.Click();
            Base.test.Log(LogStatus.Info, "Added Certificate successfully");
        }