Skip to content

Mobile API (Unified)

This page is generated from Appium and Detox helper docblocks. For hybrid/mobile webview flows, ARIA locators such as { aria: "Sign in" } are available in web helpers.

AppiumDetox
SupportedSupported

Appium

Appends text to a input field or textarea. Field is located by name, label, CSS or XPath

The third parameter is an optional context (CSS or XPath locator) to narrow the search.

I.appendField('#myTextField', 'appended');
// typing secret
I.appendField('password', secret('123456'));
// within a context
I.appendField('name', 'John', '.form-container');

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator
  • value string text value to append.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Appends text into the field. A field can be located by text, accessibility id, id.

I.appendField('name', 'davert');

Parameters

AppiumDetox
SupportedNot supported

Appium

Returns app installation status.

I.checkIfAppIsInstalled("com.example.android.apis");

Parameters

  • bundleId string String ID of bundled app

Returns Promise<boolean> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Checks if an element exists.

I.checkIfElementExists('~edit'); // located by accessibility id
I.checkIfElementExists('~edit', '#menu'); // element inside #menu

Parameters

AppiumDetox
SupportedNot supported

Appium

Selects a checkbox or radio button. Element is located by label or name or CSS or XPath.

The second parameter is an optional context (CSS or XPath locator) to narrow the search.

I.checkOption('#agree');
I.checkOption('I Agree to Terms and Conditions');
I.checkOption('agree', '//form');

Parameters

  • field (string | object) checkbox located by label | name | CSS | XPath | strict locator.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Clears a text field. A field can be located by text, accessibility id, id.

I.clearField('~name');

Parameters

AppiumDetox
SupportedSupported

Appium

Perform a click on a link or a button, given by a locator. If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. For buttons, the “value” attribute, “name” attribute, and inner text are searched. For links, the link text is searched. For images, the “alt” attribute and inner text of any parent links are searched.

If no locator is provided, defaults to clicking the body element ('//body').

The second parameter is a context (CSS or XPath locator) to narrow the search.

// click body element (default)
I.click();
// simple link
I.click('Logout');
// button of form
I.click('Submit');
// CSS button
I.click('#form input[type=submit]');
// XPath
I.click('//form/*[@type=submit]');
// link in context
I.click('Logout', '#nav');
// using strict locator
I.click({css: 'nav a.login'});

