public class OperaDriver extends org.openqa.selenium.remote.RemoteWebDriver implements org.openqa.selenium.TakesScreenshot, RunsSelftest, CapturesScreen
| Modifier and Type | Class and Description |
|---|---|
class |
OperaDriver.OperaOptions |
static class |
OperaDriver.PrivateData
Different types of data stored by Opera.
|
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.Whenorg.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| Modifier and Type | Field and Description |
|---|---|
protected static FileHandler |
logFile |
protected static OperaLogs |
logs |
protected Set<Integer> |
objectIds |
protected OperaRunner |
runner |
protected OperaSettings |
settings |
| Constructor and Description |
|---|
OperaDriver()
Constructor that starts Opera with the default set of capabilities.
|
OperaDriver(org.openqa.selenium.Capabilities capabilities)
Starts Opera with the given set of desired capabilities.
|
OperaDriver(OperaProfile profile)
Starts Opera with the given profile.
|
OperaDriver(OperaSettings settings)
Starts Opera with the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertConnected() |
protected void |
assertConnected(String message) |
ScreenCaptureReply |
captureScreen()
Takes a screen capture of the whole screen, including the areas outside of the viewport and the
browser window.
|
ScreenCaptureReply |
captureScreen(long timeout)
Takes a screen capture of the whole screen, including the areas outside of the viewport and the
browser window.
|
ScreenCaptureReply |
captureScreen(long timeout,
List<String> hashes)
Takes a screen capture of the whole screen, including the areas outside of the viewport and the
browser window.
|
void |
close() |
Object |
executeAsyncScript(String script,
Object... args) |
Object |
executeScript(String script,
Object... args) |
void |
finalize() |
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 Debugger |
getDebugger() |
org.openqa.selenium.interactions.Keyboard |
getKeyboard() |
org.openqa.selenium.interactions.Mouse |
getMouse() |
Set<String> |
getOperaActionList()
Deprecated.
|
String |
getPageSource()
Get the source of the last loaded page.
|
protected SortedSet<ScopeService> |
getRequiredServices()
A sorted set of required services for this OperaDriver to function.
|
protected ScopeServices |
getScopeServices() |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> target) |
String |
getTitle() |
int |
getWindowCount() |
String |
getWindowHandle() |
Set<String> |
getWindowHandles() |
protected <X> X |
implicitlyWaitFor(Callable<X> condition)
Implicitly wait for an element to become visible.
|
protected void |
init()
Initialize required Scope services.
|
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) |
OperaProxy |
proxy() |
void |
quit() |
List<Selftest.SelftestResult> |
selftest(Set<String> modules) |
List<Selftest.SelftestResult> |
selftest(Set<String> modules,
String groupPattern) |
List<Selftest.SelftestResult> |
selftest(Set<String> modules,
String groupPattern,
String excludePattern)
Makes a collection of selftests based on the parameters in and runs them.
|
protected void |
setUseOperaIdle(boolean enabled)
Enable or disable idle functionality during runtime.
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
OperaUtils |
utils() |
protected void |
waitForLoadToComplete() |
execute, execute, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, getCommandExecutor, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getRemoteStatus, getSessionId, log, setCommandExecutor, setElementConverter, setFileDetector, setFoundBy, setLogLevel, setSessionId, startClient, startSession, startSession, stopClient, toStringprotected final OperaSettings settings
protected OperaRunner runner
protected static final OperaLogs logs
protected static FileHandler logFile
public OperaDriver()
public OperaDriver(OperaProfile profile)
profile - the profile to start Opera withpublic OperaDriver(org.openqa.selenium.Capabilities capabilities)
capabilities - a DesiredCapabilities object containing various settings for the
driver and the browserpublic OperaDriver(OperaSettings settings)
settings - Opera specific settingsprotected void init()
protected SortedSet<ScopeService> getRequiredServices()
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 finalize()
throws Throwable
public void get(String url)
get in interface org.openqa.selenium.WebDriverget in class org.openqa.selenium.remote.RemoteWebDriverpublic 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.RemoteWebDriverprotected org.openqa.selenium.WebElement findElement(String by, String using)
findElement in class org.openqa.selenium.remote.RemoteWebDriverprotected 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.RemoteWebDriverprotected List<org.openqa.selenium.WebElement> findElements(String by, String using)
findElements in class org.openqa.selenium.remote.RemoteWebDriverprotected 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.RemoteWebDriverpublic <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
throws org.openqa.selenium.WebDriverException
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotorg.openqa.selenium.WebDriverExceptionpublic Object executeScript(String script, Object... args)
executeScript in interface org.openqa.selenium.JavascriptExecutorexecuteScript in class org.openqa.selenium.remote.RemoteWebDriverpublic Object executeAsyncScript(String script, Object... args)
executeAsyncScript in interface org.openqa.selenium.JavascriptExecutorexecuteAsyncScript in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.interactions.Keyboard getKeyboard()
getKeyboard in interface org.openqa.selenium.interactions.HasInputDevicesgetKeyboard in class org.openqa.selenium.remote.RemoteWebDriverpublic org.openqa.selenium.interactions.Mouse getMouse()
getMouse in interface org.openqa.selenium.interactions.HasInputDevicesgetMouse in class org.openqa.selenium.remote.RemoteWebDriverpublic OperaProxy proxy()
public ScreenCaptureReply captureScreen()
CapturesScreencaptureScreen in interface CapturesScreenpublic ScreenCaptureReply captureScreen(long timeout)
CapturesScreencaptureScreen in interface CapturesScreentimeout - the number of milliseconds to wait before taking the screenshotpublic ScreenCaptureReply captureScreen(long timeout, List<String> hashes)
CapturesScreencaptureScreen in interface CapturesScreentimeout - the number of milliseconds to wait before taking the screenshothashes - a list of previous screenshots' MD5 hashes; if they match the hash of this
screenshot then no image data is returnedpublic OperaScopePreferences preferences()
opera:config.public OperaUtils utils()
public List<Selftest.SelftestResult> selftest(Set<String> modules)
RunsSelftestselftest in interface RunsSelftestmodules - a set of modules to run the selftests ofpublic List<Selftest.SelftestResult> selftest(Set<String> modules, String groupPattern)
RunsSelftestselftest in interface RunsSelftestmodules - a set of modules to run the selftests ofgroupPattern - glob-style pattern to match specific test groups (ie. "group:testname*")public List<Selftest.SelftestResult> selftest(Set<String> modules, String groupPattern, String excludePattern)
RunsSelftestOperaIntervals.SELFTEST_TIMEOUT is reached.selftest in interface RunsSelftestmodules - a set of modules to run the selftests ofgroupPattern - glob-style pattern to match specific test groups (ie. "group:testname*")excludePattern - glob-style pattern to create an exclusion rule as in `groupPattern`@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 Debugger getDebugger()
protected ScopeServices getScopeServices()
protected void waitForLoadToComplete()
throws ResponseNotReceivedException
ResponseNotReceivedExceptionprotected <X> X implicitlyWaitFor(Callable<X> condition)
OperaIntervals.POLL_INTERVAL until OperaIntervals.IMPLICIT_WAIT is reached for callable condition to be true.X - computes a result, or throws an exception if unable to do socondition - a callable implementationprotected void assertConnected()
protected void assertConnected(String message)
protected void setUseOperaIdle(boolean enabled)
enabled - true if idle should be switched on, false if it should be switched offCopyright © 2013. All Rights Reserved.