Timothy94
Timothy94

Reputation: 69

How to provide OperaWebDriver on c# use Selenium WebDriver

How to provide OperaWebDriver on c# use Selenium WebDriver

  IWebDriver aDriver = new OperaDriver("path_to_operadriver.exe);

I have exception :

System.InvalidOperationException : unknown error: cannot find Opera binary (Driver info: OperaDriver=0.2.0 )

Upvotes: 2

Views: 3103

Answers (2)

leocrimson
leocrimson

Reputation: 742

Using setBinary gives me an error. I am able to resolve it by using this: options.BinaryLocation = @"/path/to/opera";

Similarly for chrome as well.

Upvotes: 1

Jonathan Prates
Jonathan Prates

Reputation: 1247

You've got to download opera chromium driver.

Here's a snippet how it should work:

DesiredCapabilities capabilities = DesiredCapabilities.opera();
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/opera");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

Upvotes: 0

Related Questions