com.opera.core.systems.runner.interfaces
Interface OperaRunner

All Known Implementing Classes:
OperaLauncherRunner, OperaRunner

public interface OperaRunner

OperaRunner is an interface for controlling the Opera browser binary. It allows you to start, stop, take screenshots of, and catch crash logs from Opera. OperaRunner implements a pure-Java process manager, OperaLauncherRunner implements one in C++ with a Java API.

Author:
Andreas Tolf Tolfsen

Method Summary
 String getOperaCrashlog()
          If Opera crashed there should be a crashlog.
 boolean hasOperaCrashed()
          Did Opera crash? This is reset on next call, so if you don't check you won't know.
 boolean isOperaRunning()
          Is Opera running?
 boolean isOperaRunning(int processId)
           
 ScreenShotReply saveScreenshot(long timeout, String... hashes)
          Take a screenshot of the full screen.
 void shutdown()
          In case the com.opera.core.systems.runner.runner has sockets and stuff, it needs to be shut down.
 void startOpera()
          Start Opera, does nothing if Opera is already started.
 void stopOpera()
          Stops Opera, does nothing if Opera isn't running.
 

Method Detail

startOpera

void startOpera()
Start Opera, does nothing if Opera is already started.


stopOpera

void stopOpera()
Stops Opera, does nothing if Opera isn't running. Typically we'll use the exec service to stop Opera, but this method will _ensure_ that Opera is quit from an external process controller.


isOperaRunning

boolean isOperaRunning()
Is Opera running?

Returns:
true if running, false if not running or crashed

isOperaRunning

boolean isOperaRunning(int processId)

hasOperaCrashed

boolean hasOperaCrashed()
Did Opera crash? This is reset on next call, so if you don't check you won't know.

Returns:
true if opera has crashed

getOperaCrashlog

String getOperaCrashlog()
If Opera crashed there should be a crashlog.

Returns:
the crashlog, or null if it does not exist

shutdown

void shutdown()
In case the com.opera.core.systems.runner.runner has sockets and stuff, it needs to be shut down.


saveScreenshot

ScreenShotReply saveScreenshot(long timeout,
                               String... hashes)
Take a screenshot of the full screen.

Parameters:
timeout - attempt to take the screenshot until the timeout is reached
hashes - an arbitrary list of hashes to compare with
Returns:
a ScreenshotReply object containing MD5 hash sums and bytes


Copyright © 2012. All Rights Reserved.