Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7768563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:56:45+00:00 2026-06-01T15:56:45+00:00

I am trying to integrate OperaDriver for Java (ver. 0.11) into my test suite.

  • 0

I am trying to integrate OperaDriver for Java (ver. 0.11) into my test suite. Here’s the code snippet:

  DesiredCapabilities operaCapabilities = DesiredCapabilities.opera();
  operaCapabilities.setCapability("opera.host", "127.0.0.1");
  operaCapabilities.setCapability("opera.port", 7001);
  operaCapabilities.setCapability("opera.profile", "");

  webDriver = new OperaDriver(operaCapabilities);

The above code snippet fails to return a webdriver reference with a SocketTimeoutException Timeout waiting for launcher to connect on port 29392. I can see that the browser (opera ver. 11.62) is launched with speed dial tab loaded, and the launcher is also executing, but somehow OperaDriver seems to be unable to connect.

The exception I see is:

com.opera.core.systems.runner.OperaRunnerException: Timeout waiting for launcher to connect on port 29392
at com.opera.core.systems.runner.launcher.OperaLauncherRunner.<init>(OperaLauncherRunner.java:159)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:322)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:224)
at com.test.TestMain.main(TestMain.java:31)

Caused by: java.net.SocketTimeoutException: Accept timed out
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
    at java.net.ServerSocket.implAccept(ServerSocket.java:462)
    at java.net.ServerSocket.accept(ServerSocket.java:430)
    at com.opera.core.systems.runner.launcher.OperaLauncherRunner.<init>

(OperaLauncherRunner.java:140)
        ... 3 more

I have tried -1 for “opera.port” and also 7001, but the capability setting seems to be ignored, since it is attempting to connect with a random port each time. I have my firewalls temporarily turned off as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:56:46+00:00Added an answer on June 1, 2026 at 3:56 pm

    First, let’s isolate the exception being hit here:

    private final int launcherPort = PortProber.findFreePort();
    
    ...
    
    public OperaLauncherRunner(OperaSettings s) {
        super(s);
    
        // Locate the bundled launcher from OperaLaunchers project and copy it to its default location
        // on users system if it's not there or outdated
        bundledLauncher =
            OperaLaunchers.class.getClassLoader().getResource("launchers/" + launcherNameForOS());
    
        if (bundledLauncher == null) {
          throw new OperaRunnerException("Not able to locate bundled launcher: " + bundledLauncher);
        }
    
        if (settings.getLauncher() == launcherDefaultLocation() &&
            (!settings.getLauncher().exists() || isLauncherOutdated(settings.getLauncher()))) {
          extractLauncher(bundledLauncher, settings.getLauncher());
        }
    
        makeLauncherExecutable(settings.getLauncher());
    
        // Find an available Opera if present
        if (settings.getBinary() == null) {
          settings.setBinary(new File(OperaPaths.operaPath()));
        }
    
        // Create list of arguments for launcher binary
        ImmutableList<String> arguments = buildArguments();
        logger.config("launcher arguments: " + arguments);
    
        try {
          launcherRunner = new OperaLauncherBinary(settings.getLauncher().getPath(),
                                                   arguments.toArray(new String[]{}));
        } catch (IOException e) {
          throw new OperaRunnerException("Unable to start launcher: " + e.getMessage());
        }
    
        logger.fine("Waiting for launcher connection on port " + launcherPort);
    
        try {
          // Setup listener server
          ServerSocket listenerServer = new ServerSocket(launcherPort);
          listenerServer.setSoTimeout((int) OperaIntervals.LAUNCHER_TIMEOUT.getValue());
    
          // Try to connect
          launcherProtocol = new OperaLauncherProtocol(listenerServer.accept());
    
          // We did it!
          logger.fine("Connected with launcher on port " + launcherPort);
          listenerServer.close();
    
          // Do the handshake!
          LauncherHandshakeRequest.Builder request = LauncherHandshakeRequest.newBuilder();
          ResponseEncapsulation res = launcherProtocol.sendRequest(
              MessageType.MSG_HELLO, request.build().toByteArray());
    
          // Are we happy?
          if (res.isSuccess()) {
            logger.finer("Got launcher handshake: " + res.getResponse().toString());
          } else {
            throw new OperaRunnerException(
                "Did not get launcher handshake: " + res.getResponse().toString());
          }
        } catch (SocketTimeoutException e) {
          throw new OperaRunnerException("Timeout waiting for launcher to connect on port " +
                                         launcherPort, e);
        } catch (IOException e) {
          throw new OperaRunnerException("Unable to listen to launcher port " + launcherPort, e);
        }
      }
    

    We learn a few things from this code:

    1. private final int launcherPort =PortProber.findFreePort(); sets our launcherPort, and this variable is uniquely used to establish the connect.

      Indeed, your configuration of opera.port is completely ignored in this block. That seems less than desirable, and it may indeed be a bug or an unexpected regression.

    2. Once we establish the local port, a connection attempt is made immediately:

      // Setup listener server
      ServerSocket listenerServer = new ServerSocket(launcherPort);
      listenerServer.setSoTimeout((int) OperaIntervals.LAUNCHER_TIMEOUT.getValue());

      // Try to connect
      launcherProtocol = new OperaLauncherProtocol(listenerServer.accept());

    So, we have a tightly coupled binding to the local server. The port is ignored in favor of a free one on your system, but simultaneously, it should always be able to use that port.

    If your firewall is indeed not preventing the connection (as you’ve discussed), let’s assume you desire Opera to be connected to programmatically, instead of manually opening the connection.

    According to some documentation, opera.host carries the following caveat:

    opera.host (String) The host Opera should connect to. Unless you’re
    starting Opera manually you won’t need this.

    (Additional emphasis mine.)

    Needless to say, the caveat concerns me. Likewise, despite its apparent inapplicability:

    opera.port (Integer) The port to Opera should connect to. 0 = Random,
    -1 = Opera default (for use with Opera > 12).

    (Additional emphasis mine.)

    In short: try running your application as illustrated here:

    DesiredCapabilities capabilities = new DesiredCapabilities.opera();
    capabilities.setCapability("opera.binary", "/path/to/your/opera");
    capabilities.setCapability("opera.log.level", "CONFIG");
    WebDriver driver = new OperaDriver(capabilities);
    

    If this doesn’t work, something else is wrong, either with your project or with your current Opera binary, be it version-related or otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to integrate netbeans with mysql database management into the IDE as explained here
I'm trying to integrate searchable help into my Java (Swing) application. I'm using docbook
While trying to integrate Yahoo Media Player into my own website, I want to
I'm trying to integrate a public message board service into an existing web site.
I am trying to integrate the function into a map where you can enter
I am trying to integrate a Hibernate application into a proprietary framework. My problem
I am trying to integrate NHibernate.Search into a multi-lingual website. Now, this website contains
I'm trying to integrate a Facebook send button into my site using Facebook app.
I am trying to integrate OpenFeint 2.12.5 into my app. I already read this
I am trying to Integrate an SMS service into my website. I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.