Skip to content

Instantly share code, notes, and snippets.

@testautomationtribe
Created September 1, 2016 21:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save testautomationtribe/8acf7f80274e2f5a2a306f2d0007e3d2 to your computer and use it in GitHub Desktop.
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace TatAutomationFramework.Web.Pages
{
/// <summary>
/// Page Object for the Menu section
/// </summary>
public class MenuPObject
{
/// <summary>
/// Gets or sets the home.
/// </summary>
/// <value>
/// The home.
/// </value>
[FindsBy(How = How.PartialLinkText, Using = "Home")]
protected IWebElement Home { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "About")]
protected IWebElement About { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "Contact Us")]
protected IWebElement ContactUs { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "Links")]
protected IWebElement Links { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "Sample Page")]
protected IWebElement SamplePage { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "News")]
protected IWebElement News { get; set; }
[FindsBy(How = How.PartialLinkText, Using = "Support")]
protected IWebElement Support { get; set; }
/// <summary>
/// Navigates to home.
/// </summary>
/// <returns></returns>
public HomePObject NavigateToHome()
{
Home.Click();
return DoInitialize.PageElementsIn<HomePObject>();
}
/// <summary>
/// Navigates to about.
/// </summary>
/// <returns></returns>
public AboutPObject NavigateToAbout()
{
About.Click();
return DoInitialize.PageElementsIn<AboutPObject>();
}
/// <summary>
/// Navigates to contact us.
/// </summary>
/// <returns></returns>
public ContactUsPObject NavigateToContactUs()
{
ContactUs.Click();
return DoInitialize.PageElementsIn<ContactUsPObject>();
}
/// <summary>
/// Navigates to links.
/// </summary>
/// <returns></returns>
public LinksPObject NavigateToLinks()
{
Links.Click();
return DoInitialize.PageElementsIn<LinksPObject>();
}
/// <summary>
/// Navigates to sample page.
/// </summary>
/// <returns></returns>
public SamplePObject NavigateToSamplePage()
{
SamplePage.Click();
return DoInitialize.PageElementsIn<SamplePObject>();
}
/// <summary>
/// Navigates to news.
/// </summary>
/// <returns></returns>
public NewsPObject NavigateToNews()
{
News.Click();
return DoInitialize.PageElementsIn<NewsPObject>();
}
/// <summary>
/// Navigates to support.
/// </summary>
/// <returns></returns>
public SupportPObject NavigateToSupport()
{
Support.Click();
return DoInitialize.PageElementsIn<SupportPObject>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment