C# Класс Selenium.SearchContext

Locators methods for WebDriver and WebElement
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
FindAllElements WebElements
FindAnyElement WebElement
FindAnyElements WebElements
FindFirstElement WebElement
WaitAnyElementNotPresent void
WaitElementNotPresent void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

FindElement() публичный Метод

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
Результат WebElement

FindElementBy() публичный Метод

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
Результат WebElement

FindElementByClass() публичный Метод

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
Результат WebElement

FindElementByCss() публичный Метод

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
Результат WebElement

FindElementById() публичный Метод

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
Результат WebElement

FindElementByLinkText() публичный Метод

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
Результат WebElement

FindElementByName() публичный Метод

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
Результат WebElement

FindElementByPartialLinkText() публичный Метод

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
Результат WebElement

FindElementByTag() публичный Метод

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
Результат WebElement

FindElementByXPath() публичный Метод

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
Результат WebElement

FindElements() публичный Метод

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
Результат WebElements

FindElementsBy() публичный Метод

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
Результат WebElements

FindElementsByClass() публичный Метод

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
Результат WebElements

FindElementsByCss() публичный Метод

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
Результат WebElements

FindElementsById() публичный Метод

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
Результат WebElements

FindElementsByLinkText() публичный Метод

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
Результат WebElements

FindElementsByName() публичный Метод

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
Результат WebElements

FindElementsByPartialLinkText() публичный Метод

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
Результат WebElements

FindElementsByTag() публичный Метод

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
Результат WebElements

FindElementsByXPath() публичный Метод

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
Результат WebElements

IsElementPresent() публичный Метод

"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
Результат bool

WaitNotElement() публичный Метод

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
Результат void