예제 #1
0
        //add Earn Target
        internal string AddEarnTarget(string addEarnTarget)
        {
            ExtentionHelpers.TurnOnWait(driver);

            if (addEarnTarget.ToLower() == "Less than $500 per month")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class = 'extra content']/div/div[4]/div/span/select"))).SelectByIndex(0);

                Console.WriteLine("earn target added");
            }
            else if (addEarnTarget.ToLower() == "between $500 And $1000 per month")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class = 'extra content']/div/div[4]/div/span/select"))).SelectByIndex(1);
                Console.WriteLine("earn target added");
            }
            else if (addEarnTarget.ToLower() == "more than 1000 per month")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class = 'extra content']/div/div[4]/div/span/select"))).SelectByIndex(2);
                Console.WriteLine("earn target added");
            }



            return(ReadMessage());
        }
예제 #2
0
        // Search Share Skills
        public void SearchSkills()
        {
            //click on search button
            driver.FindElement(By.XPath("(//i[@class='search link icon'])[1]")).Click();

            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #3
0
        //Delete Record
        public void RemoveManageListing()
        {
            ExtentionHelpers.TurnOnWait(driver);
            //Click on yes button
            clickYes.Click();



            // Driver.waitElement(@"//div[@class='ns-box-inner']");
            Thread.Sleep(3000);
            //Get the message of pop up
            var message = driver.FindElement(By.XPath(@"//div[@class='ns-box-inner']")).Text;

            // Explicit Wait
            // ExtentionHelpers.WaitforElementDisplayed(@"//div[@class='ns-box-inner']");

            //print message on Console
            Console.WriteLine(message);

            //  Assert.That(driver.PageSource.Contains("Selenium has been deleted"),Is.EqualTo(true), "Selenium has not been deleted");

            //Validate if expected message is equal to actual
            Assert.That(message, Is.EqualTo("Selenium has been deleted"));

            SaveScreenShotClass save = new SaveScreenShotClass();
            string img = save.SaveScreenshot(driver, "ServiceDeleted");
        }
예제 #4
0
        //Delete Education
        internal void DeleteEduation()
        {
            ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");
            String expectedValue = ExcelLibHelper.ReadData(2, "Title");

            //Get the list
            IList <IWebElement> Trows = driver.FindElements(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody/tr"));

            //Get the row
            var rows = Trows.Count;

            for (int i = 1; i <= rows; i++)
            {
                //Get the xpath of ith row
                String actualValue = driver.FindElement(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[3]")).Text;

                //validation if actual equal to expected
                if (actualValue == expectedValue)
                {
                    // Click on the  delete button
                    driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[6]/span[2]/i")).Click();
                }
            }
            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #5
0
        //Add Education
        internal void AddEducation1()
        {
            Console.WriteLine("****************************************************************************");
            ExtentionHelpers.TurnOnWait(driver);

            AddNewEducation.Click();

            //adding text in institute name
            InstituteText.SendKeys(ExcelLibHelper.ReadData(3, "University"));

            // select dropdown
            selectdropdown1("country", ExcelLibHelper.ReadData(2, "Country"));
            selectdropdown1("title", ExcelLibHelper.ReadData(2, "Title"));
            selectdropdown1("yearOfGraduation", ExcelLibHelper.ReadData(3, "Year"));

            //enter degree
            DegreeText.SendKeys(ExcelLibHelper.ReadData(3, "Degree"));

            ExtentionHelpers.TurnOnWait(driver);

            // add education
            AddEducation.Click();

            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #6
0
        //update education
        internal void UpdateEducation()
        {
            Console.WriteLine("****************************************************************************");
            ExtentionHelpers.TurnOnWait(driver);


            ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");
            String ExpectedValue = ExcelLibHelper.ReadData(2, "Country");

            //Get the table list
            IList <IWebElement> TRows = driver.FindElements(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody/tr"));


            //Get the row counts
            var rows = TRows.Count;

            for (int i = 1; i <= rows; i++)
            {
                ExtentionHelpers.TurnOnWait(driver);

                //get xpath
                String ActualValue = driver.FindElement(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;

                //check value

                if (ActualValue.Equals(ExpectedValue))
                {
                    //CliCk on update pen icon
                    driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[6]/span[1]/i")).Click();

                    //update uni
                    IWebElement editRowValue = driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div/div[1]/input"));

                    editRowValue.Clear();
                    editRowValue.SendKeys(ExcelLibHelper.ReadData(2, "University"));

                    // update Country of College
                    new SelectElement(driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div[1]/div[2]/select"))).SelectByValue(ExcelLibHelper.ReadData(2, "Country"));


                    // update Title
                    new SelectElement(driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div[2]/div[1]/select"))).SelectByValue(ExcelLibHelper.ReadData(2, "Title"));

                    //update the Degree
                    IWebElement EditDegree = driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div[2]/div[2]/input"));

                    EditDegree.Clear();
                    EditDegree.SendKeys(ExcelLibHelper.ReadData(2, "Degree"));

                    //update the Year
                    new SelectElement(driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div[2]/div[3]/select"))).SelectByValue(ExcelLibHelper.ReadData(2, "Year"));

                    // Click on update button
                    driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td/div[3]/input[1]")).Click();


                    Console.WriteLine("updated");
                }
            }
        }
예제 #7
0
        //Validate Updation
        internal void Updatevalidate()
        {
            try
            {
                //title text
                String expectedValue = ExcelLibHelper.ReadData(2, "Title");

                //Get the table list
                IList <IWebElement> TableRows = driver.FindElements(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody/tr"));

                //Get the row
                var Rows = TableRows.Count;

                //Iteration
                for (var j = 1; j <= Rows; j++)
                {
                    string actualValue = driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + j + "]/tr/td[3]")).Text;

                    //Check if expected value is equal to actual value
                    if (expectedValue == actualValue)
                    {
                        SaveScreenShotClass save = new SaveScreenShotClass();
                        string img = save.SaveScreenshot(driver, "this");


                        Console.WriteLine(" Education updated");
                    }
                }
            }
            catch (Exception)
            {
                Assert.Fail();
            }
            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #8
0
        //Delete a given language
        internal void DeleteLanguage()
        {
            ExtentionHelpers.TurnOnWait(driver);

            //populate from excel data
            ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");

            //expected value of language
            String expectedValue1 = ExcelLibHelper.ReadData(4, "Language");

            //Get the table row list
            IList <IWebElement> Tablerows = driver.FindElements(By.XPath("//form/div[2]/div/div[2]/div/table/tbody/tr"));

            //Count how many rows
            var rowCount = Tablerows.Count;

            for (int i = 1; i <= rowCount; i++)
            {
                ExtentionHelpers.TurnOnWait(driver);
                //xpath of ith languagename(row)
                String actualValue = driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td[1]")).Text;
                if (expectedValue1 == actualValue)
                {
                    //click on delete icon
                    driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td[3]/span[2]/i")).Click();

                    Console.WriteLine("Language deleted");
                }
                break;
            }
        }
예제 #9
0
        //Add Skills
        internal void AddSkills1()
        {
            Console.WriteLine("*************************************************************");
            //click on skill
            // SkillsButton.Click();

            ExtentionHelpers.TurnOnWait(driver);


            //click on add new button
            AddNewSkills.Click();

            ExtentionHelpers.TurnOnWait(driver);

            //Driver.waitElementIsVisible("//input[contains(@placeholder,'Add Skill')]");
            //add value in skill text
            SkillsText.SendKeys(ExcelLibHelper.ReadData(2, "Skills"));


            //Skill level
            new SelectElement(driver.FindElement(By.XPath("//select[@class='ui fluid dropdown']"))).SelectByText(ExcelLibHelper.ReadData(2, "SkillLevel"));;

            //click on add button
            AddSkill.Click();

            ExtentionHelpers.TurnOnWait(driver);
            var actualskillMessage = driver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]"));

            driver.FindElement(By.XPath("//a[contains(@class,'ns-close')]"));

            Console.WriteLine(actualskillMessage.Text);
            Console.WriteLine("skill added");
            Console.WriteLine("*******************************************");
        }
예제 #10
0
        //Add new Lanuguage
        internal void Addlanguage()
        {
            Console.WriteLine("******************************");

            //implicit wait
            ExtentionHelpers.TurnOnWait(driver);

            //click on add new button
            AddNewLanguage.Click();

            ExtentionHelpers.TurnOnWait(driver);
            //enter text in language field
            LanguageText.SendKeys(ExcelLibHelper.ReadData(3, "Language"));

            //select level from drop down

            new SelectElement(driver.FindElement(By.XPath("//select[@class='ui dropdown']"))).SelectByValue(ExcelLibHelper.ReadData(2, "LanguageLevel"));

            ExtentionHelpers.TurnOnWait(driver);

            //click on add button
            AddLanguage.Click();

            ExtentionHelpers.TurnOnWait(driver);

            Console.WriteLine("Language added");
            Console.WriteLine("******************************");
        }
        internal void ValidateAddcertifications()
        {
            //Validate the certification is added sucessfully
            try
            {
                ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");
                String expectedValue = ExcelLibHelper.ReadData(3, "Certificate");

                //Get the table list
                IList <IWebElement> Trows = driver.FindElements(By.XPath("//form/div[5]/div[1]/div[2]/div/table/tbody/tr"));

                //Get the row count in table
                var rows = Trows.Count;
                for (var i = 1; i <= rows; i++)
                {
                    ExtentionHelpers.TurnOnWait(driver);
                    string actualValue = driver.FindElement(By.XPath("//form/div[5]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;

                    //Check if expected value is equal to actual value
                    if (expectedValue == actualValue)
                    {
                        SaveScreenShotClass save = new SaveScreenShotClass();
                        string img = save.SaveScreenshot(driver, "certification added");
                    }
                }
            }
            catch (Exception)
            {
                Assert.Fail();
            }
            ExtentionHelpers.TurnOnWait(driver);
        }
        //update operation performs on Certification field
        internal void UpdateCertification()
        {
            ExtentionHelpers.TurnOnWait(driver);

            //click the pen icon to edit
            CerficationUpdate.Click();

            ExtentionHelpers.TurnOnWait(driver);

            // clear text and enter value
            CertificationText.Clear();
            CertificationText.SendKeys(ExcelLibHelper.ReadData(4, "Certificate"));

            CertifiedFromText.Clear();
            CertifiedFromText.SendKeys(ExcelLibHelper.ReadData(4, "Certified from"));

            selectdropdown1("certificationYear", ExcelLibHelper.ReadData(4, "CertificationYear"));

            //click on update button
            UpdateButton.Click();

            ExtentionHelpers.TurnOnWait(driver);

            Console.WriteLine(driver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]")).Text);

            driver.FindElement(By.XPath("//a[contains(@class,'ns-close')]"));

            Console.WriteLine("*******************************");
        }
예제 #13
0
        internal void ValidateSearchSkill()
        {
            ExtentionHelpers.TurnOnWait(driver);

            Assert.IsNotNull(searchResult);
            SaveScreenShotClass save = new SaveScreenShotClass();
            string img = save.SaveScreenshot(driver, "validate search skill");
        }
예제 #14
0
        public void GivenClickOnChangePasswordButton()
        {
            //Thread.Sleep(2000);
            // Navigate to change password page
            ExtentionHelpers.TurnOnWait(driver);
            driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/div[1]/div[2]/div/span")).Click();

            Thread.Sleep(2000);
            IWebElement changepwd = driver.FindElement(By.XPath("//a[text()='Change Password']"));

            changepwd.Click();
        }
예제 #15
0
        //Update skill
        internal void UpdateSkill()
        {
            //click on skill
            // SkillsButton.Click();

            for (int i = 1; i <= 5; i++)

            {
                ExtentionHelpers.TurnOnWait(driver);

                //get text of language
                var skilltext = driver.FindElement(By.XPath("//div[3]/div/div[2]/div/table/tbody[" + i + "]/tr/td[1]")).Text;

                ExtentionHelpers.TurnOnWait(driver);

                ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");

                if (skilltext == ExcelLibHelper.ReadData(2, "Skills"))


                {
                    ExtentionHelpers.TurnOnWait(driver);

                    //click on pen icon update
                    driver.FindElement(By.XPath("//div[@data-tab='second']/div/div[2]/div/table/tbody[" + i + "]/tr/td[3]/span[1]")).Click();

                    //get language text box
                    IWebElement skilledittext1 = driver.FindElement(By.XPath("//div/table/tbody[" + i + "]/tr/td/div/div[1]/input"));

                    skilledittext1.Clear();

                    //enter language
                    skilledittext1.SendKeys(ExcelLibHelper.ReadData(3, "Skills"));

                    //Enter language level
                    SelectElement select = new SelectElement(driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + i + "]/tr/td/div/div[2]/select")));
                    select.SelectByValue(ExcelLibHelper.ReadData(3, "SkillLevel"));

                    //click on update
                    driver.FindElement(By.XPath("//div[@data-tab = 'second']/div/div[2]/div/table/tbody[" + i + "]/tr/td/div/span/input[1]")).Click();

                    Console.WriteLine("Skill updated");


                    break;
                }
            }
        }
예제 #16
0
        internal void changePassword(string Oldpassword, string Newpaasword)
        {
            ExtentionHelpers.TurnOnWait(driver);

            oldpassword.SendKeys(Oldpassword);

            newpassword.SendKeys(Newpaasword);

            ExtentionHelpers.TurnOnWait(driver);

            confirmpassword.SendKeys(Newpaasword);

            // click on save button

            savebutton.Click();
            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #17
0
        //Validate new Language
        internal void ValidateAddLanguage()
        {
            Console.WriteLine("******************************");
            try
            {
                //Start the Reports
                // test = extent.CreateTest("Add Language");
                // test.Log(Status.Info, "Add new language");

                //language test
                driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);

                //click on language button
                // LanguageButton.Click();

                //text lang
                String Lang = driver.FindElement(By.XPath("(//div[@data-tab='first']//table//tbody//tr[1]//td[1])[1]")).Text;

                ExtentionHelpers.TurnOnWait(driver);

                //text level
                String level = driver.FindElement(By.XPath("(//div[@data-tab='first']//table//tbody//tr[1]//td[2])[1]")).Text;

                //Validation
                Assert.Multiple(() =>
                {
                    Assert.AreEqual(Lang, ExcelLibHelper.ReadData(3, "Language"));

                    Assert.AreEqual(level, ExcelLibHelper.ReadData(2, "LanguageLevel"));
                });


                SaveScreenShotClass save = new SaveScreenShotClass();
                string img = save.SaveScreenshot(driver, "AddLanguage");

                Console.WriteLine("Assertion Pass");
                Console.WriteLine("******************************");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #18
0
        //Add Availabliity
        internal string AddAvailability(string availType)
        {
            ExtentionHelpers.TurnOnWait(driver);

            if (availType.ToLower() == "part time")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class='extra content']/div/div[2]/div/span/select"))).SelectByText("Part Time");

                Console.WriteLine("added");
            }
            else if (availType.ToLower() == "full time")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class='extra content']/div/div[2]/div/span/select"))).SelectByText("Full Time");
                Console.WriteLine("added");
            }


            return(ReadMessage());
        }
예제 #19
0
        public void WhenIProvideAllTheDetails()
        {
            profile = new Profile(driver);
            profile.changePassword(ExcelLibHelper.ReadData(2, "oldPassword"), ExcelLibHelper.ReadData(2, "NewPassword"));
            Thread.Sleep(3000);


            // Navigate to change password page
            ExtentionHelpers.TurnOnWait(driver);
            driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/div[1]/div[2]/div/span")).Click();

            Thread.Sleep(1500);
            IWebElement changepwd = driver.FindElement(By.XPath("//a[text()='Change Password']"));

            //Thread.Sleep(2000);
            changepwd.Click();

            Thread.Sleep(1500);
            profile.changePassword(ExcelLibHelper.ReadData(2, "NewPassword"), ExcelLibHelper.ReadData(2, "oldPassword"));
        }
예제 #20
0
        //Validation
        public void ValidateManageListing()
        {
            try
            {
                //iterate from start record to end record on first page
                for (var i = 1; i <= 5; i++)
                {
                    //Text of Title
                    var title = driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[3]")).Text;

                    ExtentionHelpers.TurnOnWait(driver);
                    //Text of Description
                    var testdescription = driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[4]")).Text;

                    // Text of Category
                    var category = driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[2]")).Text;

                    //Check whether expected result is equal to actual result
                    Assert.Multiple(() =>
                    {
                        Assert.That(title, Is.EqualTo("Selenium"));
                        Assert.That(testdescription, Is.EqualTo("Provide Training on Selenium"));
                        Assert.That(category, Is.EqualTo("Programming & Tech"));
                    });

                    SaveScreenShotClass save = new SaveScreenShotClass();
                    string img = save.SaveScreenshot(driver, "validate service");

                    //Print message on Console
                    Console.WriteLine("Assertion Pass");

                    break;
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Test Failed");
            }
        }
예제 #21
0
        //Validate updation
        internal void ValidateUpdateSkill()
        {
            //click on skill
            SkillsButton.Click();
            try
            {
                ExtentionHelpers.TurnOnWait(driver);
                String skill = driver.FindElement(By.XPath("//div[3]/div/div[2]/div/table/tbody[1]/tr/td[1]")).Text;
                //String skill = Driver.driver.FindElement(By.XPath("(//div[@data-tab='second']//table//tbody//tr[1]//td[1])[1]")).Text;
                Assert.AreEqual(skill, "Performance");

                String skilllevel = driver.FindElement(By.XPath("(//div[@data-tab='second']//table//tbody//tr[1]//td[2])[1]")).Text;
                Assert.AreEqual(skilllevel, "Intermediate");
                ExtentionHelpers.TurnOnWait(driver);
                SaveScreenShotClass save = new SaveScreenShotClass();
                string img = save.SaveScreenshot(driver, "SkillUpdate");
            }
            catch (Exception)
            {
                Assert.Fail();
            }
            ExtentionHelpers.TurnOnWait(driver);
        }
예제 #22
0
        //Validate add
        internal void ValidateAdd()
        {
            try
            {
                ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");
                String ExpectedValue = ExcelLibHelper.ReadData(2, "Title");


                //Get the table list
                IList <IWebElement> Trows = driver.FindElements(By.XPath("//div[3]/form/div[4]/div/div[2]/div/table/tbody/tr"));

                //Get the count number of rows
                var rows = Trows.Count;
                for (var i = 1; i <= rows; i++)
                {
                    ExtentionHelpers.TurnOnWait(driver);

                    string ActualValue = driver.FindElement(By.XPath("//form/div[4]/div/div[2]/div/table/tbody[" + i + "]/tr/td[3]")).Text;

                    //Check if expected value is equal to actual value
                    if (ExpectedValue == ActualValue)
                    {
                        SaveScreenShotClass save = new SaveScreenShotClass();
                        string img = save.SaveScreenshot(driver, "this");

                        Assert.IsTrue(true);
                        Console.WriteLine("Education added");
                    }
                }
            }
            catch (Exception)
            {
                Assert.Fail();
            }

            Console.WriteLine("****************************************************************************");
        }
예제 #23
0
        //update Language
        internal void UpdateLanguage()
        {
            {
                for (int j = 1; j <= 4; j++)
                {
                    ExtentionHelpers.TurnOnWait(driver);
                    //get the value of text language
                    var languagetext = driver.FindElement(By.XPath("//div/table/tbody[" + j + "]/tr/td[1]")).Text;;


                    ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");

                    //Compare the text
                    if (languagetext == (ExcelLibHelper.ReadData(3, "Language")))
                    {
                        //Click on pen icon update
                        driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td[3]/span[1]")).Click();

                        //update language
                        IWebElement languageedit = driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div/input[1]"));
                        languageedit.Clear();

                        languageedit.SendKeys(ExcelLibHelper.ReadData(4, "Language"));

                        //update language level
                        SelectElement s = new SelectElement(driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/div[2]/select")));
                        s.SelectByText("Basic");

                        //click on update
                        driver.FindElement(By.XPath("//div[@data-tab = 'first']/div/div[2]/div/table/tbody[" + j + "]/tr/td/div/span/input[1]")).Click();

                        Console.WriteLine("Language updated");
                    }
                    break;
                }
            }
        }
        //Validate updation
        internal void ValidateUpdateCertification()
        {
            try
            {
                String expectedValue = ExcelLibHelper.ReadData(4, "Certificate");

                //Get the table list
                IList <IWebElement> Tablerows = driver.FindElements(By.XPath("//form/div[5]/div/div[2]/div/table/tbody/tr"));

                //Get the row count in table
                var row = Tablerows.Count;

                for (var j = 1; j <= row; j++)
                {
                    ExtentionHelpers.TurnOnWait(driver);
                    string actualValue = driver.FindElement(By.XPath("//form/div[5]/div/div[2]/div/table/tbody[" + j + "]/tr/td[1]")).Text;

                    ExtentionHelpers.TurnOnWait(driver);


                    //Check if expected value is equal to actual value
                    // Assert.AreEqual(expectedValue, actualValue);

                    if (expectedValue == actualValue)
                    {
                        SaveScreenShotClass save = new SaveScreenShotClass();
                        string img = save.SaveScreenshot(driver, "CertificationUpdate");
                        Assert.IsTrue(true);
                        Console.WriteLine("Assertion pass");
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #25
0
        //Validate update language

        internal void ValidateUpdateLanguage()
        {
            try
            {
                //check language
                LanguageButton.Click();

                ExtentionHelpers.TurnOnWait(driver);

                //Lanuguage text
                //String Lang = Driver.driver.FindElement(By.XPath("//a[@class='item'][contains(.,'Languages')]")).Text;
                String Lang = driver.FindElement(By.XPath("(//div[@data-tab='first']//table//tbody//tr[1]//td[1])[1]")).Text;

                //Level Text
                String level = driver.FindElement(By.XPath("(//div[@data-tab='first']//table//tbody//tr[1]//td[2])[1]")).Text;

                //Assertions
                Assert.Multiple(() =>
                {
                    ExcelLibHelper.PopulateInCollection(ConstantHelpers.TestDataPath, "FieldValues");
                    Assert.AreEqual(Lang, ExcelLibHelper.ReadData(4, "Language"));
                    Assert.AreEqual(level, "Basic");
                });


                SaveScreenShotClass save = new SaveScreenShotClass();
                string img = save.SaveScreenshot(driver, "LanguageUpdate");

                Console.WriteLine("Assertion pass");
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
        //Add Certification
        internal void AddCertification1()
        {
            Console.WriteLine("******************************");

            // CertificationsButton.Click();

            ExtentionHelpers.TurnOnWait(driver);

            //add new certification
            AddNewCertification.Click();

            ExtentionHelpers.TurnOnWait(driver);
            //add value in certificate field and certification from
            CertificationText.SendKeys(ExcelLibHelper.ReadData(3, "Certificate"));

            CertifiedFromText.SendKeys(ExcelLibHelper.ReadData(3, "Certified from"));

            //select certificate year
            selectdropdown1("certificationYear", ExcelLibHelper.ReadData(3, "CertificationYear"));

            AddCertification.Click();

            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
        }
예제 #27
0
        //Add hours
        internal string AddAvailabilityHour(string hours)
        {
            ExtentionHelpers.TurnOnWait(driver);

            if (hours.ToLower() == "less than 30hours a week")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class ='extra content']/div/div[3]/div/span/select"))).SelectByIndex(0);

                Console.WriteLine("hours added");
            }
            else if (hours.ToLower() == "more than 30hours a week")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class ='extra content']/div/div[3]/div/span/select"))).SelectByIndex(1);
            }
            else if (hours.ToLower() == "as needed")
            {
                new SelectElement(driver.FindElement(By.XPath("//div[@class ='extra content']/div/div[3]/div/span/select"))).SelectByIndex(3);

                Console.WriteLine("hour added");
            }


            return(ReadMessage());
        }
예제 #28
0
        internal void ValidateAddSkill()
        {
            //Validate the Skill is added sucessfully
            try
            {
                //skills test
                SkillsButton.Click();
                String skill = driver.FindElement(By.XPath("(//div[@data-tab='second']//table//tbody//tr[1]//td[1])[1]")).Text;
                Assert.AreEqual(skill, ExcelLibHelper.ReadData(2, "Skills"));

                //skill Level test
                String skilllevel = driver.FindElement(By.XPath("(//div[@data-tab='second']//table//tbody//tr[1]//td[2])[1]")).Text;
                Assert.AreEqual(skilllevel, ExcelLibHelper.ReadData(2, "SkillLevel"));


                SaveScreenShotClass save = new SaveScreenShotClass();
                string img = save.SaveScreenshot(driver, "SkillAdd");
            }
            catch (Exception)
            {
                Assert.Fail();
            }
            ExtentionHelpers.TurnOnWait(driver);
        }
 public void WhenIClickOnDeleteIcon()
 {
     ExtentionHelpers.TurnOnWait(driver);
     driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[8]/div/button[3]/i")).Click();
 }