Assert Class
Testing functions. Throws an exception if the condition is not met
Inheritance Hierarchy
SystemObject
  SeleniumAssert

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

The Assert type exposes the following members.

Constructors
  NameDescription
Public methodAssert
Create an assert object.
Top
Methods
  NameDescription
Public methodStatic memberContains
Raise an error if the text does not contain the value.
Public methodStatic memberEquals
Test that two objects are equal and raise an exception if the result is false
Public methodStatic memberFail
Raise an error.
Public methodStatic memberFalse
Raise an error if the value is false.
Public methodStatic memberMatches
Raise an error if the text matches the pattern.
Public methodStatic memberNotEquals
Test that two objects are not equal and raise an exception if the result is false
Public methodStatic memberNotMatches
Raise an error if the text does not match the pattern.
Public methodStatic memberTrue
Raise an error if the value is true.
Top
Examples
The following example asserts the page title.
Set Assert = CreateObject("Selenium.Assert")
Set driver = CreateObject("Selenium.FirefoxDriver")
driver.get "http://www.google.com"
Assert.Equals "Google", driver.Title
driver.stop
Private Assert As New Selenium.Assert

Public Sub TestCase()
  Dim driver As New Selenium.FirefoxDriver
  driver.get "http://www.google.com"
  Assert.Equals "Google", driver.Title
  driver.stop
End Sub
See Also