Class OperaDriver
Provides a mechanism to write tests against Opera
public class OperaDriver : RemoteWebDriver, IWebDriver, IDisposable, ISearchContext, IJavaScriptExecutor, IFindsById, IFindsByClassName, IFindsByLinkText, IFindsByName, IFindsByTagName, IFindsByXPath, IFindsByPartialLinkText, IFindsByCssSelector, ITakesScreenshot, IHasInputDevices, IHasCapabilities, IAllowsFileDetection
- Inheritance
-
OperaDriver
- Implements
- Inherited Members
Examples
[TestFixture]
public class Testing
{
private IWebDriver driver;
[SetUp]
public void SetUp()
{
driver = new OperaDriver();
}
[Test]
public void TestGoogle()
{
driver.Navigate().GoToUrl("http://www.google.co.uk");
/*
* Rest of the test
*/
}
[TearDown]
public void TearDown()
{
driver.Quit();
}
}
Constructors
OperaDriver()
Initializes a new instance of the OperaDriver class.
public OperaDriver()
OperaDriver(OperaDriverService, OperaOptions)
Initializes a new instance of the OperaDriver class using the specified OperaDriverService and options.
public OperaDriver(OperaDriverService service, OperaOptions options)
Parameters
serviceOperaDriverServiceThe OperaDriverService to use.
optionsOperaOptionsThe OperaOptions used to initialize the driver.
OperaDriver(OperaDriverService, OperaOptions, TimeSpan)
Initializes a new instance of the OperaDriver class using the specified OperaDriverService.
public OperaDriver(OperaDriverService service, OperaOptions options, TimeSpan commandTimeout)
Parameters
serviceOperaDriverServiceThe OperaDriverService to use.
optionsOperaOptionsThe OperaOptions to be used with the Opera driver.
commandTimeoutTimeSpanThe maximum amount of time to wait for each command.
OperaDriver(OperaOptions)
Initializes a new instance of the OperaDriver class using the specified options.
public OperaDriver(OperaOptions options)
Parameters
optionsOperaOptionsThe OperaOptions to be used with the Opera driver.
OperaDriver(string)
Initializes a new instance of the OperaDriver class using the specified path to the directory containing OperaDriver.exe.
public OperaDriver(string operaDriverDirectory)
Parameters
operaDriverDirectorystringThe full path to the directory containing OperaDriver.exe.
OperaDriver(string, OperaOptions)
Initializes a new instance of the OperaDriver class using the specified path to the directory containing OperaDriver.exe and options.
public OperaDriver(string operaDriverDirectory, OperaOptions options)
Parameters
operaDriverDirectorystringThe full path to the directory containing OperaDriver.exe.
optionsOperaOptionsThe OperaOptions to be used with the Opera driver.
OperaDriver(string, OperaOptions, TimeSpan)
Initializes a new instance of the OperaDriver class using the specified path to the directory containing OperaDriver.exe, options, and command timeout.
public OperaDriver(string operaDriverDirectory, OperaOptions options, TimeSpan commandTimeout)
Parameters
operaDriverDirectorystringThe full path to the directory containing OperaDriver.exe.
optionsOperaOptionsThe OperaOptions to be used with the Opera driver.
commandTimeoutTimeSpanThe maximum amount of time to wait for each command.
Fields
AcceptUntrustedCertificates
Accept untrusted SSL Certificates
public static readonly bool AcceptUntrustedCertificates
Field Value
Properties
FileDetector
Gets or sets the IFileDetector responsible for detecting sequences of keystrokes representing file paths and names.
public override IFileDetector FileDetector { get; set; }
Property Value
Remarks
The Opera driver does not allow a file detector to be set, as the server component of the Opera driver (OperaDriver.exe) only allows uploads from the local computer environment. Attempting to set this property has no effect, but does not throw an exception. If you are attempting to run the Opera driver remotely, use RemoteWebDriver in conjunction with a standalone WebDriver server.