internal void SkillEdit() { // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ProfilePage"); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[@data-tab='second']")); //Click Skill tab ClickSkilltab.Click(); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//*[@data-tab='second']//table//tbody//tr//td[3]//i[@class='outline write icon'])")); //Edit Skill EditSkill.Click(); //Edit Skill AddnewSkill.Clear(); AddnewSkill.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Skill")); //Edit Level SelectElement Edit = new SelectElement(SelectSkillLevel); Edit.SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "Skill Level")); //Click update UpdateSkill.Click(); }
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"); }