Ejemplo n.º 1
0
        public static void ScrollToRight(string columnNo)
        {
            List <IWebElement> editableCells = EditMarksGridHelper.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);
            }
            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();
                }
            }
        }