Parameters

  • locator (string | object) (optional, '//body' by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator. (optional, default '//body')
  • context (string? | object | null) (optional, null by default) element to search in CSS|XPath|Strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Clicks on an element. Element can be located by its text or id or accessibility id

The second parameter is a context (id | type | accessibility id) to narrow the search.

Same as tap

I.click('Login'); // locate by text
I.click('~nav-1'); // locate by accessibility label
I.click('#user'); // locate by id
I.click('Login', '#nav'); // locate by text inside #nav
I.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and Android

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Performs click on element with horizontal and vertical offset. An element is located by text, id, accessibility id.

I.clickAtPoint('Save', 10, 10);
I.clickAtPoint('~save', 10, 10); // locate by accessibility id

Parameters

  • locator (string | object)
  • x number horizontal offset (optional, default 0)
  • y number vertical offset (optional, default 0)
AppiumDetox
SupportedNot supported

Appium

Close the given application.

I.closeApp();

Returns Promise<void> Appium: support both Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Opposite to see. Checks that a text is not present on a page. Use context parameter to narrow down the search.

I.dontSee('Login'); // assume we are already logged in.
I.dontSee('Login', '.nav'); // no login inside .nav element

Parameters

  • text string which is not present.
  • context (string | object)? (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Checks text not to be visible. Use second parameter to narrow down the search.

I.dontSee('Record created');
I.dontSee('Record updated', '#message');
I.dontSee('Record deleted', '~message');

Parameters

  • text string to check invisibility
  • context (string | object | null) element in which to search for text (optional, default null)
AppiumDetox
SupportedNot supported

Appium

Verifies that the specified checkbox is not checked.

I.dontSeeCheckboxIsChecked('#agree'); // located by ID
I.dontSeeCheckboxIsChecked('I agree to terms'); // located by label
I.dontSeeCheckboxIsChecked('agree'); // located by name

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator.

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Opposite to seeElement. Checks that element is not visible (or in DOM)

The second parameter is a context (CSS or XPath locator) to narrow the search.

I.dontSeeElement('.modal'); // modal is not shown
I.dontSeeElement('.modal', '#container');

Parameters

  • locator (string | object) located by CSS|XPath|Strict locator.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Checks that element is not visible. Use second parameter to narrow down the search.

I.dontSeeElement('~edit'); // located by accessibility id
I.dontSeeElement('~edit', '#menu'); // element inside #menu

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Checks that element not exists. Use second parameter to narrow down the search.

I.dontSeeElementExist('~edit'); // located by accessibility id
I.dontSeeElementExist('~edit', '#menu'); // element inside #menu

Parameters

AppiumDetox
SupportedNot supported

Appium

Checks that value of input field or textarea doesn’t equal to given value Opposite to seeInField.

The third parameter is an optional context (CSS or XPath locator) to narrow the search.

I.dontSeeInField('email', 'user@user.com'); // field by name
I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
// within a context
I.dontSeeInField('Name', 'old_value', '.form-container');

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator.
  • value (string | object) value to check.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Fills a text field or textarea, after clearing its value, with the given string. Field is located by name, label, CSS, or XPath.

The third parameter is an optional context (CSS or XPath locator) to narrow the search.

// by label
I.fillField('Email', 'hello@world.com');
// by name
I.fillField('password', secret('123456'));
// by CSS
I.fillField('form#login input[name=username]', 'John');
// or by strict locator
I.fillField({css: 'form#login input[name=username]'}, 'John');
// within a context
I.fillField('Name', 'John', '#section2');

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator.
  • value (string | object) text value to fill.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Fills in text field in an app. A field can be located by text, accessibility id, id.

I.fillField('Username', 'davert');
I.fillField('~name', 'davert');
I.fillField({ android: 'NAME', ios: 'name' }, 'davert');

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Goes back on Android

I.goBack(); // on Android only
AppiumDetox
SupportedNot supported

Appium

Get list of all available contexts

let contexts = await I.grabAllContexts();

Returns Promise<Array<string>> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Can be used for apps only with several values (“contentDescription”, “text”, “className”, “resourceId”)

Retrieves an attribute from an element located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async with await operator. If more than one element is found - attribute of first element is returned.

let hint = await I.grabAttributeFrom('#tooltip', 'title');

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.
  • attr string attribute name.

Returns Promise<string> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Can be used for apps only with several values (“contentDescription”, “text”, “className”, “resourceId”) Retrieves an array of attributes from elements located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async with await operator.

let hints = await I.grabAttributeFromAll('.tooltip', 'title');

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.
  • attr string attribute name.

Returns Promise<Array<string>> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Retrieve current context

let context = await I.grabContext();

Returns Promise<(string | null)> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Get current device activity.

let activity = await I.grabCurrentActivity();

Returns Promise<string> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Get information about the current network connection (Data/WIFI/Airplane). The actual server value will be a number. However WebdriverIO additional properties to the response object to allow easier assertions.

let con = await I.grabNetworkConnection();

Returns Promise<{}> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Grab number of visible elements by locator. Resumes test execution, so should be used inside async function with await operator.

let numOfElements = await I.grabNumberOfVisibleElements('p');

Parameters

  • locator (string | object) located by CSS|XPath|strict locator.

Returns Promise<number> number of visible elements

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Get current orientation.

let orientation = await I.grabOrientation();

Returns Promise<string> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Grab the device platform

const platform = await I.grabPlatform();
AppiumDetox
SupportedNot supported

Appium

Get all the currently specified settings.

let settings = await I.grabSettings();

Returns Promise<string> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Retrieves a text from an element located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async with await operator.

let pin = await I.grabTextFrom('#pin');

If multiple elements found returns first element.

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.

Returns Promise<string> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Retrieves all texts from an element located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async with await operator.

let pins = await I.grabTextFromAll('#pin li');

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.

Returns Promise<Array<string>> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Retrieves a value from a form element located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async function with await operator. If more than one element is found - value of first element is returned.

let email = await I.grabValueFrom('input[name=email]');

Parameters

  • locator (string | object) field located by label|name|CSS|XPath|strict locator.

Returns Promise<string> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Retrieves an array of value from a form located by CSS or XPath and returns it to test. Resumes test execution, so should be used inside async function with await operator.

let inputs = await I.grabValueFromAll('//form/input');

Parameters

  • locator (string | object) field located by label|name|CSS|XPath|strict locator.

Returns Promise<Array<string>> attribute value

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Hide the keyboard.

// taps outside to hide keyboard per default
I.hideDeviceKeyboard();

Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Install an app on device.

I.installApp('/path/to/file.apk');

Parameters

  • path string path to apk file

Returns Promise<void> Appium: support only Android

Detox

Installs a configured application. Application is installed by default.

I.installApp();
AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Launches an application. If application instance already exists, use relaunchApp.

I.launchApp();
AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Taps an element and holds for a requested time.

I.longPress('Login', 2); // locate by text, hold for 2 seconds
I.longPress('~nav', 1); // locate by accessibility label, hold for second
I.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 seconds

Parameters

  • locator (string | object) element to locate
  • sec number number of seconds to hold tap
  • context (string | object | null) context element (optional, default null)
AppiumDetox
SupportedNot supported

Appium

The Touch Action API provides the basis of all gestures that can be automated in Appium. At its core is the ability to chain together ad hoc individual actions, which will then be applied to an element in the application on the device. See complete documentation

I.makeTouchAction("~buttonStartWebviewCD", 'tap');

Parameters

  • locator
  • action

Returns Promise<void> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Multi taps on an element. Element can be located by its text or id or accessibility id.

Set the number of taps in second argument. Optionally define the context element by third argument.

I.multiTap('Login', 2); // locate by text
I.multiTap('~nav', 2); // locate by accessibility label
I.multiTap('#user', 2); // locate by id
I.multiTap('Update', 2, '#menu'); // locate by id

Parameters

AppiumDetox
SupportedNot supported

Appium

Open the notifications panel on the device.

I.openNotifications();

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Perform a swipe on the screen.

I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 });

