Skip to content

Instantly share code, notes, and snippets.

@testautomationtribe
Created August 15, 2016 20: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 testautomationtribe/cd36b7fd548b6387209e0e4e35b5164c to your computer and use it in GitHub Desktop.
Save testautomationtribe/cd36b7fd548b6387209e0e4e35b5164c to your computer and use it in GitHub Desktop.
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace TatAutomationFramework.Web.Pages
{
public class MenuPObject
{
[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; }
public HomePObject NavigateToHome()
{
Home.Click();
return DoInitialize.PageElementsIn<HomePObject>();
}
public AboutPObject NavigateToAbout()
{
About.Click();
return DoInitialize.PageElementsIn<AboutPObject>();
}
public ContactUsPObject NavigateToContactUs()
{
ContactUs.Click();
return DoInitialize.PageElementsIn<ContactUsPObject>();
}
public LinksPObject NavigateToLinks()
{
Links.Click();
return DoInitialize.PageElementsIn<LinksPObject>();
}
public SamplePObject NavigateToSamplePage()
{
SamplePage.Click();
return DoInitialize.PageElementsIn<SamplePObject>();
}
public NewsPObject NavigateToNews()
{
News.Click();
return DoInitialize.PageElementsIn<NewsPObject>();
}
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