AppiumDriver

This is a JavaScript wrapper for AppiumDriver of AppiumDotNet library.
https://github.com/appium/appium-dotnet-driver

Action Summary

Action Description
ActivateIMEEngine Activate the given IME on the device.
BackgroundApp Send the currently active app to the background, and either return after a certain amount of time, or leave the app deactivated.
ClearSessions Deletes active sessions on Appium server.
Close Close the Browser and Dispose of WebDriver.
CloseApp Close the application.
CreateAppiumDriver
CreateDesiredCapabilities
CreateDriverForSession Connects to active Appium session with given URL and Id.
DeactiveIMEEngine Deactivate the currently Active IME Engine on the device.
Dispose Dispose of WebDriver.
DumpSessions Prints information about active Appium sessions to output.
ExecuteScript Executes JavaScript in the context of the currently selected frame or window.
FindElementByAccessibilityId Search for an element using Accessibility ID.
FindElementByAndroidUIAutomator Search for an element using UIAutomator selector.
FindElementByClassName Finds the first element in the page that matches the CSS Class supplied.
FindElementByCssSelector Finds the first element matching the specified CSS selector.
FindElementById Finds the first element in the page that matches the ID supplied.
FindElementByIosUIAutomation Search for an element using UIAutomation selector.
FindElementByLinkText Finds the first of elements that match the link text supplied.
FindElementByName Finds the first of elements that match the name supplied.
FindElementByPartialLinkText Finds the first of elements that match the part of the link text supplied.
FindElementByTagName Finds the first of elements that match the DOM Tag supplied.
FindElementByXPath Finds the first of elements that match the XPath supplied.
FindElementsByAccessibilityId Search for all elements matching Accessibility ID.
FindElementsByAndroidUIAutomator Search for all elements using UIAutomator selector.
FindElementsByClassName Finds a list of elements that match the class name supplied.
FindElementsByCssSelector Finds all elements matching the specified CSS selector.
FindElementsById Finds the first element in the page that matches the ID supplied.
FindElementsByIosUIAutomation Search for all elements using UIAutomation selector.
FindElementsByLinkText Finds a list of elements that match the link text supplied.
FindElementsByName Finds a list of elements that match the name supplied.
FindElementsByPartialLinkText Finds a list of elements that match the part of the link text supplied.
FindElementsByTagName Finds a list of elements that match the DOM Tag supplied.
FindElementsByXPath Finds a list of elements that match the XPath supplied.
GetAddressOfRemoteServer
GetContext
GetContexts
GetCurrentActivity
GetCurrentWindowHandle Gets the current window handle, which is an opaque handle to this window that uniquely identifies it within this driver instance.
GetIMEActiveEngine
GetIMEAvailableEngines
GetOrientation
GetPageSource Gets the source of the page last loaded by the browser.
GetSessionId
GetTitle Gets the title of the current browser window.
GetUrl Gets the URL the browser is currently displaying.
GetWindowHandles Gets the window handles of open browser windows.
HideKeyboard
IgnoreUnimportantViews
InstallApp
IsAppInstalled
IsIMEActive
IsLocked
LaunchApp
OpenNotifications
PressKeyCode
PullFile
PushFile
Quit Disconnects from the Browser.
ReconnectSession Reads session information produced by SaveSession and connects to the mobile target.
RemoveApp
ResetApp
SaveSession Saves session information for use by ReconnectSession.
SetContext Sets current context.
SetOrientation Sets device orienataion.
SetUrl Sets the URL the browser is currently displaying.
ShakeDevice
StartActivity
ToggleAirplaneMode
ToggleLocationServices
ToggleWifi

Action Detail

ActivateIMEEngine(imeEngine)

Activate the given IME on the device.

Parameters:

Name Type Description
imeEngine string IME to activate

BackgroundApp(seconds)

Send the currently active app to the background, and either return after a certain amount of time, or leave the app deactivated.

Parameters:

Name Type Description
seconds number Timeout value

ClearSessions()

Deletes active sessions on Appium server.

Close()

Close the Browser and Dispose of WebDriver.

CloseApp()

Close the application.

CreateAppiumDriver(uri, caps)

Parameters:

Name Type Description
uri string
caps AppiumCapabilities

CreateDesiredCapabilities()

Returns:

AppiumCapabilities object.

CreateDriverForSession(addressOfRemoteServer, sessionId, suppressErrors)

Connects to active Appium session with given URL and Id.

Parameters:

Name Type Description
addressOfRemoteServer string Appium server URL.
sessionId string Id of the session to connect.
suppressErrors boolean 'true' to suppress failures in the report, default 'false'.
Optional, Default: false.

Returns:

true if successful, false otherwise.

DeactiveIMEEngine()

Deactivate the currently Active IME Engine on the device.

Dispose()

Dispose of WebDriver.

DumpSessions()

Prints information about active Appium sessions to output.

ExecuteScript(script, args)

Executes JavaScript in the context of the currently selected frame or window.

Parameters:

Name Type Description
script string The JavaScript code to execute.
args array The arguments to the script.

FindElementByAccessibilityId(selector)

Search for an element using Accessibility ID.

Parameters:

Name Type Description
selector string

FindElementByAndroidUIAutomator(selector)

Search for an element using UIAutomator selector.

Parameters:

Name Type Description
selector string

FindElementByClassName(className)

Finds the first element in the page that matches the CSS Class supplied.

Parameters:

Name Type Description
className string CSS class name of the element.

FindElementByCssSelector(cssSelector)

Finds the first element matching the specified CSS selector.

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

FindElementById(id)

Finds the first element in the page that matches the ID supplied.

Parameters:

Name Type Description
id string ID of the element.

FindElementByIosUIAutomation(selector)

Search for an element using UIAutomation selector.

Parameters:

Name Type Description
selector string

FindElementByLinkText(linkText)

Finds the first of elements that match the link text supplied.

Parameters:

Name Type Description
linkText string Link text of element.

FindElementByName(name)

Finds the first of elements that match the name supplied.

Parameters:

Name Type Description
name string Name of the element on the page.

FindElementByPartialLinkText(partialLinkText)

Finds the first of elements that match the part of the link text supplied.

Parameters:

Name Type Description
partialLinkText string Part of the link text.

FindElementByTagName(tagName)

Finds the first of elements that match the DOM Tag supplied.

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

FindElementByXPath(xpath)

Finds the first of elements that match the XPath supplied.

Parameters:

Name Type Description
xpath string xpath to the element.

FindElementsByAccessibilityId(selector)

Search for all elements matching Accessibility ID.

Parameters:

Name Type Description
selector string

FindElementsByAndroidUIAutomator(selector)

Search for all elements using UIAutomator selector.

Parameters:

Name Type Description
selector string

FindElementsByClassName(className)

Finds a list of elements that match the class name supplied.

Parameters:

Name Type Description
className string class name of the element.

FindElementsByCssSelector(cssSelector)

Finds all elements matching the specified CSS selector.

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

FindElementsById(id)

Finds the first element in the page that matches the ID supplied.

Parameters:

Name Type Description
id string ID of the element.

FindElementsByIosUIAutomation(selector)

Search for all elements using UIAutomation selector.

Parameters:

Name Type Description
selector string

FindElementsByLinkText(linkText)

Finds a list of elements that match the link text supplied.

Parameters:

Name Type Description
linkText string Link text of element.

FindElementsByName(name)

Finds a list of elements that match the name supplied.

Parameters:

Name Type Description
name string Name of the element on the page.

FindElementsByPartialLinkText(partialLinkText)

Finds a list of elements that match the part of the link text supplied.

Parameters:

Name Type Description
partialLinkText string Part of the link text.

FindElementsByTagName(tagName)

Finds a list of elements that match the DOM Tag supplied.

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

FindElementsByXPath(xpath)

Finds a list of elements that match the XPath supplied.

Parameters:

Name Type Description
xpath string xpath to the element.

GetAddressOfRemoteServer()

Returns:

URL of the remote Appium server.

GetContext()

Returns:

Current context (NATIVE_APP or WEBVIEW_*).

GetContexts()

Returns:

Array of available contexts for a hybrid application.

GetCurrentActivity()

GetCurrentWindowHandle()

Gets the current window handle, which is an opaque handle to this window that uniquely identifies it within this driver instance.

GetIMEActiveEngine()

Returns:

Currently active IME Engine on the device.

GetIMEAvailableEngines()

Returns:

A list of IME engines available on the device.

GetOrientation()

Returns:

Orientation of the device (0 - portrait, 1 - landscape).

GetPageSource()

Gets the source of the page last loaded by the browser.

GetSessionId()

Returns:

Id of the current session.

GetTitle()

Gets the title of the current browser window.

GetUrl()

Gets the URL the browser is currently displaying.

GetWindowHandles()

Gets the window handles of open browser windows.

HideKeyboard(key, key)

Parameters:

Name Type Description
key
key

IgnoreUnimportantViews(value)

Parameters:

Name Type Description
value

InstallApp(appPath)

Parameters:

Name Type Description
appPath

IsAppInstalled(bundleId)

Parameters:

Name Type Description
bundleId

IsIMEActive()

IsLocked()

LaunchApp()

OpenNotifications()

PressKeyCode(keyCode)

Parameters:

Name Type Description
keyCode

PullFile(pathOnDevice)

Parameters:

Name Type Description
pathOnDevice

PushFile(base64Data, base64Data)

Parameters:

Name Type Description
base64Data
base64Data

Quit()

Disconnects from the Browser.

ReconnectSession(autoCreate)

Reads session information produced by SaveSession and connects to the mobile target.

Parameters:

Name Type Description
autoCreate boolean 'true' to automatically create a new session if there is no saved session or saved session is not available anymore.
Optional, Default: false.

RemoveApp(appId)

Parameters:

Name Type Description
appId

ResetApp()

SaveSession()

Saves session information for use by ReconnectSession.

SetContext(name)

Sets current context.

Parameters:

Name Type Description
name string

SetOrientation(orientation)

Sets device orienataion.

Parameters:

Name Type Description
orientation number 0 - portrait, 1 - landscape

SetUrl(value)

Sets the URL the browser is currently displaying.

Parameters:

Name Type Description
value string The URL to display

ShakeDevice()

StartActivity(appActivity, appWaitPackage, appWaitActivity, appWaitActivity)

Parameters:

Name Type Description
appActivity
appWaitPackage
appWaitActivity
appWaitActivity

ToggleAirplaneMode()

ToggleLocationServices()

ToggleWifi()