|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openqa.selenium.remote.RemoteWebDriver
com.opera.core.systems.OperaDriver
public class OperaDriver
OperaDriver is an implementation of the WebDriver interface that allows you to drive the Opera web browser. The driver uses the Scope protocol to communicate with Opera directly from Java. The implementation is vendor-supported and developed by Opera Software and volunteers.
| Nested Class Summary | |
|---|---|
class |
OperaDriver.OperaOptions
|
class |
OperaDriver.OperaTimeouts
|
class |
OperaDriver.OperaUtils
Interface for accessing the browser's meta- and utility information. |
| Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver |
|---|
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When |
| Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver |
|---|
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window |
| Field Summary | |
|---|---|
protected ScopeActions |
actionHandler
|
static String |
ARGUMENTS
(String) Arguments to pass to Opera, separated by spaces. |
static String |
AUTOSTART
(Boolean) Whether to auto-start the Opera binary. |
static String |
BACKEND
Deprecated. |
static String |
BINARY
(String) Path to the Opera binary to use. |
protected org.openqa.selenium.remote.DesiredCapabilities |
capabilities
|
protected ICookieManager |
cookieManager
|
protected ICoreUtils |
coreUtils
|
protected IEcmaScriptDebugger |
debugger
|
static String |
DISPLAY
(Integer) The X display to use. |
protected IOperaExec |
exec
|
static String |
GUESS_BINARY_PATH
(Boolean) Whether to guess the path to Opera if it isn't set in opera.binary. |
static String |
HOST
(String) The host Opera should connect to. |
static String |
LAUNCHER
(String) Path to the launcher binary to use. |
protected Logger |
logger
|
static String |
LOGGING_FILE
(String) Where to send the output of the logging. |
static String |
LOGGING_LEVEL
(String) How verbose the logging should be. |
static String |
NO_QUIT
(Boolean) Whether to quit Opera when OperaDriver is shut down. |
static String |
NO_RESTART
(Boolean) Whether to restart. |
protected Set<Integer> |
objectIds
|
static String |
OPERAIDLE
(Boolean) Whether to use Opera's alternative implicit wait implementation. |
static String |
PORT
(Integer) The port to Opera should connect to. |
static String |
PRODUCT
(String) The product we are using, for example "desktop" or "core". |
static String |
PROFILE
(Object) Directory to use for the Opera profile. |
protected OperaRunner |
runner
|
protected ScopeServices |
services
|
protected IWindowManager |
windowManager
|
| Constructor Summary | |
|---|---|
OperaDriver()
Constructor that starts Opera with the default set of capabilities. |
|
OperaDriver(org.openqa.selenium.Capabilities c)
Starts Opera with the given set of desired capabilities. |
|
OperaDriver(OperaProfile profile)
Starts Opera with the given profile. |
|
| Method Summary | ||
|---|---|---|
void |
close()
|
|
Object |
executeAsyncScript(String script,
Object... args)
|
|
Object |
executeScript(String script,
Object... args)
|
|
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by)
|
|
protected org.openqa.selenium.WebElement |
findElement(String by,
String using)
|
|
protected org.openqa.selenium.WebElement |
findElement(String by,
String using,
OperaWebElement el)
Find a single element using the selenium atoms. |
|
org.openqa.selenium.WebElement |
findElementByName(String using)
|
|
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by)
|
|
protected List<org.openqa.selenium.WebElement> |
findElements(String by,
String using)
|
|
protected List<org.openqa.selenium.WebElement> |
findElements(String by,
String using,
OperaWebElement el)
|
|
List<org.openqa.selenium.WebElement> |
findElementsByName(String using)
|
|
void |
get(String url)
|
|
int |
get(String url,
long timeout)
|
|
org.openqa.selenium.Capabilities |
getCapabilities()
|
|
String |
getCurrentUrl()
|
|
protected static org.openqa.selenium.Capabilities |
getDefaultCapabilities()
Gets the default capabilities of OperaDriver. |
|
protected IOperaExec |
getExecService()
|
|
org.openqa.selenium.Keyboard |
getKeyboard()
|
|
org.openqa.selenium.Mouse |
getMouse()
|
|
Set<String> |
getOperaActionList()
Deprecated. |
|
String |
getPageSource()
Get the source of the last loaded page. |
|
String |
getPref(String section,
String key)
Deprecated. Please use preferences() instead |
|
protected ScopeServices |
getScopeServices()
|
|
|
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
|
|
protected IEcmaScriptDebugger |
getScriptDebugger()
|
|
protected Map<String,String> |
getServicesList()
|
|
String |
getTitle()
|
|
String |
getVersion()
Returns the version number of driver. |
|
int |
getWindowCount()
|
|
String |
getWindowHandle()
|
|
Set<String> |
getWindowHandles()
|
|
protected boolean |
hasTimeRemaining(long start)
|
|
protected void |
init()
Initialise all the Scope services that we need. |
|
protected boolean |
isOperaIdleAvailable()
Whether idle functionality is available. |
|
List<String> |
listFrames()
Gets a list of frames. |
|
OperaDriver.OperaOptions |
manage()
|
|
org.openqa.selenium.WebDriver.Navigation |
navigate()
|
|
void |
operaAction(String using,
String... params)
Deprecated. |
|
OperaScopePreferences |
preferences()
Returns an interface for manipulating the preferences in the currently attached Opera programmatically. |
|
protected List<org.openqa.selenium.WebElement> |
processElements(Integer id)
|
|
void |
quit()
|
|
ScreenShotReply |
saveScreenshot(long timeout,
String... hashes)
Takes a screenshot of the whole screen, including areas outside of the Opera browser window. |
|
String |
selftest(List<String> modules,
long timeout)
Executes selftests for the given module. |
|
void |
setPref(String section,
String key,
String value)
Deprecated. Please use preferences() instead |
|
protected void |
setUseOperaIdle(boolean useIdle)
Enable or disable idle functionality during runtime. |
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo()
|
|
OperaDriver.OperaUtils |
utils()
Gets the OperaDriver.OperaUtils interface which is used for accessing the browser's
meta- and utility information, such as the operating system it's running on, its user agent
string, &c. |
|
protected void |
waitForLoadToComplete()
|
|
| Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver |
|---|
execute, execute, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, getCommandExecutor, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getSessionId, log, setCommandExecutor, setElementConverter, setFileDetector, setLogLevel, setSessionId, startClient, startSession, stopClient |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOGGING_LEVEL
public static final String LOGGING_FILE
public static final String BINARY
/usr/bin/opera or C:\Program
Files\Opera\opera.exe).
public static final String ARGUMENTS
opera -help for
available command-line switches.
public static final String HOST
public static final String PORT
public static final String LAUNCHER
public static final String PROFILE
OperaProfile object that will be
used when starting opera. If null a random temporary directory is used. If "", an empty string,
then the default .autotest profile directory will be used (for backwards
compatibility with Opera < 11.60).
public static final String OPERAIDLE
public static final String DISPLAY
public static final String AUTOSTART
public static final String NO_RESTART
public static final String NO_QUIT
public static final String GUESS_BINARY_PATH
opera.binary.
public static final String PRODUCT
@Deprecated public static final String BACKEND
protected org.openqa.selenium.remote.DesiredCapabilities capabilities
protected OperaRunner runner
protected IEcmaScriptDebugger debugger
protected IOperaExec exec
protected IWindowManager windowManager
protected ICoreUtils coreUtils
protected ICookieManager cookieManager
protected ScopeServices services
protected ScopeActions actionHandler
protected final Logger logger
protected Set<Integer> objectIds
| Constructor Detail |
|---|
public OperaDriver()
public OperaDriver(OperaProfile profile)
profile - the profile to start Opera withpublic OperaDriver(org.openqa.selenium.Capabilities c)
c - a DesiredCapabilities object containing various settings for the driver and
the browser| Method Detail |
|---|
protected static org.openqa.selenium.Capabilities getDefaultCapabilities()
protected void init()
protected Map<String,String> getServicesList()
public org.openqa.selenium.Capabilities getCapabilities()
getCapabilities in interface org.openqa.selenium.HasCapabilitiesgetCapabilities in class org.openqa.selenium.remote.RemoteWebDriverpublic void quit()
quit in interface org.openqa.selenium.WebDriverquit in class org.openqa.selenium.remote.RemoteWebDriverpublic void get(String url)
get in interface org.openqa.selenium.WebDriverget in class org.openqa.selenium.remote.RemoteWebDriver
public int get(String url,
long timeout)
public String getCurrentUrl()
getCurrentUrl in interface org.openqa.selenium.WebDrivergetCurrentUrl in class org.openqa.selenium.remote.RemoteWebDriverpublic void close()
close in interface org.openqa.selenium.WebDriverclose in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverfindElement in class org.openqa.selenium.remote.RemoteWebDriver
protected org.openqa.selenium.WebElement findElement(String by,
String using)
findElement in class org.openqa.selenium.remote.RemoteWebDriver
protected org.openqa.selenium.WebElement findElement(String by,
String using,
OperaWebElement el)
by - how to find the element, strings defined in RemoteWebDriverusing - the value to use to find the elementel - the element to search within
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebDriverfindElements in class org.openqa.selenium.remote.RemoteWebDriver
protected List<org.openqa.selenium.WebElement> findElements(String by,
String using)
findElements in class org.openqa.selenium.remote.RemoteWebDriver
protected List<org.openqa.selenium.WebElement> findElements(String by,
String using,
OperaWebElement el)
public String getPageSource()
getPageSource in interface org.openqa.selenium.WebDrivergetPageSource in class org.openqa.selenium.remote.RemoteWebDriverpublic String getTitle()
getTitle in interface org.openqa.selenium.WebDrivergetTitle in class org.openqa.selenium.remote.RemoteWebDriverpublic String getWindowHandle()
getWindowHandle in interface org.openqa.selenium.WebDrivergetWindowHandle in class org.openqa.selenium.remote.RemoteWebDriverpublic Set<String> getWindowHandles()
getWindowHandles in interface org.openqa.selenium.WebDrivergetWindowHandles in class org.openqa.selenium.remote.RemoteWebDriverpublic int getWindowCount()
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo in interface org.openqa.selenium.WebDriverswitchTo in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.WebElement findElementByName(String using)
findElementByName in interface org.openqa.selenium.internal.FindsByNamefindElementByName in class org.openqa.selenium.remote.RemoteWebDriverpublic List<org.openqa.selenium.WebElement> findElementsByName(String using)
findElementsByName in interface org.openqa.selenium.internal.FindsByNamefindElementsByName in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.WebDriver.Navigation navigate()
navigate in interface org.openqa.selenium.WebDrivernavigate in class org.openqa.selenium.remote.RemoteWebDriverpublic OperaDriver.OperaOptions manage()
manage in interface org.openqa.selenium.WebDrivermanage in class org.openqa.selenium.remote.RemoteWebDriver
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
throws org.openqa.selenium.WebDriverException
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotorg.openqa.selenium.WebDriverException
public Object executeScript(String script,
Object... args)
executeScript in interface org.openqa.selenium.JavascriptExecutorexecuteScript in class org.openqa.selenium.remote.RemoteWebDriver
public Object executeAsyncScript(String script,
Object... args)
executeAsyncScript in interface org.openqa.selenium.JavascriptExecutorexecuteAsyncScript in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.Keyboard getKeyboard()
getKeyboard in interface org.openqa.selenium.HasInputDevicesgetKeyboard in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.Mouse getMouse()
getMouse in interface org.openqa.selenium.HasInputDevicesgetMouse in class org.openqa.selenium.remote.RemoteWebDriverpublic List<String> listFrames()
public ScreenShotReply saveScreenshot(long timeout,
String... hashes)
timeout - the number of milliseconds to wait before taking the screenshothashes - A previous screenshot MD5 hash. If it matches the hash of this screenshot then
no image data is returned.
public String getVersion()
public OperaScopePreferences preferences()
opera:config.
@Deprecated
public void setPref(String section,
String key,
String value)
preferences() instead
section - the section name, can be case-insensitivekey - the key name, can be case-insensitivevalue - the new value (will be treated as a String in Opera
@Deprecated
public String getPref(String section,
String key)
preferences() instead
section - the section name, can be case-insensitivekey - the key name, can be case-insensitive
public OperaDriver.OperaUtils utils()
OperaDriver.OperaUtils interface which is used for accessing the browser's
meta- and utility information, such as the operating system it's running on, its user agent
string, &c.
public String selftest(List<String> modules,
long timeout)
modules - the list of modules to run selftests fortimeout - the time out before aborting the operation
@Deprecated
public void operaAction(String using,
String... params)
getOperaActionList().
using - the action to perform.params - parameters to pass to the action call@Deprecated public Set<String> getOperaActionList()
protected IEcmaScriptDebugger getScriptDebugger()
protected IOperaExec getExecService()
protected ScopeServices getScopeServices()
protected boolean hasTimeRemaining(long start)
protected List<org.openqa.selenium.WebElement> processElements(Integer id)
protected void waitForLoadToComplete()
throws ResponseNotReceivedException
ResponseNotReceivedExceptionprotected boolean isOperaIdleAvailable()
protected void setUseOperaIdle(boolean useIdle)
useIdle - true if idle should be switched on, false if it should be switched off
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||