0

while running the below program in eclipse, got an error "cannot find Opera binary".

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.opera.OperaDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

public class Opera 
{
public static void main(String[] args) 
{
    WebDriverManager.operadriver().setup();
    WebDriver d = new OperaDriver();
    d.get("http://amazon.ae");
    d.close();
}
}

enter image description here How to solve this , please help..

RVR
  • 651
  • 2
  • 6
  • 14

1 Answers1

0

Try to specify the path of your Opera launcher binary:

    String operaBinary = "C:\\Program Files\\Opera\\launcher.exe"; // If Windows
    WebDriverManager.operadriver().setup();
    OperaOptions options = new OperaOptions();
    options.setBinary(operaBinary);
    WebDriver driver = new OperaDriver(options);

    // ...
Boni García
  • 4,618
  • 5
  • 28
  • 44