|
||||||||||
| 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.OperaTimeouts
|
class |
OperaDriver.OperaUtils
|
| Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver |
|---|
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, 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 |
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. |
protected IPrefs |
prefs
|
static String |
PRODUCT
(String) The product we are using, for example "desktop" or "core". |
static String |
PROFILE
(String) 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)
Constructor that starts Opera with a set of desired capabilities. |
|
OperaDriver(OperaDriverSettings settings)
Deprecated. |
|
| Method Summary | ||
|---|---|---|
void |
close()
|
|
protected String |
escapeJsString(String string)
Escape characters for safe insertion in a Javascript string contained by double quotes ("). |
|
void |
executeActions(OperaAction action)
Deprecated. |
|
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()
|
|
static org.openqa.selenium.Capabilities |
getDefaultCapabilities()
Gets the default capabilities of OperaDriver. |
|
String |
getDefaultPref(String section,
String key)
Gets the default value of the requested preference. |
|
protected IOperaExec |
getExecService()
|
|
org.openqa.selenium.Keyboard |
getKeyboard()
|
|
org.openqa.selenium.Mouse |
getMouse()
|
|
String |
getPageSource()
Get the source of the last loaded page. |
|
String |
getPref(String section,
String key)
Get the value of the requested preference. |
|
OperaRunner |
getRunner()
Deprecated. |
|
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 IWindowManager |
getWindowManager()
|
|
protected boolean |
hasTimeRemaining(long start)
|
|
protected void |
init()
Initialise all the Scope services that we need. |
|
boolean |
isJavascriptEnabled()
Is JavaScript enables in this driver? |
|
boolean |
isOperaIdleAvailable()
|
|
void |
key(String key)
Presses and releases the given key. |
|
void |
keyDown(String key)
Presses and holds the given key. |
|
void |
keyUp(String key)
Releases the given key. |
|
Map<String,Map<String,PrefsProtos.Pref>> |
listAllPrefs()
Returns a Map of sections names mapping to a Map of preference names mapping to Pref objects. |
|
List<String> |
listFrames()
|
|
Map<String,PrefsProtos.Pref> |
listPrefs(boolean sort,
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(String using,
String... params)
Performs a special action, such as setting an Opera preference. |
|
protected List<org.openqa.selenium.WebElement> |
processElements(Integer id)
|
|
void |
quit()
|
|
void |
releaseKeys()
Releases all the currently pressed keys. |
|
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)
|
|
void |
setPref(String section,
String key,
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(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, getFileDetector, getSessionId, log, newRemoteWebElement, setCommandExecutor, setElementConverter, setFileDetector, 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
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
protected org.openqa.selenium.remote.DesiredCapabilities capabilities
protected OperaRunner runner
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 Logger logger
protected Set<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 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 withinpublic 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 List<String> listFrames()
protected String escapeJsString(String string)
string - the string to escape
protected List<org.openqa.selenium.WebElement> processElements(Integer id)
public void waitForLoadToComplete()
public 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 org.openqa.selenium.WebDriver.Options manage()
manage in interface org.openqa.selenium.WebDrivermanage in class org.openqa.selenium.remote.RemoteWebDriver
public void operaAction(String using,
String... params)
using - The action to perform. For a list of actions call getOperaActionList()
at run timeparams - Parameters to pass to the action callprotected boolean hasTimeRemaining(long start)
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 <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 Object executeScript(String script,
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(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(String key)
key - the key to press, see key(String) for more information.public void keyUp(String key)
key - the key to release, see key(String) for more information.public void releaseKeys()
public void type(String using)
key(String).
using - the string to typepublic String getVersion()
protected IEcmaScriptDebugger getScriptDebugger()
protected IOperaExec getExecService()
protected IWindowManager getWindowManager()
protected ScopeServices getScopeServices()
public String getPref(String section,
String key)
section - the section the preference is inkey - the key name of the preference to get
public String getDefaultPref(String section,
String key)
section - the section the preference is inkey - the key name of the preference
public Map<String,PrefsProtos.Pref> listPrefs(boolean sort,
String section)
sort - whether to alphabetically sort the preference keyssection - the section to retrieve the preferences from
public Map<String,Map<String,PrefsProtos.Pref>> listAllPrefs()
public void setPref(String section,
String key,
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 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.RemoteWebDriver
public String selftest(List<String> modules,
long timeout)
public Utils utils()
@Deprecated public OperaRunner getRunner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||