Table of Contents

Class OperaDriver

Namespace
OpenQA.Selenium.Opera
Assembly
WebDriver.dll

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

service OperaDriverService

The OperaDriverService to use.

options OperaOptions

The 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

service OperaDriverService

The OperaDriverService to use.

options OperaOptions

The OperaOptions to be used with the Opera driver.

commandTimeout TimeSpan

The 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

options OperaOptions

The 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

operaDriverDirectory string

The 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

operaDriverDirectory string

The full path to the directory containing OperaDriver.exe.

options OperaOptions

The 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

operaDriverDirectory string

The full path to the directory containing OperaDriver.exe.

options OperaOptions

The OperaOptions to be used with the Opera driver.

commandTimeout TimeSpan

The maximum amount of time to wait for each command.

Fields

AcceptUntrustedCertificates

Accept untrusted SSL Certificates

public static readonly bool AcceptUntrustedCertificates

Field Value

bool

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

IFileDetector

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.