Skip to content

WhereEnum

lzinga edited this page Apr 11, 2021 · 1 revision

This enum is used to define how you will be selecting an element on the page. Each of these options are pretty standard methods and there is a lot of information about each of them.

/// <summary>
/// The configuration of how the page will be searched.
/// </summary>
public enum Where
{
	/// <summary>
	/// The Id attribute of the html element.
	/// </summary>
	Id,

	/// <summary>
	/// The Name attribute of the html element.
	/// </summary>
	Name,

	/// <summary>
	/// The Class attribute of the html element.
	/// <para>No spaces allowed.</para>
	/// </summary>
	Class,

	/// <summary>
	/// The element where the Css selector matches.
	/// </summary>
	Css,

	/// <summary>
	/// The element where the Tag equals.
	/// </summary>
	Tag,

	/// <summary>
	/// The element that matches the XPath
	/// </summary>
	XPath
}

Example

In the example we are using the FindWhere attribute. You can see we use this enum to find where an elements name is equal to "login".

[FindWhere(Where.Name, "login")]
Clone this wiki locally