internal void DeleteSkill() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile"); // Refresh the page GlobalDefinitions.driver.Navigate().Refresh(); //Delete Skill 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 skill to be deleted 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/tbody[last()]/tr/td[1]", 10000); SkillToSel.Click(); //Click on Delete 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/tbody[last()]/tr/td[3]/span[2]/i", 20000); DeleteSkillBtn.Click(); Base.test.Log(LogStatus.Pass, "Skill deleted successfully"); } catch (Exception ex) { Assert.Fail("Test failed to Delete Skill", ex.Message); Base.test.Log(LogStatus.Fail, "Skill is deleted successfully"); } }
internal void EditSkills() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile"); // Refresh the page GlobalDefinitions.driver.Navigate().Refresh(); //Click on skill //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 skill to be edited 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/tbody[last()]/tr/td[1]", 10000); SkillToSel.Click(); //Click on Edit 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/tbody[last()]/tr/td[3]/span[1]/i", 10000); EditSkill.Click(); //Edit the skill //Add skill level GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "level", 10000); AddSkillLevel.Click(); new SelectElement(AddSkillLevel).SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "SkillLevel")); //Click on update 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/tbody[1]/tr/td/div/span/input[1]", 10000); UpdateSkillBtn.Click(); Base.test.Log(LogStatus.Info, "Skill edited successfully"); }