T
- the required type of class which implement
WebElement
.
Instances of the defined type will be returned via findElement* and findElements*.
Warning (!!!). Allowed types:
WebElement
RemoteWebElement
MobileElement
IOSElement
public class IOSDriver<T extends WebElement> extends AppiumDriver<T> implements HidesKeyboardWithKeyName, ShakesDevice, FindsByIosUIAutomation<T>, LocksIOSDevice, PerformsTouchID, FindsByIosNSPredicate<T>, FindsByIosClassChain<T>
org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.When
WebDriver.ImeHandler, WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts, WebDriver.Window
Constructor and Description |
---|
IOSDriver(AppiumCommandExecutor executor,
org.openqa.selenium.Capabilities capabilities) |
IOSDriver(AppiumDriverLocalService service,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(AppiumDriverLocalService service,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(AppiumServiceBuilder builder,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(AppiumServiceBuilder builder,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(java.net.URL remoteAddress,
org.openqa.selenium.Capabilities desiredCapabilities) |
IOSDriver(java.net.URL remoteAddress,
org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory,
org.openqa.selenium.Capabilities desiredCapabilities) |
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.remote.Response |
execute(java.lang.String command)
Executes JSONWP command and returns a response.
|
org.openqa.selenium.remote.Response |
execute(java.lang.String driverCommand,
java.util.Map<java.lang.String,?> parameters)
Executes JSONWP command and returns a response.
|
T |
findElement(org.openqa.selenium.By by)
Find the first
WebElement using the given method. |
T |
findElement(java.lang.String by,
java.lang.String using)
Method performs the searching for a single element by some selector defined by string
and value of the given selector
|
T |
findElementByClassName(java.lang.String using) |
T |
findElementByCssSelector(java.lang.String using) |
T |
findElementById(java.lang.String id) |
T |
findElementByLinkText(java.lang.String using) |
T |
findElementByName(java.lang.String using) |
T |
findElementByPartialLinkText(java.lang.String using) |
T |
findElementByTagName(java.lang.String using) |
T |
findElementByXPath(java.lang.String using) |
org.openqa.selenium.interactions.Mouse |
getMouse()
Deprecated.
|
void |
runAppInBackground(int seconds)
Runs the current app as a background app for the number of seconds
or minimizes the app
|
void |
swipe(int startx,
int starty,
int endx,
int endy,
int duration)
This method is deprecated.
|
WebDriver.TargetLocator |
switchTo()
Send future commands to a different frame or window.
|
context, findElements, findElements, findElementsByAccessibilityId, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, getAutomationName, getContext, getContextHandles, getExecuteMethod, getOrientation, getPlatformName, getRemoteAddress, isBrowser, location, pinch, pinch, rotate, rotate, rotation, setLocation, substituteMobilePlatform, tap, tap, zoom, zoom
close, executeAsyncScript, executeScript, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getFileDetector, getKeyboard, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, perform, quit, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, startClient, startClient, startClient, startSession, startSession, stopClient, stopClient, stopClient, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
hideKeyboard, hideKeyboard
hideKeyboard
execute, execute
shake
findElementByIosUIAutomation, findElementsByIosUIAutomation
lockDevice, lockDevice
performTouchID
findElementByIosNsPredicate, findElementsByIosNsPredicate
findElementByIosClassChain, findElementsByIosClassChain
findElement, findElements
close, get, getCurrentUrl, getPageSource, getTitle, getWindowHandle, getWindowHandles, manage, navigate, quit
performMultiTouchAction, performTouchAction
findElementByAccessibilityId
getDeviceTime
pullFile, pullFolder
closeApp, installApp, isAppInstalled, launchApp, removeApp, resetApp, runAppInBackground
getAppStringMap, getAppStringMap, getAppStringMap
getSessionDetail, getSessionDetails
public IOSDriver(AppiumCommandExecutor executor, org.openqa.selenium.Capabilities capabilities)
executor
- is an instance of HttpCommandExecutor
or class that extends it. Default commands or another vendor-specific
commands may be specified there.capabilities
- take a look
at Capabilities
public IOSDriver(java.net.URL remoteAddress, org.openqa.selenium.Capabilities desiredCapabilities)
remoteAddress
- is the address
of remotely/locally started Appium serverdesiredCapabilities
- take a look
at Capabilities
public IOSDriver(java.net.URL remoteAddress, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities)
remoteAddress
- is the address
of remotely/locally started Appium serverhttpClientFactory
- take a look
at HttpClient.Factory
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(AppiumDriverLocalService service, org.openqa.selenium.Capabilities desiredCapabilities)
service
- take a look
at AppiumDriverLocalService
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(AppiumDriverLocalService service, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities)
service
- take a look
at AppiumDriverLocalService
httpClientFactory
- take a look
at HttpClient.Factory
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(AppiumServiceBuilder builder, org.openqa.selenium.Capabilities desiredCapabilities)
builder
- take a look
at AppiumServiceBuilder
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(AppiumServiceBuilder builder, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities)
builder
- take a look
at AppiumServiceBuilder
httpClientFactory
- take a look
at HttpClient.Factory
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory, org.openqa.selenium.Capabilities desiredCapabilities)
httpClientFactory
- take a look
at HttpClient.Factory
desiredCapabilities
- take a look
at Capabilities
public IOSDriver(org.openqa.selenium.Capabilities desiredCapabilities)
desiredCapabilities
- take a look
at Capabilities
public void swipe(int startx, int starty, int endx, int endy, int duration)
swipe
in class AppiumDriver<T extends WebElement>
public void runAppInBackground(int seconds)
runAppInBackground
in interface InteractsWithApps
seconds
- if seconds >= 0: Number of seconds to run App in background.
This method call will block main thread and restore the application under
test after the timeout expires.
if seconds < 0: any negative number of seconds will put the application
under test into background and return immediately, so iOS dashboard
will remain on-screen (this, actually, simulates click on Home button)public WebDriver.TargetLocator switchTo()
WebDriver
switchTo
in interface WebDriver
switchTo
in class org.openqa.selenium.remote.RemoteWebDriver
WebDriver.TargetLocator
public org.openqa.selenium.remote.Response execute(java.lang.String driverCommand, java.util.Map<java.lang.String,?> parameters)
ExecutesMethod
execute
in interface ExecutesMethod
execute
in class org.openqa.selenium.remote.RemoteWebDriver
driverCommand
- a JSONWP commandparameters
- map of command parameterspublic org.openqa.selenium.remote.Response execute(java.lang.String command)
ExecutesMethod
execute
in interface ExecutesMethod
execute
in class org.openqa.selenium.remote.RemoteWebDriver
command
- a JSONWP commandpublic T findElement(org.openqa.selenium.By by)
WebDriver
WebElement
using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.
findElement should not be used to look for non-present elements, use WebDriver.findElements(By)
and assert zero length response instead.findElement
in interface MobileDriver<T extends WebElement>
findElement
in interface SearchContext
findElement
in interface WebDriver
findElement
in class org.openqa.selenium.remote.RemoteWebDriver
by
- The locating mechanismBy
,
WebDriver.Timeouts
public T findElement(java.lang.String by, java.lang.String using)
FindsByFluentSelector
findElement
in interface FindsByFluentSelector<T extends WebElement>
findElement
in class org.openqa.selenium.remote.RemoteWebDriver
by
- is a string selectorusing
- is a value of the given selectorpublic T findElementById(java.lang.String id)
findElementById
in interface MobileDriver<T extends WebElement>
findElementById
in interface FindsById
findElementById
in class org.openqa.selenium.remote.RemoteWebDriver
public T findElementByLinkText(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByLinkText
in interface MobileDriver<T extends WebElement>
findElementByLinkText
in interface FindsByLinkText
findElementByLinkText
in class org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.WebDriverException
- his method doesn't work against native app UI.public T findElementByPartialLinkText(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByPartialLinkText
in interface MobileDriver<T extends WebElement>
findElementByPartialLinkText
in interface FindsByLinkText
findElementByPartialLinkText
in class org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.WebDriverException
- his method doesn't work against native app UI.public T findElementByTagName(java.lang.String using)
findElementByTagName
in interface MobileDriver<T extends WebElement>
findElementByTagName
in interface FindsByTagName
findElementByTagName
in class org.openqa.selenium.remote.RemoteWebDriver
public T findElementByName(java.lang.String using)
findElementByName
in interface MobileDriver<T extends WebElement>
findElementByName
in interface FindsByName
findElementByName
in class org.openqa.selenium.remote.RemoteWebDriver
public T findElementByClassName(java.lang.String using)
findElementByClassName
in interface MobileDriver<T extends WebElement>
findElementByClassName
in interface FindsByClassName
findElementByClassName
in class org.openqa.selenium.remote.RemoteWebDriver
public T findElementByCssSelector(java.lang.String using) throws org.openqa.selenium.WebDriverException
findElementByCssSelector
in interface MobileDriver<T extends WebElement>
findElementByCssSelector
in interface FindsByCssSelector
findElementByCssSelector
in class org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.WebDriverException
- his method doesn't work against native app UI.public T findElementByXPath(java.lang.String using)
findElementByXPath
in interface MobileDriver<T extends WebElement>
findElementByXPath
in interface FindsByXPath
findElementByXPath
in class org.openqa.selenium.remote.RemoteWebDriver
@Deprecated public org.openqa.selenium.interactions.Mouse getMouse()
getMouse
in interface org.openqa.selenium.interactions.HasInputDevices
getMouse
in class org.openqa.selenium.remote.RemoteWebDriver