public ResultHistory ClearValueInCell() { WebDriverWait waiter = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(MarksheetConstants.Timeout)); waiter.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("[data-automation-id='save_button']"))); List <IWebElement> editableCells = MarksheetGridHelper.FindAllEditablecells(); Thread.Sleep(1000); editableCells.First().FindElements(By.CssSelector(MarksheetGridHelper.SelectedCellSelector)).First().Click(); GetEditor().Clear(); return(this); }
public static void ScrollToRight(string columnNo) { List <IWebElement> editableCells = MarksheetGridHelper.FindAllEditablecells(); Actions action = new Actions(WebContext.WebDriver); if (editableCells.Any(cell => cell.GetAttribute("column") == columnNo)) { editableCells.Find(cell => cell.GetAttribute("column") == columnNo).Click(); action.SendKeys(Keys.Right).Perform(); } else { string lastColNo = editableCells.LastOrDefault().GetAttribute("column"); editableCells.LastOrDefault().Click(); for (int i = Convert.ToInt16(lastColNo); i < Convert.ToInt16(columnNo); i++) { action.SendKeys(Keys.Right).Perform(); } } }