public void AddArticle() { // Get value from excel var talentOnboardingAddArticle = talentOnboarding.GetRowByKey("create"); // Declare the article details in Excel articleName = talentOnboardingAddArticle.GetValue("Name"); articleDescription = talentOnboardingAddArticle.GetValue("Description"); articleDefaultPoint = talentOnboardingAddArticle.GetValue("DefaultPoints"); articleType = talentOnboardingAddArticle.GetValue("LibraryType"); tags = talentOnboardingAddArticle.GetValue("Tag"); article = talentOnboardingAddArticle.GetValue("Article"); // Click on New Article Button Driver.WaitForClickable(By.ClassName("ant-btn-primary")); NewArticleBtn.Click(); // Input Article details from Excel TypeName.WaitForClickable(Driver); TypeName.EnterText(articleName); TypeDescription.WaitForClickable(Driver); TypeDescription.EnterText(articleDescription); TypeDefaultPoint.WaitForClickable(Driver); TypeDefaultPoint.EnterText(articleDefaultPoint); ChooseLibraryType.WaitForClickable(Driver); ChooseLibraryType.Click(); Driver.FindElement(By.XPath("//*[text()='" + articleType + "']")).WaitForClickable(Driver); Driver.FindElement(By.XPath("//*[text()='" + articleType + "']")).Click(); EnterTags(); TypeArticle.SendKeys(Keys.PageDown); TypeArticle.WaitForClickable(Driver); TypeArticle.EnterText(article); // Click on Publish PublishBtn.Click(); }
public void TemplateNameAndDescription() { try { TemplateName.WaitForClickable(Driver); TemplateName.SendKeys(CreateArticle.GetRowByKey("valid").GetValue("templateName")); Description.SendKeys(CreateArticle.GetRowByKey("valid").GetValue("description")); } catch (Exception e) { throw; } }