|
||||||||||
| 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.OperaUtils
|
| Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver |
|---|
org.openqa.selenium.remote.RemoteWebDriver.RemoteMouse, org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions |
| 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 |
| Field Summary | |
|---|---|
protected ScopeActions |
actionHandler
|
static java.lang.String |
ARGUMENTS
(String) Arguments to pass to Opera, separated by spaces. |
static java.lang.String |
AUTOSTART
(Boolean) Whether to auto-start the Opera binary. |
static java.lang.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 java.lang.String |
DISPLAY
(Integer) The X display to use. |
protected IOperaExec |
exec
|
static java.lang.String |
GUESS_BINARY_PATH
(Boolean) Whether to guess the path to Opera if it isn't set in opera.binary. |
static java.lang.String |
HOST
(String) The host Opera should connect to. |
static java.lang.String |
LAUNCHER
(String) Path to the launcher binary to use. |
protected java.util.logging.Logger |
logger
|
static java.lang.String |
LOGGING_FILE
(String) Where to send the output of the logging. |
static java.lang.String |
LOGGING_LEVEL
(String) How verbose the logging should be. |
static java.lang.String |
NO_QUIT
(Boolean) Whether to quit Opera when OperaDriver is shut down. |
static java.lang.String |
NO_RESTART
(Boolean) Whether to restart. |
protected java.util.Set<java.lang.Integer> |
objectIds
|
static java.lang.String |
OPERAIDLE
(Boolean) Whether to use Opera's alternative implicit wait implementation. |
protected OperaRunner |
operaRunner
|
static java.lang.String |
PORT
(Integer) The port to Opera should connect to. |
protected IPrefs |
prefs
|
static java.lang.String |
PRODUCT
(String) The profile configuration we are using, for example "desktop" or "core-gogi". |
static java.lang.String |
PROFILE
(String) Directory to use for the Opera profile. |
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)
Constructor that starts Opera with a set of desired capabilities. |
|
OperaDriver(OperaDriverSettings settings)
Deprecated. |
|
| Method Summary | ||
|---|---|---|
void |
close()
|
|
protected java.lang.String |
escapeJsString(java.lang.String string)
Escape characters for safe insertion in a Javascript string contained by double quotes ("). |
|
void |
executeActions(OperaAction action)
Deprecated. |
|
java.lang.Object |
executeAsyncScript(java.lang.String script,
java.lang.Object... args)
|
|
java.lang.Object |
executeScript(java.lang.String script,
java.lang.Object... args)
|
|
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by)
|
|
protected org.openqa.selenium.WebElement |
findElement(java.lang.String by,
java.lang.String using)
|
|
protected org.openqa.selenium.WebElement |
findElement(java.lang.String by,
java.lang.String using,
OperaWebElement el)
Find a single element using the selenium atoms. |
|
org.openqa.selenium.WebElement |
findElementByName(java.lang.String using)
|
|
java.util.List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by)
|
|
protected java.util.List<org.openqa.selenium.WebElement> |
findElements(java.lang.String by,
java.lang.String using)
|
|
protected java.util.List<org.openqa.selenium.WebElement> |
findElements(java.lang.String by,
java.lang.String using,
OperaWebElement el)
|
|
java.util.List<org.openqa.selenium.WebElement> |
findElementsByName(java.lang.String using)
|
|
void |
get(java.lang.String url)
|
|
int |
get(java.lang.String url,
long timeout)
|
|
org.openqa.selenium.Capabilities |
getCapabilities()
|
|
java.lang.String |
getCurrentUrl()
|
|
static org.openqa.selenium.Capabilities |
getDefaultCapabilities()
Gets the default capabilities of OperaDriver. |
|
java.lang.String |
getDefaultPref(java.lang.String section,
java.lang.String key)
Gets the default value of the requested preference. |
|
protected IOperaExec |
getExecService()
|
|
org.openqa.selenium.Keyboard |
getKeyboard()
|
|
org.openqa.selenium.Mouse |
getMouse()
|
|
OperaRunner |
getOperaRunner()
Deprecated. |
|
java.lang.String |
getPageSource()
Get the source of the last loaded page. |
|
java.lang.String |
getPref(java.lang.String section,
java.lang.String key)
Get the value of the requested preference. |
|
protected ScopeServices |
getScopeServices()
|
|
|
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
|
|
protected IEcmaScriptDebugger |
getScriptDebugger()
|
|
protected java.util.Map<java.lang.String,java.lang.String> |
getServicesList()
|
|
java.lang.String |
getTitle()
|
|
java.lang.String |
getVersion()
Returns the version number of driver. |
|
int |
getWindowCount()
|
|
java.lang.String |
getWindowHandle()
|
|
java.util.Set<java.lang.String> |
getWindowHandles()
|
|
protected IWindowManager |
getWindowManager()
|
|
protected void |
init()
For testing override this method. |
|
boolean |
isJavascriptEnabled()
Is JavaScript enables in this driver? |
|
boolean |
isOperaIdleAvailable()
|
|
void |
key(java.lang.String key)
Presses and releases the given key. |
|
void |
keyDown(java.lang.String key)
Presses and holds the given key. |
|
void |
keyUp(java.lang.String key)
Releases the given key. |
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,PrefsProtos.Pref>> |
listAllPrefs()
Returns a Map of sections names mapping to a Map of preference names mapping to Pref objects. |
|
java.util.List<java.lang.String> |
listFrames()
|
|
java.util.Map<java.lang.String,PrefsProtos.Pref> |
listPrefs(boolean sort,
java.lang.String section)
Returns a Map of preference names to preferences in the requested section. |
|
org.openqa.selenium.WebDriver.Options |
manage()
|
|
org.openqa.selenium.WebDriver.Navigation |
navigate()
|
|
void |
operaAction(java.lang.String using,
java.lang.String... params)
Performs a special action, such as setting an Opera preference. |
|
protected java.util.List<org.openqa.selenium.WebElement> |
processElements(java.lang.Integer id)
|
|
void |
quit()
|
|
void |
releaseKeys()
Releases all the currently pressed keys. |
|
ScreenShotReply |
saveScreenshot(long timeout,
java.lang.String... hashes)
Takes a screenshot of the whole screen, including areas outside of the Opera browser window. |
|
java.lang.String |
selftest(java.util.List<java.lang.String> modules,
long timeout)
|
|
void |
setPref(java.lang.String section,
java.lang.String key,
java.lang.String value)
Set the value of a preference using section and key as locators. |
|
void |
setUseOperaIdle(boolean useIdle)
|
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo()
|
|
void |
type(java.lang.String using)
Types the given string as-is in to the browser window. |
|
Utils |
utils()
|
|
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, getSessionId, log, newRemoteWebElement, setCommandExecutor, setElementConverter, 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 java.lang.String LOGGING_LEVEL
public static final java.lang.String LOGGING_FILE
public static final java.lang.String BINARY
/usr/bin/opera or C:\Program
Files\Opera\opera.exe).
public static final java.lang.String ARGUMENTS
opera -help for
available command-line switches.
public static final java.lang.String HOST
public static final java.lang.String PORT
public static final java.lang.String LAUNCHER
public static final java.lang.String PROFILE
public static final java.lang.String OPERAIDLE
public static final java.lang.String DISPLAY
public static final java.lang.String AUTOSTART
public static final java.lang.String NO_RESTART
public static final java.lang.String NO_QUIT
public static final java.lang.String GUESS_BINARY_PATH
opera.binary.
public static final java.lang.String PRODUCT
protected org.openqa.selenium.remote.DesiredCapabilities capabilities
protected OperaRunner operaRunner
protected IEcmaScriptDebugger debugger
protected IOperaExec exec
protected IPrefs prefs
protected IWindowManager windowManager
protected ICoreUtils coreUtils
protected ICookieManager cookieManager
protected ScopeServices services
protected ScopeActions actionHandler
protected final java.util.logging.Logger logger
protected java.util.Set<java.lang.Integer> objectIds
| Constructor Detail |
|---|
public OperaDriver()
@Deprecated public OperaDriver(OperaDriverSettings settings)
public OperaDriver(org.openqa.selenium.Capabilities c)
c - a DesiredCapabilities object containing various settings for the driver and the
browser.| Method Detail |
|---|
public static org.openqa.selenium.Capabilities getDefaultCapabilities()
protected void init()
protected java.util.Map<java.lang.String,java.lang.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(java.lang.String url)
get in interface org.openqa.selenium.WebDriverget in class org.openqa.selenium.remote.RemoteWebDriver
public int get(java.lang.String url,
long timeout)
public java.lang.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(java.lang.String by,
java.lang.String using)
findElement in class org.openqa.selenium.remote.RemoteWebDriver
protected org.openqa.selenium.WebElement findElement(java.lang.String by,
java.lang.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 withinpublic java.util.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 java.util.List<org.openqa.selenium.WebElement> findElements(java.lang.String by,
java.lang.String using)
findElements in class org.openqa.selenium.remote.RemoteWebDriver
protected java.util.List<org.openqa.selenium.WebElement> findElements(java.lang.String by,
java.lang.String using,
OperaWebElement el)
public java.lang.String getPageSource()
getPageSource in interface org.openqa.selenium.WebDrivergetPageSource in class org.openqa.selenium.remote.RemoteWebDriverpublic java.lang.String getTitle()
getTitle in interface org.openqa.selenium.WebDrivergetTitle in class org.openqa.selenium.remote.RemoteWebDriverpublic java.lang.String getWindowHandle()
getWindowHandle in interface org.openqa.selenium.WebDrivergetWindowHandle in class org.openqa.selenium.remote.RemoteWebDriverpublic java.util.Set<java.lang.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 java.util.List<java.lang.String> listFrames()
protected java.lang.String escapeJsString(java.lang.String string)
string - the string to escape
protected java.util.List<org.openqa.selenium.WebElement> processElements(java.lang.Integer id)
public void waitForLoadToComplete()
public org.openqa.selenium.WebElement findElementByName(java.lang.String using)
findElementByName in interface org.openqa.selenium.internal.FindsByNamefindElementByName in class org.openqa.selenium.remote.RemoteWebDriverpublic java.util.List<org.openqa.selenium.WebElement> findElementsByName(java.lang.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 org.openqa.selenium.WebDriver.Options manage()
manage in interface org.openqa.selenium.WebDrivermanage in class org.openqa.selenium.remote.RemoteWebDriver
public void operaAction(java.lang.String using,
java.lang.String... params)
using - The action to perform. For a list of actions call getOperaActionList()
at run timeparams - Parameters to pass to the action call
public ScreenShotReply saveScreenshot(long timeout,
java.lang.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 <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
throws org.openqa.selenium.WebDriverException
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotorg.openqa.selenium.WebDriverExceptionpublic boolean isOperaIdleAvailable()
public void setUseOperaIdle(boolean useIdle)
public java.lang.Object executeScript(java.lang.String script,
java.lang.Object... args)
executeScript in interface org.openqa.selenium.JavascriptExecutorexecuteScript in class org.openqa.selenium.remote.RemoteWebDriverpublic boolean isJavascriptEnabled()
@Deprecated public void executeActions(OperaAction action)
action - a string identifying the Opera Action to use.public void key(java.lang.String key)
key - A string containing the key to press. This can be a single character (e.g. "a") or a
special key (e.g. "left"), and is matched case insensitively. For a list of keys
see OperaKeys.public void keyDown(java.lang.String key)
key - the key to press, see key(String) for more information.public void keyUp(java.lang.String key)
key - the key to release, see key(String) for more information.public void releaseKeys()
public void type(java.lang.String using)
key(String).
using - the string to typepublic java.lang.String getVersion()
protected IEcmaScriptDebugger getScriptDebugger()
protected IOperaExec getExecService()
protected IWindowManager getWindowManager()
protected ScopeServices getScopeServices()
public java.lang.String getPref(java.lang.String section,
java.lang.String key)
section - the section the preference is inkey - the key name of the preference to get
public java.lang.String getDefaultPref(java.lang.String section,
java.lang.String key)
section - the section the preference is inkey - the key name of the preference
public java.util.Map<java.lang.String,PrefsProtos.Pref> listPrefs(boolean sort,
java.lang.String section)
sort - whether to alphabetically sort the preference keyssection - the section to retrieve the preferences from
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,PrefsProtos.Pref>> listAllPrefs()
public void setPref(java.lang.String section,
java.lang.String key,
java.lang.String value)
section - the section the preference is inkey - the key name of the preference to setvalue - the value to set the preference to
public java.lang.Object executeAsyncScript(java.lang.String script,
java.lang.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.RemoteWebDriver
public java.lang.String selftest(java.util.List<java.lang.String> modules,
long timeout)
public Utils utils()
@Deprecated public OperaRunner getOperaRunner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||