Parameters

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Pulls a file from the device.

I.pullFile('/storage/emulated/0/DCIM/logo.png', 'my/path');
// save file to output dir
I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);

Parameters

Returns Promise<string> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Relaunches an application.

I.relaunchApp();
AppiumDetox
SupportedNot supported

Appium

Remove an app from the device.

I.removeApp('appName', 'com.example.android.apis');

Appium: support only Android

Parameters

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Reset the currently running app for current session.

I.resetApp();

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Perform a rotation gesture centered on the specified element.

I.rotate(120, 120)

See corresponding webdriverio reference.

Parameters

  • x
  • y
  • duration
  • radius
  • rotation
  • touchCount

Returns Promise<void> Appium: support only iOS

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Execute code only in Web mode.

I.runInWeb(() => {
I.waitForElement('#data');
I.seeInCurrentUrl('/data');
});

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Execute code only on Android

I.runOnAndroid(() => {
I.click('io.selendroid.testapp:id/buttonTest');
});

Additional filter can be applied by checking for capabilities. For instance, this code will be executed only on Android 6.0:

I.runOnAndroid({platformVersion: '6.0'},() => {
// ...
});

Also capabilities can be checked by a function. In this case, code will be executed only on Android >= 6.

I.runOnAndroid((caps) => {
// caps is current config of desiredCapabiliites
return caps.platformVersion >= 6
},() => {
// ...
});

Parameters

  • caps any
  • fn any

Detox

Execute code only on Android

I.runOnAndroid(() => {
I.click('Button');
I.see('Hi, Android');
});

