Exemplo n.º 1
0
        /// <summary>
        /// Drag and drop the column at (sourcePosition) and move it to (targetPosition).
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ColumnPickerPartial DragAndDropColumn(int sourcePosition, int targetPosition)
        {
            WebElement source = _driver.FindElement(ByMethod.CssSelector,
                                                    ".modal-body ul[ui-sortable=sortableOptions] li:nth-child(" + sourcePosition + ") .mdi-drag-vertical");

            WebElement target = _driver.FindElement(ByMethod.CssSelector,
                                                    ".modal-body ul[ui-sortable=sortableOptions] li:nth-child(" + targetPosition + ") .mdi-drag-vertical");

            int offsetY = target.Location.Y - source.Location.Y;

            source.DragAndDropTo(_driver, 0, offsetY + 10);
            return(this);
        }