Skip to content

Instantly share code, notes, and snippets.

@testautomationtribe
Created November 16, 2017 06:26
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/b27ea7519da79985f83d803ad3d87976 to your computer and use it in GitHub Desktop.
Save testautomationtribe/b27ea7519da79985f83d803ad3d87976 to your computer and use it in GitHub Desktop.
dash board page object
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace TatAuto.Pages
{
public class DashboardPObject
{
[FindsBy(How = How.CssSelector, Using = "#wp-admin-bar-my-account .ab-item")]
protected IWebElement UserNameTxt { get; set; }
private IWebDriver _driver;
public DashboardPObject(IWebDriver driver)
{
_driver = driver;
PageFactory.InitElements(_driver, this);
}
/// <summary>
/// Get Displayed User Name
/// </summary>
/// <returns></returns>
public string GetUser()
{
return UserNameTxt.Text;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment