Instantly share code, notes, and snippets.
Created
September 1, 2016 21:18
Star
You must be signed in to star a gist
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
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