Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created June 19, 2016 13:33
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/b3203f690e36e10c3583900b810ee3ad to your computer and use it in GitHub Desktop.
Save angelovstanton/b3203f690e36e10c3583900b810ee3ad to your computer and use it in GitHub Desktop.
public class By
{
public By(SearchType type, string value) :
this(type, value, null)
{
}
public SearchType Type { get; private set; }
public string Value { get; private set; }
public static By Id(string id)
{
return new By(SearchType.Id, id);
}
public static By InnerTextContains(string innerText)
{
return new By(SearchType.InnerTextContains, innerText);
}
public static By Xpath(string xpath)
{
return new By(SearchType.XPath, xpath);
}
public static By Id(string id, IElement parentElement)
{
return new By(SearchType.Id, id, parentElement);
}
public static By CssClass(string cssClass)
{
return new By(SearchType.CssClass, cssClass);
}
public static By Name(string name)
{
return new By(SearchType.Name, name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment