OperaDriver for Selenium remains stuck when launching tests

692 views Asked by At

I am using TestNG to run automated tests using a Selenium Java client. The tests are running fine on chrome and firefox but when I try to run the same on opera, I end up seeing tests timing out on the following console message:

Starting OperaDriver 2.35 (ee0117ea0f7f76009fd2aa3dd6b6164205de32b5) on port 27234
Only local connections are allowed.
org.openqa.selenium.WebDriverException: 
unknown error: Opera failed to start: exited abnormally
  (Driver info: OperaDriver=2.35 (ee0117ea0f7f76009fd2aa3dd6b6164205de32b5),platform=Linux 4.13.0-38-generic x86_64) (WARNING: The server did not provide any stacktrace information)

Environment

  • Ubuntu 16.04LTS
  • JDK 10
  • Selenium 3.11.0
  • OperaDriver 2.35(downloaded from here)

Code

OperaOptions options = new OperaOptions();
                options.setBinary("operadriver");
testDriver = new OperaDriver(options);

I am trying to understand what went wrong here.

1

There are 1 answers

0
SeleDry On BEST ANSWER

Many in the community seem to get the same error when trying to get opera running with selenium and opera driver. I also tested this with your versions and get the same output, although the other browsers are working just fine.

Opera does not seem to put a lot of resources in making this work. Check out this link for some more information, it is actually a slightly different issue, but still there are some background informations there.

The suggested hack is to run opera through an appropriate version of the chromedriver. I also got opera running with selenium that way some time ago (therefore other versions), but I did not yet test this with your configuration.

Update I managed to get the following configuration work:

  • Ubuntu 16.04
  • Java 1.8
  • Selenium 3.11.0
  • Operadriver 2.30
  • Opera 48.0.2685.52

by using the chrome hack and passing the operadriver as the "chrome"driver