By Class
Provides a mechanism by which to find elements within a document.
Inheritance Hierarchy
SystemObject
  SeleniumBy

Namespace: Selenium
Assembly: Selenium (in Selenium.dll) Version: 2.0.9.0 (2.0.9.0)
Syntax
VB Usage
Dim instance As By

The By type exposes the following members.

Constructors
  NameDescription
Public methodBy
Creates an empty mechanism.
Top
Methods
  NameDescription
Public methodStatic memberAny
Search using multiple mechanisms
Public methodStatic memberClass
Search by class name
Public methodStatic memberCss
Search by CSS selector
Public methodEquals
Comapre two by objects
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
(Overrides ObjectGetHashCode.)
Public methodStatic memberId
Search by id
Public methodStatic memberLinkText
Search by link text
Public methodStatic memberName
Search by name attribute
Public methodStatic memberPartialLinkText
Search by partial link text
Public methodStatic memberTag
Search by tag name
Public methodToString
Gets a string representation of the finder.
(Overrides ObjectToString.)
Public methodStatic memberXPath
Search by XPath
Top
Properties
  NameDescription
Public propertyStrategy
Strategy
Public propertyValue
Value
Top
Examples
Find an element by id:
Set bt = By.Id("id")
driver.FindElement(bt).Click
Find an element by id or name:
Set bt = By.Any(By.Id("name"), By.Id("id"))
driver.FindElement(bt).Click
See Also