C# Class OpenQA.Selenium.By

Mostra file Open project: asynchrony/Selenium2 Class Usage Examples

Public Methods

Method Description
ClassName ( string classNameToFind ) : By

Gets a mechanism to find elements by their CSS class.

If an element has many classes then this will match against each of them. For example if the value is "one two onone", then the following values for the className parameter will match: "one" and "two".

CssSelector ( string cssSelectorToFind ) : By

Gets a mechanism to find elements by their cascading stylesheet (CSS) selector.

Equals ( object obj ) : bool

Determines whether the specified Object is equal to the current Object.

FindElement ( ISearchContext context ) : IWebElement

Finds the first element matching the criteria.

FindElements ( ISearchContext context ) : ReadOnlyCollection

Finds all elements matching the criteria.

GetHashCode ( ) : int

Serves as a hash function for a particular type.

Id ( string idToFind ) : By

Gets a mechanism to find elements by their ID.

LinkText ( string linkTextToFind ) : By

Gets a mechanism to find elements by their link text.

Name ( string nameToFind ) : By

Gets a mechanism to find elements by their name.

PartialLinkText ( string partialLinkTextToFind ) : By

Gets a mechanism to find elements by a partial match on their link text.

TagName ( string tagNameToFind ) : By

Gets a mechanism to find elements by their tag name.

ToString ( ) : string

Gets a string representation of the finder.

XPath ( string xpathToFind ) : By

Gets a mechanism to find elements by an XPath query.

Method Details

ClassName() public static method

Gets a mechanism to find elements by their CSS class.
If an element has many classes then this will match against each of them. For example if the value is "one two onone", then the following values for the className parameter will match: "one" and "two".
public static ClassName ( string classNameToFind ) : By
classNameToFind string The CSS class to find.
return By

CssSelector() public static method

Gets a mechanism to find elements by their cascading stylesheet (CSS) selector.
public static CssSelector ( string cssSelectorToFind ) : By
cssSelectorToFind string The CSS selector to find.
return By

Equals() public method

Determines whether the specified Object is equal to the current Object.
public Equals ( object obj ) : bool
obj object The Object to compare with the /// current Object.
return bool

FindElement() public method

Finds the first element matching the criteria.
public FindElement ( ISearchContext context ) : IWebElement
context ISearchContext An object to use to search for the elements.
return IWebElement

FindElements() public method

Finds all elements matching the criteria.
public FindElements ( ISearchContext context ) : ReadOnlyCollection
context ISearchContext An object to use to search for the elements.
return ReadOnlyCollection

GetHashCode() public method

Serves as a hash function for a particular type.
public GetHashCode ( ) : int
return int

Id() public static method

Gets a mechanism to find elements by their ID.
public static Id ( string idToFind ) : By
idToFind string The ID to find.
return By

LinkText() public static method

Gets a mechanism to find elements by their link text.
public static LinkText ( string linkTextToFind ) : By
linkTextToFind string The link text to find.
return By

Name() public static method

Gets a mechanism to find elements by their name.
public static Name ( string nameToFind ) : By
nameToFind string The name to find.
return By

PartialLinkText() public static method

Gets a mechanism to find elements by a partial match on their link text.
public static PartialLinkText ( string partialLinkTextToFind ) : By
partialLinkTextToFind string The partial link text to find.
return By

TagName() public static method

Gets a mechanism to find elements by their tag name.
public static TagName ( string tagNameToFind ) : By
tagNameToFind string The tag name to find.
return By

ToString() public method

Gets a string representation of the finder.
public ToString ( ) : string
return string

XPath() public static method

Gets a mechanism to find elements by an XPath query.
public static XPath ( string xpathToFind ) : By
xpathToFind string The XPath query to use.
return By