Parameters

  • fn Function a function which will be executed on android
AppiumDetox
SupportedSupported

Appium

Execute code only on iOS

I.runOnIOS(() => {
I.click('//UIAApplication[1]/UIAWindow[1]/UIAButton[1]');
I.see('Hi, IOS', '~welcome');
});

Additional filter can be applied by checking for capabilities. For instance, this code will be executed only on iPhone 5s:

I.runOnIOS({deviceName: 'iPhone 5s'},() => {
// ...
});

Also capabilities can be checked by a function.

I.runOnAndroid((caps) => {
// caps is current config of desiredCapabiliites
return caps.platformVersion >= 6
},() => {
// ...
});

Parameters

  • caps any
  • fn any

Detox

Execute code only on iOS

I.runOnIOS(() => {
I.click('Button');
I.see('Hi, IOS');
});

Parameters

  • fn Function a function which will be executed on iOS
AppiumDetox
SupportedSupported

Appium

Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js). Filename is relative to output folder.

I.saveScreenshot('debug.png');

Parameters

  • fileName string file name to save.

Returns Promise<void>

Detox

Saves a screenshot to the output dir

I.saveScreenshot('main-window.png');

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Scrolls to the bottom of an element.

I.scrollDown('#container');

Parameters

AppiumDetox
SupportedNot supported

Appium

Scroll element into viewport.

I.scrollIntoView('#submit');
I.scrollIntoView('#submit', true);
I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });

Parameters

Returns void automatically synchronized promise through #recorderSupported only for web testing

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Scrolls to the left of an element.

I.scrollLeft('#container');

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Scrolls to the right of an element.

I.scrollRight('#container');

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Scrolls within a scrollable container to an element.

Parameters

  • targetLocator (string | object) Locator of the element to scroll to
  • containerLocator (string | object) Locator of the scrollable container
  • direction string ‘up’ or ‘down’ (optional, default 'down')
  • offset number Offset for scroll, can be adjusted based on need (optional, default 100)
AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Scrolls to the top of an element.

I.scrollUp('#container');

Parameters

AppiumDetox
SupportedSupported

Appium

Checks that a page contains a visible text. Use context parameter to narrow down the search.

I.see('Welcome'); // text welcome on a page
I.see('Welcome', '.content'); // text inside .content div
I.see('Register', {css: 'form.register'}); // use strict locator

Parameters

  • text string expected on page.
  • context (string? | object) (optional, null by default) element located by CSS|Xpath|strict locator in which to search for text. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Checks text to be visible. Use second parameter to narrow down the search.

I.see('Record created');
I.see('Record updated', '#message');
I.see('Record deleted', '~message');

Parameters

  • text string to check visibility
  • context (string | object | null) element inside which to search for text (optional, default null)
AppiumDetox
SupportedNot supported

Appium

Check if an app is installed.

I.seeAppIsInstalled("com.example.android.apis");

Parameters

  • bundleId string String ID of bundled app

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Check if an app is not installed.

I.seeAppIsNotInstalled("com.example.android.apis");

Parameters

  • bundleId string String ID of bundled app

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Verifies that the specified checkbox is checked.

I.seeCheckboxIsChecked('Agree');
I.seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator.

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Check current activity on an Android device.

I.seeCurrentActivityIs(".HomeScreenActivity")

Parameters

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Check whether the device is locked.

I.seeDeviceIsLocked();

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Check whether the device is not locked.

I.seeDeviceIsUnlocked();

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Checks that a given Element is visible Element is located by CSS or XPath.

The second parameter is a context (CSS or XPath locator) to narrow the search.

I.seeElement('#modal');
I.seeElement('#modal', '#container');

Parameters

  • locator (string | object) located by CSS|XPath|strict locator.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Checks for visibility of an element. Use second parameter to narrow down the search.

I.seeElement('~edit'); // located by accessibility id
I.seeElement('~edit', '#menu'); // element inside #menu

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Checks for existence of an element. An element can be visible or not. Use second parameter to narrow down the search.

