AsyncOperaDriver

Opera WebDriver and Opera DevTools through a single connection


Keywords
Opera, Chrome, DevTools, AsyncChromeDriver, AsyncWebDriver, WebDriver
License
Apache-2.0
Install
Install-Package AsyncOperaDriver -Version 0.5.5

Documentation

AsyncOperaDriver

Opera WebDriver and Chrome DevTools in one library.
Chrome DevTools because Opera is based on Chromium.
So AsyncOperaDriver is based on AsyncChromeDriver

It connects directly to Chrome DevTools and is async from this connection.
No need in operadriver.

AsyncOperaDriver implements IAsyncWebBrowserClient and can be used as AsyncWebDriver.

It also has DevTools property and you can easily use all power of Chrome DevTools from your .Net app. Thanks to BaristaLabs/chrome-dev-tools-sample

Join the chat at https://gitter.im/AsyncWebDriver/Lobby

Usage

Install AsyncOperaDriver via NuGet

If you want to include AsyncOperaDriver in your project, you can install it directly from NuGet

PM> Install-Package AsyncOperaDriver

Write code example

     var asyncOperaDriver = new AsyncOperaDriver();
     var webDriver = new WebDriver(asyncOperaDriver);
     await webDriver.GoToUrl("https://www.google.com/");
     var query = await webDriver.FindElement(By.Name("q"));
     foreach (var v in "ToCSharp".ToList())
     {
        await Task.Delay(500 + new Random().Next(500));
        await query.SendKeys(v.ToString());
      }
      await Task.Delay(500);
      await query.SendKeys(Keys.Enter);
      var allCookies = await asyncOperaDriver.DevTools.Session.Network.GetAllCookies(new GetAllCookiesCommand());

      var screenshot = await webDriver.GetScreenshot();
      screenshot.SaveAsFile(GetFilePathToSaveScreenshot(), Zu.WebBrowser.BasicTypes.ScreenshotImageFormat.Png);

Using DevTools

    asyncOperaDriver = new AsyncOperaDriver();
    await asyncOperaDriver.CheckConnected();
    await asyncOperaDriver.DevTools.Session.Page.Enable(new BaristaLabs.ChromeDevTools.Runtime.Page.EnableCommand());
    asyncOperaDriver.DevTools.Session.Page.SubscribeToDomContentEventFiredEvent(async (e2) =>
    {
        var screenshot = await asyncOperaDriver.DevTools.Session.Page.CaptureScreenshot(new BaristaLabs.ChromeDevTools.Runtime.Page.CaptureScreenshotCommand());
        SaveScreenshot(screenshot.Data);
    });
    //await asyncOperaDriver.GoToUrl("https://www.google.com/");
    await asyncOperaDriver.DevTools.Session.Page.Navigate(new BaristaLabs.ChromeDevTools.Runtime.Page.NavigateCommand
    {
        Url = "https://www.google.com/"
    });

Examples

Look at AsyncOperaDriverExample.

Run built Example in release tab.

Implemented

Most functionality is in AsyncChromeDriver project and AsyncOperaDriver depends on its implementation.

Contribute!

If you see NotImplementedException, means you need functionality, which is not implemented yet.

Write issue or to Join the chat at https://gitter.im/AsyncWebDriver/Lobby. I implemented what I myself use at first.

Feel free to submit pull requests.

Please star the project. More stars - more time I'll spend on it. There's so much to do here.