コード例 #1
0
        internal void EnterLanguage()
        {
            //Populate the excel data

            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");

            //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");
        }
コード例 #2
0
        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
        }
コード例 #3
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
            {
コード例 #4
0
        internal void AddLanguageAndSkill()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            Thread.Sleep(1000);

            //---------------------------------------------------------
            //Click on Language Tab
            LanguageTab.Click();
            //Click on Add New Language button
            AddNewLangBtn.Click();
            //Enter the Language
            AddLangText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));
            Assert.That(AddLangText != null);
            try
            {
                var Lang = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Japanese')]")).Text;
                if (Lang == "Japanese")
                {
                    // Base.test.Log(LogStatus.Info, "Language is already Exist!");
                    Assert.Fail("Language is already Exist!");
                }
            }
            catch (Exception)
            {
                Base.test.Log(LogStatus.Info, "Can not find the Language ");
            }
            //Choose LanguageLevel
            ChooseLang.Click();
            ChooseLang.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            //Click on Add Button in Language Tab
            AddLang.Click();
            Base.test.Log(LogStatus.Info, "Added Language successfully");

            //-----------------------------------------------------------
            //Click on Skill Tab
            SkillTab.Click();
            //Click on Add New Skill Button
            AddNewSkillBtn.Click();
            //Enter the skill
            AddSkillText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));
            Assert.That(AddSkillText != null);
            try
            {
                var Skill = GlobalDefinitions.driver.FindElement(By.XPath("//td[contains(text(),'Automation Testing')]")).Text;
                if (Skill == "Automation Testing")
                {
                    // Base.test.Log(LogStatus.Info, "Language is already Exist!");
                    Assert.Fail("Skill is already Exist!");
                }
            }
            catch (Exception)
            {
                Base.test.Log(LogStatus.Info, "Can not find the Language ");
            }
            //Click the skill dropdown
            ChooseSkill.Click();
            ChooseSkill.SendKeys(Keys.ArrowDown + Keys.ArrowDown + Keys.Enter);
            //Click on Add Button in Skill Tab
            AddSkill.Click();
            Base.test.Log(LogStatus.Info, "Added Skills successfully");
        }