I.seeElementExists('~edit'); // located by accessibility id
I.seeElementExists('~edit', '#menu'); // element inside #menu

Parameters

AppiumDetox
SupportedNot supported

Appium

Checks that the given input field or textarea equals to given value. For fuzzy locators, fields are matched by label text, the “name” attribute, CSS, and XPath.

The third parameter is an optional context (CSS or XPath locator) to narrow the search.

I.seeInField('Username', 'davert');
I.seeInField({css: 'form textarea'},'Type your comment here');
I.seeInField('form input[type=hidden]','hidden_value');
I.seeInField('#searchform input','Search');
// within a context
I.seeInField('Name', 'John', '.form-container');

Parameters

  • field (string | object) located by label|name|CSS|XPath|strict locator.
  • value (string | object) value to check.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Check the device orientation

I.seeOrientationIs('PORTRAIT');
I.seeOrientationIs('LANDSCAPE')

Parameters

  • orientation ("LANDSCAPE" | "PORTRAIT") LANDSCAPE or PORTRAITAppium: support Android and iOS

Returns Promise<void>

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Selects an option in a drop-down select. Field is searched by label | name | CSS | XPath. Option is selected by visible text or by value.

The third parameter is an optional context (CSS or XPath locator) to narrow the search.

I.selectOption('Choose Plan', 'Monthly'); // select by label
I.selectOption('subscription', 'Monthly'); // match option by text
I.selectOption('subscription', '0'); // or by value
I.selectOption('//form/select[@name=account]','Premium');
I.selectOption('form select[name=account]', 'Premium');
I.selectOption({css: 'form select[name=account]'}, 'Premium');
// within a context
I.selectOption('age', '21-60', '#section2');

Provide an array for the second argument to select multiple options.

I.selectOption('Which OS do you use?', ['Android', 'iOS']);

Parameters

  • select (string | object) field located by label|name|CSS|XPath|strict locator.
  • option (string | Array<any>) visible text or value of option.
  • context (string? | object) (optional, null by default) element located by CSS | XPath | strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorderSupported only for web testing

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Send a key event to the device. List of keys: https://developer.android.com/reference/android/view/KeyEvent.html

I.sendDeviceKeyEvent(3);

Parameters

  • keyValue number Device specific key value

Returns Promise<void> Appium: support only Android

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Set immediate value in app.

See corresponding webdriverio reference.

Parameters

  • id
  • value

Returns Promise<void> Appium: support only iOS

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Switches device to landscape orientation

I.setLandscapeOrientation();
AppiumDetox
SupportedNot supported

Appium

Set network connection mode.

  • airplane mode
  • wifi mode
  • data data
I.setNetworkConnection(0) // airplane mode off, wifi off, data off
I.setNetworkConnection(1) // airplane mode on, wifi off, data off
I.setNetworkConnection(2) // airplane mode off, wifi on, data off
I.setNetworkConnection(4) // airplane mode off, wifi off, data on
I.setNetworkConnection(6) // airplane mode off, wifi on, data on

See corresponding webdriverio reference.

Appium: support only Android

Parameters

  • value number The network connection mode bitmask

Returns Promise<number>

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Set a device orientation. Will fail, if app will not set orientation

I.setOrientation('PORTRAIT');
I.setOrientation('LANDSCAPE')

Parameters

  • orientation ("LANDSCAPE" | "PORTRAIT") LANDSCAPE or PORTRAITAppium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Switches device to portrait orientation

I.setPortraitOrientation();
AppiumDetox
SupportedNot supported

Appium

Update the current setting on the device

I.setSettings({cyberdelia: 'open'});

Parameters

  • settings object objectAppium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Perform a shake action on the device.

I.shakeDevice();

Returns Promise<void> Appium: support only iOS

Detox

Shakes the device.

I.shakeDevice();
AppiumDetox
SupportedNot supported

Appium

Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.

I.touchId(); // simulates valid fingerprint
I.touchId(true); // simulates valid fingerprint
I.touchId(false); // simulates invalid fingerprint

Parameters

  • match

Returns Promise<void> Appium: support only iOS TODO: not tested

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Start an arbitrary Android activity during a session.

I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');

Appium: support only Android

Parameters

Returns Promise<void>

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Perform a swipe on the screen or an element.

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipe(locator, 800, 1200, 1000);

See complete reference

Parameters

Returns Promise<void> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Perform a swipe down on an element.

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeDown(locator); // simple swipe
I.swipeDown(locator, 500); // set speed
I.swipeDown(locator, 1200, 1000); // set offset and speed

Parameters

  • locator (string | object)
  • yoffset number? (optional) (optional, default 1000)
  • speed number (optional), 1000 by default (optional, default 1000)

Returns Promise<void> Appium: support Android and iOS

Detox

Performs a swipe up inside an element. Can be slow or fast swipe.

I.swipeUp('#container');

Parameters

  • locator (string | object) an element on which to perform swipe
  • speed string a speed to perform: slow or fast. (optional, default 'slow')
AppiumDetox
SupportedSupported

Appium

Perform a swipe left on an element.

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeLeft(locator); // simple swipe
I.swipeLeft(locator, 500); // set speed
I.swipeLeft(locator, 1200, 1000); // set offset and speed

Parameters

  • locator (string | object)
  • xoffset number? (optional) (optional, default 1000)
  • speed number (optional), 1000 by default (optional, default 1000)

Returns Promise<void> Appium: support Android and iOS

Detox

Performs a swipe up inside an element. Can be slow or fast swipe.

I.swipeUp('#container');

Parameters

  • locator (string | object) an element on which to perform swipe
  • speed string a speed to perform: slow or fast. (optional, default 'slow')
AppiumDetox
SupportedSupported

Appium

Perform a swipe right on an element.

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeRight(locator); // simple swipe
I.swipeRight(locator, 500); // set speed
I.swipeRight(locator, 1200, 1000); // set offset and speed

Parameters

  • locator (string | object)
  • xoffset number? (optional) (optional, default 1000)
  • speed number (optional), 1000 by default (optional, default 1000)

Returns Promise<void> Appium: support Android and iOS

Detox

Performs a swipe up inside an element. Can be slow or fast swipe.

I.swipeUp('#container');

Parameters

  • locator (string | object) an element on which to perform swipe
  • speed string a speed to perform: slow or fast. (optional, default 'slow')
AppiumDetox
SupportedNot supported

Appium

Perform a swipe in selected direction on an element to searchable element.

I.swipeTo(
"android.widget.CheckBox", // searchable element
"//android.widget.ScrollView/android.widget.LinearLayout", // scroll element
"up", // direction
30,
100,
500);

Parameters

Returns Promise<void> Appium: support Android and iOS

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Perform a swipe up on an element.

let locator = "#io.selendroid.testapp:id/LinearLayout1";
I.swipeUp(locator); // simple swipe
I.swipeUp(locator, 500); // set speed
I.swipeUp(locator, 1200, 1000); // set offset and speed

Parameters

  • locator (string | object)
  • yoffset number? (optional) (optional, default 1000)
  • speed number (optional), 1000 by default (optional, default 1000)

Returns Promise<void> Appium: support Android and iOS

Detox

Performs a swipe up inside an element. Can be slow or fast swipe.

I.swipeUp('#container');

Parameters

  • locator (string | object) an element on which to perform swipe
  • speed string a speed to perform: slow or fast. (optional, default 'slow')
AppiumDetox
SupportedNot supported

Appium

Switch to the specified context.

Parameters

  • context any the context to switch to

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Switches to native context. By default switches to NATIVE_APP context unless other specified.

I.switchToNative();
// or set context explicitly
I.switchToNative('SOME_OTHER_CONTEXT');

Parameters

  • context any? (optional, default null)

Returns Promise<void>

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Switches to web context. If no context is provided switches to the first detected web context

// switch to first web context
I.switchToWeb();
// or set the context explicitly
I.switchToWeb('WEBVIEW_io.selendroid.testapp');

Parameters

Returns Promise<void>

Detox

Not available in this helper.

AppiumDetox
SupportedSupported

Appium

Taps on element.

I.tap("~buttonStartWebviewCD");

Shortcut for makeTouchAction

Parameters

  • locator any

Returns Promise<void>

Detox

Taps on an element. Element can be located by its text or id or accessibility id.

The second parameter is a context element to narrow the search.

Same as click

I.tap('Login'); // locate by text
I.tap('~nav-1'); // locate by accessibility label
I.tap('#user'); // locate by id
I.tap('Login', '#nav'); // locate by text inside #nav
I.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and Android

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Clicks on an element. Element can be located by its label

The second parameter is a context (id | type | accessibility id) to narrow the search.

I.tapByLabel('Login'); // locate by text
I.tapByLabel('Login', '#nav'); // locate by text inside #nav

Parameters

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Taps return key. A field can be located by text, accessibility id, id.

I.tapReturnKey('Username');
I.tapReturnKey('~name');
I.tapReturnKey({ android: 'NAME', ios: 'name' });

Parameters

AppiumDetox
SupportedNot supported

Appium

Performs a specific touch action. The action object need to contain the action name, x/y coordinates

I.touchPerform([{
action: 'press',
options: {
x: 100,
y: 200
}
}, {action: 'release'}])
I.touchPerform([{
action: 'tap',
options: {
element: '1', // json web element was queried before
x: 10, // x offset
y: 20, // y offset
count: 1 // number of touches
}
}]);

Appium: support Android and iOS

Parameters

  • actions Array Array of touch actions

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Waits for number of seconds

I.wait(2); // waits for 2 seconds

Parameters

  • sec number number of seconds to wait
AppiumDetox
SupportedSupported

Appium

Waits for element to be present on page (by default waits for 1sec). Element can be located by CSS or XPath.

I.waitForElement('.btn.continue');
I.waitForElement('.btn.continue', 5); // wait for 5 secs

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.
  • sec number? (optional, 1 by default) time in seconds to wait (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Waits for an element to exist on page.

I.waitForElement('#message', 1); // wait for 1 second

Parameters

  • locator (string | object) an element to wait for
  • sec number number of seconds to wait, 5 by default (optional, default 5)
AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Waits for an element to be visible on page.

I.waitForElementVisible('#message', 1); // wait for 1 second

Parameters

  • locator (string | object) an element to wait for
  • sec number number of seconds to wait (optional, default 5)
AppiumDetox
SupportedNot supported

Appium

Waits for an element to be removed or become invisible on a page (by default waits for 1sec). Element can be located by CSS or XPath.

I.waitForInvisible('#popup');

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.
  • sec number (optional, 1 by default) time in seconds to wait (optional, default 1)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Waits for a text to appear (by default waits for 1sec). Element can be located by CSS or XPath. Narrow down search results by providing context.

I.waitForText('Thank you, form has been submitted');
I.waitForText('Thank you, form has been submitted', 5, '#modal');

Parameters

  • text string to wait for.
  • sec number (optional, 1 by default) time in seconds to wait (optional, default 1)
  • context (string | object)? (optional) element located by CSS|XPath|strict locator. (optional, default null)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
SupportedNot supported

Appium

Waits for an element to become visible on a page (by default waits for 1sec). Element can be located by CSS or XPath.

I.waitForVisible('#popup');

Parameters

  • locator (string | object) element located by CSS|XPath|strict locator.
  • sec number (optional, 1 by default) time in seconds to wait (optional, default 1)

Returns void automatically synchronized promise through #recorder

Detox

Not available in this helper.

AppiumDetox
Not supportedSupported

Appium

Not available in this helper.

Detox

Waits an elmenet to become not visible.

I.waitToHide('#message', 2); // wait for 2 seconds

Parameters

  • locator (string | object) an element to wait for
  • sec number number of seconds to wait (optional, default 5)