C# Class Selenium.SearchContext

Locators methods for WebDriver and WebElement
Show file Open project: florentbr/SeleniumBasic

Private Properties

Property Type Description
FindAllElements WebElements
FindAnyElement WebElement
FindAnyElements WebElements
FindFirstElement WebElement
WaitAnyElementNotPresent void
WaitElementNotPresent void

Public Methods

Method Description
FindElement ( Selenium.By by, int timeout = -1, bool raise = true ) : WebElement

Find the first WebElement using the given method.

FindElementBy ( Strategy strategy, string value, int timeout = -1, bool raise = true ) : WebElement

Finds the first child element matching the given mechanism and value.

FindElementByClass ( string classname, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified CSS class.

FindElementByCss ( string cssselector, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified CSS selector.

FindElementById ( string id, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified id.

FindElementByLinkText ( string linktext, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified link text.

FindElementByName ( string name, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified name.

FindElementByPartialLinkText ( string partiallinktext, int timeout = -1, bool raise = true ) : WebElement

Finds the first of elements that match the part of the link text supplied

FindElementByTag ( string tagname, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified tag name.

FindElementByXPath ( string xpath, int timeout = -1, bool raise = true ) : WebElement

Finds the first element matching the specified XPath query.

FindElements ( Selenium.By by, int minimum, int timeout ) : WebElements

Find all elements within the current context using the given mechanism.

FindElementsBy ( Strategy strategy, string value, int minimum, int timeout ) : WebElements

Finds all child elements matching the given mechanism and value.

FindElementsByClass ( string classname, int minimum, int timeout ) : WebElements

Finds elements matching the specified CSS class.

FindElementsByCss ( string cssselector, int minimum, int timeout ) : WebElements

Finds elements matching the specified CSS selector.

FindElementsById ( string id, int minimum, int timeout ) : WebElements

Finds elements matching the specified id.

FindElementsByLinkText ( string linktext, int minimum, int timeout ) : WebElements

Finds elements matching the specified link text.

FindElementsByName ( string name, int minimum, int timeout ) : WebElements

Finds elements matching the specified name.

FindElementsByPartialLinkText ( string partiallinktext, int minimum, int timeout ) : WebElements

Finds the first of elements that match the part of the link text supplied

FindElementsByTag ( string tagname, int minimum, int timeout ) : WebElements

Finds elements matching the specified tag name.

FindElementsByXPath ( string xpath, int minimum, int timeout ) : WebElements

Finds elements matching the specified XPath query.

IsElementPresent ( Selenium.By by, int timeout ) : bool

"Verifies that the specified element is somewhere on the page."

WaitNotElement ( Selenium.By by, int timeout = -1 ) : void

Waits for an element to be missing.

Private Methods

Method Description
FindAllElements ( Strategy strategy, string value, int minimum, int timeout ) : WebElements

Returns all the web elements matching the given method and value

FindAnyElement ( Selenium.By byAny, int timeout ) : WebElement
FindAnyElements ( Selenium.By byAny, int minimum, int timeout ) : WebElements
FindFirstElement ( Strategy strategy, string value, int timeout ) : WebElement

Returns a web element matching the given method and value or null if no element found

WaitAnyElementNotPresent ( Selenium.By byAny, int timeout ) : void

Returns a web element matching the given method and value

WaitElementNotPresent ( Strategy strategy, string value, int timeout ) : void

Returns a web element matching the given method and value

Method Details

FindElement() public method

Find the first WebElement using the given method.
public FindElement ( Selenium.By by, int timeout = -1, bool raise = true ) : WebElement
by Selenium.By Methode
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementBy() public method

Finds the first child element matching the given mechanism and value.
public FindElementBy ( Strategy strategy, string value, int timeout = -1, bool raise = true ) : WebElement
strategy Strategy The mechanism by which to find the elements.
value string The value to use to search for the elements.
timeout int Optional timeout in milliseconds
raise bool
return WebElement

FindElementByClass() public method

Finds the first element matching the specified CSS class.
public FindElementByClass ( string classname, int timeout = -1, bool raise = true ) : WebElement
classname string Classname
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByCss() public method

Finds the first element matching the specified CSS selector.
public FindElementByCss ( string cssselector, int timeout = -1, bool raise = true ) : WebElement
cssselector string CSS selector
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementById() public method

Finds the first element matching the specified id.
public FindElementById ( string id, int timeout = -1, bool raise = true ) : WebElement
id string Id
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByLinkText() public method

Finds the first element matching the specified link text.
public FindElementByLinkText ( string linktext, int timeout = -1, bool raise = true ) : WebElement
linktext string Link text
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByName() public method

Finds the first element matching the specified name.
public FindElementByName ( string name, int timeout = -1, bool raise = true ) : WebElement
name string Name
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByPartialLinkText() public method

Finds the first of elements that match the part of the link text supplied
public FindElementByPartialLinkText ( string partiallinktext, int timeout = -1, bool raise = true ) : WebElement
partiallinktext string Partial link text
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByTag() public method

Finds the first element matching the specified tag name.
public FindElementByTag ( string tagname, int timeout = -1, bool raise = true ) : WebElement
tagname string Tag name
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElementByXPath() public method

Finds the first element matching the specified XPath query.
public FindElementByXPath ( string xpath, int timeout = -1, bool raise = true ) : WebElement
xpath string XPath
timeout int Optional timeout in milliseconds
raise bool Optional - Raise an exception after the timeout when true
return WebElement

FindElements() public method

Find all elements within the current context using the given mechanism.
public FindElements ( Selenium.By by, int minimum, int timeout ) : WebElements
by Selenium.By The locating mechanism to use
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsBy() public method

Finds all child elements matching the given mechanism and value.
public FindElementsBy ( Strategy strategy, string value, int minimum, int timeout ) : WebElements
strategy Strategy The mechanism by which to find the elements.
value string The value to use to search for the elements.
minimum int Minimum of elements expected
timeout int Timeout in millisecond
return WebElements

FindElementsByClass() public method

Finds elements matching the specified CSS class.
public FindElementsByClass ( string classname, int minimum, int timeout ) : WebElements
classname string Class name
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByCss() public method

Finds elements matching the specified CSS selector.
public FindElementsByCss ( string cssselector, int minimum, int timeout ) : WebElements
cssselector string CSS selector
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsById() public method

Finds elements matching the specified id.
public FindElementsById ( string id, int minimum, int timeout ) : WebElements
id string Id
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByLinkText() public method

Finds elements matching the specified link text.
public FindElementsByLinkText ( string linktext, int minimum, int timeout ) : WebElements
linktext string Link text
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByName() public method

Finds elements matching the specified name.
public FindElementsByName ( string name, int minimum, int timeout ) : WebElements
name string Name
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByPartialLinkText() public method

Finds the first of elements that match the part of the link text supplied
public FindElementsByPartialLinkText ( string partiallinktext, int minimum, int timeout ) : WebElements
partiallinktext string Partial link text
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByTag() public method

Finds elements matching the specified tag name.
public FindElementsByTag ( string tagname, int minimum, int timeout ) : WebElements
tagname string Tag name
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

FindElementsByXPath() public method

Finds elements matching the specified XPath query.
public FindElementsByXPath ( string xpath, int minimum, int timeout ) : WebElements
xpath string XPath
minimum int Minimum number of elements to wait for
timeout int Optional timeout in milliseconds
return WebElements

IsElementPresent() public method

"Verifies that the specified element is somewhere on the page."
public IsElementPresent ( Selenium.By by, int timeout ) : bool
by Selenium.By An element loctor. string or By object
timeout int Optional timeout in milliseconds
return bool

WaitNotElement() public method

Waits for an element to be missing.
public WaitNotElement ( Selenium.By by, int timeout = -1 ) : void
by Selenium.By Search mechanism
timeout int Optional - timeout in milliseconds
return void