Created
November 29, 2015 11:59
-
-
Save angelovstanton/0348bae820d3a50a1ea9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KendoGrid | |
{ | |
private readonly string gridId; | |
private readonly IJavaScriptExecutor driver; | |
public KendoGrid(IWebDriver driver, IWebElement gridDiv) | |
{ | |
this.gridId = gridDiv.GetAttribute("id"); | |
this.driver = (IJavaScriptExecutor)driver; | |
} | |
public void NavigateToPage(int pageNumber) | |
{ | |
string jsToBeExecuted = this.GetGridReference(); | |
jsToBeExecuted = string.Concat(jsToBeExecuted, "grid.dataSource.page(", pageNumber, ");"); | |
this.driver.ExecuteScript(jsToBeExecuted); | |
} | |
private string GetGridReference() | |
{ | |
string initializeKendoGrid = string.Format("var grid = $('#{0}').data('kendoGrid');", this.gridId); | |
return initializeKendoGrid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment