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

Activate the given IME on the device.

ActivateIMEEngine(imeEngine) 

Parameters:

Name Type Description
imeEngine string IME to activate

BackgroundApp

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

BackgroundApp(seconds) 

Parameters:

Name Type Description
seconds number Timeout value

ClearSessions

Deletes active sessions on Appium server.

ClearSessions() 

Close

Close the Browser and Dispose of WebDriver.

Close() 

CloseApp

Close the application.

CloseApp() 

CreateAppiumDriver

CreateAppiumDriver(uri, caps) 

Parameters:

Name Type Description
uri string
caps AppiumCapabilities

CreateDesiredCapabilities

CreateDesiredCapabilities() 

Returns:

AppiumCapabilities object.

CreateDriverForSession

Connects to active Appium session with given URL and Id.

CreateDriverForSession(addressOfRemoteServer, sessionId, suppressErrors) 

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.

DeactiveIMEEngine() 

Dispose

Dispose of WebDriver.

Dispose() 

DumpSessions

Prints information about active Appium sessions to output.

DumpSessions() 

ExecuteScript

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

ExecuteScript(script, args) 

Parameters:

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

FindElementByAccessibilityId

Search for an element using Accessibility ID.

FindElementByAccessibilityId(selector) 

Parameters:

Name Type Description
selector string

FindElementByAndroidUIAutomator

Search for an element using UIAutomator selector.

FindElementByAndroidUIAutomator(selector) 

Parameters:

Name Type Description
selector string

FindElementByClassName

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

FindElementByClassName(className) 

Parameters:

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

FindElementByCssSelector

Finds the first element matching the specified CSS selector.

FindElementByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

FindElementById

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

FindElementById(id) 

Parameters:

Name Type Description
id string ID of the element.

FindElementByIosUIAutomation

Search for an element using UIAutomation selector.

FindElementByIosUIAutomation(selector) 

Parameters:

Name Type Description
selector string

FindElementByLinkText

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

FindElementByLinkText(linkText) 

Parameters:

Name Type Description
linkText string Link text of element.

FindElementByName

Finds the first of elements that match the name supplied.

FindElementByName(name) 

Parameters:

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

FindElementByPartialLinkText

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

FindElementByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

FindElementByTagName

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

FindElementByTagName(tagName) 

Parameters:

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

FindElementByXPath

Finds the first of elements that match the XPath supplied.

FindElementByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

FindElementsByAccessibilityId

Search for all elements matching Accessibility ID.

FindElementsByAccessibilityId(selector) 

Parameters:

Name Type Description
selector string

FindElementsByAndroidUIAutomator

Search for all elements using UIAutomator selector.

FindElementsByAndroidUIAutomator(selector) 

Parameters:

Name Type Description
selector string

FindElementsByClassName

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

FindElementsByClassName(className) 

Parameters:

Name Type Description
className string class name of the element.

FindElementsByCssSelector

Finds all elements matching the specified CSS selector.

FindElementsByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

FindElementsById

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

FindElementsById(id) 

Parameters:

Name Type Description
id string ID of the element.

FindElementsByIosUIAutomation

Search for all elements using UIAutomation selector.

FindElementsByIosUIAutomation(selector) 

Parameters:

Name Type Description
selector string

FindElementsByLinkText

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

FindElementsByLinkText(linkText) 

Parameters:

Name Type Description
linkText string Link text of element.

FindElementsByName

Finds a list of elements that match the name supplied.

FindElementsByName(name) 

Parameters:

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

FindElementsByPartialLinkText

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

FindElementsByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

FindElementsByTagName

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

FindElementsByTagName(tagName) 

Parameters:

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

FindElementsByXPath

Finds a list of elements that match the XPath supplied.

FindElementsByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

GetAddressOfRemoteServer

GetAddressOfRemoteServer() 

Returns:

URL of the remote Appium server.

GetContext

GetContext() 

Returns:

Current context (NATIVE_APP or WEBVIEW_*).

GetContexts

GetContexts() 

Returns:

Array of available contexts for a hybrid application.

GetCurrentActivity

GetCurrentActivity() 

GetCurrentWindowHandle

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

GetCurrentWindowHandle() 

GetIMEActiveEngine

GetIMEActiveEngine() 

Returns:

Currently active IME Engine on the device.

GetIMEAvailableEngines

GetIMEAvailableEngines() 

Returns:

A list of IME engines available on the device.

GetOrientation

GetOrientation() 

Returns:

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

GetPageSource

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

GetPageSource() 

GetSessionId

GetSessionId() 

Returns:

Id of the current session.

GetTitle

Gets the title of the current browser window.

GetTitle() 

GetUrl

Gets the URL the browser is currently displaying.

GetUrl() 

GetWindowHandles

Gets the window handles of open browser windows.

GetWindowHandles() 

HideKeyboard

HideKeyboard(key, key) 

Parameters:

Name Type Description
key
key

IgnoreUnimportantViews

IgnoreUnimportantViews(value) 

Parameters:

Name Type Description
value

InstallApp

InstallApp(appPath) 

Parameters:

Name Type Description
appPath

IsAppInstalled

IsAppInstalled(bundleId) 

Parameters:

Name Type Description
bundleId

IsIMEActive

IsIMEActive() 

IsLocked

IsLocked() 

LaunchApp

LaunchApp() 

OpenNotifications

OpenNotifications() 

PressKeyCode

PressKeyCode(keyCode) 

Parameters:

Name Type Description
keyCode

PullFile

PullFile(pathOnDevice) 

Parameters:

Name Type Description
pathOnDevice

PushFile

PushFile(base64Data, base64Data) 

Parameters:

Name Type Description
base64Data
base64Data

Quit

Disconnects from the Browser.

Quit() 

ReconnectSession

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

ReconnectSession(autoCreate) 

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

RemoveApp(appId) 

Parameters:

Name Type Description
appId

ResetApp

ResetApp() 

SaveSession

Saves session information for use by ReconnectSession.

SaveSession() 

SetContext

Sets current context.

SetContext(name) 

Parameters:

Name Type Description
name string

SetOrientation

Sets device orienataion.

SetOrientation(orientation) 

Parameters:

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

SetUrl

Sets the URL the browser is currently displaying.

SetUrl(value) 

Parameters:

Name Type Description
value string The URL to display

ShakeDevice

ShakeDevice() 

StartActivity

StartActivity(appActivity, appWaitPackage, appWaitActivity, appWaitActivity) 

Parameters:

Name Type Description
appActivity
appWaitPackage
appWaitActivity
appWaitActivity

ToggleAirplaneMode

ToggleAirplaneMode() 

ToggleLocationServices

ToggleLocationServices() 

ToggleWifi

ToggleWifi()