Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created April 8, 2016 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/91dc6e16b1f4a459ca680237244a26a7 to your computer and use it in GitHub Desktop.
Save angelovstanton/91dc6e16b1f4a459ca680237244a26a7 to your computer and use it in GitHub Desktop.
public class GridFilterPage : IGridPage
{
public readonly string Url = @"http://demos.telerik.com/kendo-ui/grid/filter-row";
private readonly IWebDriver driver;
public GridFilterPage(IWebDriver driver)
{
this.driver = driver;
PageFactory.InitElements(driver, this);
}
public KendoGrid Grid
{
get
{
return new KendoGrid(this.driver, this.driver.FindElement(By.Id("grid")));
}
}
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/span")]
public IWebElement PagerInfoLabel { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/a[3]")]
public IWebElement GoToNextPage { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/a[1]")]
public IWebElement GoToFirstPageButton { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/a[4]/span")]
public IWebElement GoToLastPage { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/a[2]/span")]
public IWebElement GoToPreviousPage { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/ul/li[12]/a")]
public IWebElement NextMorePages { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/ul/li[2]/a")]
public IWebElement PreviousMorePages { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/ul/li[2]/a")]
public IWebElement PageOnFirstPositionButton { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/ul/li[3]/a")]
public IWebElement PageOnSecondPositionButton { get; set; }
[FindsBy(How = How.XPath, Using = "//*[@id='grid']/div[3]/ul/li[11]/a")]
public IWebElement PageOnTenthPositionButton { get; set; }
public void NavigateTo()
{
this.driver.Navigate().GoToUrl(this.Url);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment