case object UninitializedDriver extends GrumpyDriver with Product with Serializable
An implementation of WebDriver
that throws UnsupportedOperationException
from
all of its methods, used to initialize instance var
s of type WebDriver
.
Traits OneBrowserPerTest, ConfiguredBrowser,
AllBrowsersPerSuite, and AllBrowsersPerTest initialize
their webDriver
field with this value (to avoid initializing with null
).
This is an example of the "Null Object Pattern." We use this pattern to avoid initializing with null
instead of making the driver type
an Option[WebDriver]
for two reasons: 1) the type of the implicit needed by Selenium is WebDriver
, not Option[WebDriver]
, and 2)
the UnsupportedOperationException
thrown by the methods of the Null Object we provide carries a user-friendly error message.
- Source
- BrowserFactory.scala
- Alphabetic
- By Inheritance
- UninitializedDriver
- Serializable
- Product
- Equals
- GrumpyDriver
- WebDriver
- SearchContext
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def close(): Unit
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def findElement(by: By): WebElement
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver → SearchContext
- final def findElements(by: By): List[WebElement]
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver → SearchContext
- final def get(url: String): Unit
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def getCurrentUrl(): String
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def getPageSource(): String
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def getTitle(): String
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def getWindowHandle(): String
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def getWindowHandles(): Set[String]
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def manage(): Options
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def navigate(): Navigation
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def quit(): Unit
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver
- final def switchTo(): TargetLocator
Throws
UnsupportedOperationException
.Throws
UnsupportedOperationException
.- Definition Classes
- GrumpyDriver → WebDriver