Skip to content

Communication overview

Stuk edited this page Jul 18, 2011 · 1 revision

Communication between Opera and OperaDriver (and Dragonfly) is done over a protocol called "Scope" (Scope documentation). Scope uses the protobuf format. It has many different services which can be enabled if they are needed, the ones that are used in OperaDriver are available in the protos/ directory.

Note: the UMS proto is different to the others. Each Scope message (apart from the handshake) is a UMS message (one of Command from driver to Opera, Response from Opera to driver, Event for an unrequested message from Opera to driver, and occasionally Error instead of a Response when an error occurs) which contains some headers (such as the status of the result) and a payload field which contains one of the protobuf messages from the other .proto files.

Setting up the connection

  • Start up a listener on (default) port 7001 (StpConnectionListener).
  • Start Opera with the -autotestmode command line argument. This will cause Opera to disable certain dialogs and automatically connect to a server on port 7001 (in the future the port and host will be able to be specified).
  • OperaDriver then gets a handshake message.
  • Once the handshake has been completed the services OperaDriver needs are enabled. (Note: the way services are handled in the Java code is not ideal.)
  • Now this setup is done "commands" can be sent to Opera. In the proto files these are defined in the non-standard service section. I recommend looking at the prefs service for a simple example:
  • Events can also be received from Opera. Have a look at the HTTP logger for an example:

Feel free to send me a message if you have any questions.

Clone this wiki locally