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.
Methods
Section titled “Methods”I.amOnPage()
Section titled “I.amOnPage()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Opens a web page in a browser. Requires relative or absolute url.
If url starts with /, opens a web page of a site defined in url config parameter.
I.amOnPage('/'); // opens main page of websiteI.amOnPage('https://github.com'); // opens githubI.amOnPage('/login'); // opens a login pageParameters
urlstring url path or global url.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.appendField()
Section titled “I.appendField()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 secretI.appendField('password', secret('123456'));// within a contextI.appendField('name', 'John', '.form-container');Parameters
field(string | object) located by label|name|CSS|XPath|strict locatorvaluestring text value to append.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
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
I.attachFile()
Section titled “I.attachFile()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Appium: not tested
Attaches a file to element located by label, name, CSS or XPath Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located). File will be uploaded to remote system (if tests are running remotely).
The third parameter is an optional context (CSS or XPath locator) to narrow the search.
I.attachFile('Avatar', 'data/avatar.jpg');I.attachFile('form input[name=avatar]', 'data/avatar.jpg');// within a contextI.attachFile('Avatar', 'data/avatar.jpg', '.form-container');If the locator points to a non-file-input element (e.g., a dropzone area), the file will be dropped onto that element using drag-and-drop events.
I.attachFile('#dropzone', 'data/avatar.jpg');Parameters
locator(string | object) field located by label|name|CSS|XPath|strict locator.pathToFilestring local file path relative to codecept.conf.ts or codecept.conf.js config file.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.blur()
Section titled “I.blur()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Remove focus from a text input, button, etc. Calls blur on the element.
Examples:
I.blur('.text-area')//element `#product-tile` is focusedI.see('#add-to-cart-btn');I.blur('#product-tile')I.dontSee('#add-to-cart-btn');Parameters
locator(string | object) field located by label|name|CSS|XPath|strict locator.optionsany? Playwright only: Additional options for available options object as 2nd argument.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.checkIfAppIsInstalled()
Section titled “I.checkIfAppIsInstalled()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Returns app installation status.
I.checkIfAppIsInstalled("com.example.android.apis");Parameters
bundleIdstring String ID of bundled app
Returns Promise<boolean> Appium: support only Android
Detox
Not available in this helper.
I.checkIfElementExists()
Section titled “I.checkIfElementExists()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Checks if an element exists.
I.checkIfElementExists('~edit'); // located by accessibility idI.checkIfElementExists('~edit', '#menu'); // element inside #menuParameters
locator(string | object) element to locatecontext(string | object | null) context element (optional, defaultnull)
I.checkOption()
Section titled “I.checkOption()”| Appium | Detox |
|---|---|
| Supported | Not 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,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.clearClipboard()
Section titled “I.clearClipboard()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Clears the system clipboard.
I.clearClipboard();I.seeClipboardEquals('');Returns void automatically synchronized promise through #recorderAppium: support both Android and iOS
Detox
Not available in this helper.
I.clearField()
Section titled “I.clearField()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Clears a <textarea> or text <input> element’s value.
The second parameter is an optional context (CSS or XPath locator) to narrow the search.
I.clearField('Email');I.clearField('user[email]');I.clearField('#email');// within a contextI.clearField('Email', '.form-container');Parameters
fieldcontext(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.editable(string | object) field located by label|name|CSS|XPath|strict locator.
Returns void automatically synchronized promise through #recorder.
Detox
Clears a text field. A field can be located by text, accessibility id, id.
I.clearField('~name');Parameters
I.click()
Section titled “I.click()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 linkI.click('Logout');// button of formI.click('Submit');// CSS buttonI.click('#form input[type=submit]');// XPathI.click('//form/*[@type=submit]');// link in contextI.click('Logout', '#nav');// using strict locatorI.click({css: 'nav a.login'});// using ARIA role locatorI.click({role: 'button', name: 'Submit'});ℹ️ ARIA role locators (
{role, name}) match elements the way assistive technology does and survive markup refactors. See Locators.
Parameters
locator(string | object) (optional,'//body'by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.context(string? | object | null) (optional,nullby default) element to search in CSS|XPath|Strict locator.
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 textI.click('~nav-1'); // locate by accessibility labelI.click('#user'); // locate by idI.click('Login', '#nav'); // locate by text inside #navI.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and AndroidParameters
I.clickAtPoint()
Section titled “I.clickAtPoint()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 idParameters
locator(string | object)xnumber horizontal offset (optional, default0)ynumber vertical offset (optional, default0)
I.clickXY()
Section titled “I.clickXY()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Performs click at specific coordinates. If locator is provided, the coordinates are relative to the element’s top-left corner. If locator is not provided, the coordinates are relative to the body element.
// Click at coordinates (100, 200) relative to bodyI.clickXY(100, 200);
// Click at coordinates (50, 30) relative to element's top-left cornerI.clickXY('#someElement', 50, 30);Parameters
locator(string | object | [number][12]) Element to click on or X coordinate if no element.x[number][12]? X coordinate relative to element’s top-left, or Y coordinate if locator is a number.y[number][12]? Y coordinate relative to element’s top-left.
Returns Promise
Detox
Not available in this helper.
I.closeApp()
Section titled “I.closeApp()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Close the given application.
I.closeApp();Returns Promise
Detox
Not available in this helper.
I.closeOtherTabs()
Section titled “I.closeOtherTabs()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Close all tabs except for the current one.
I.closeOtherTabs();Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.defineTimeout()
Section titled “I.defineTimeout()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Set [WebDriver timeouts][13] in realtime.
Timeouts are expected to be passed as object:
I.defineTimeout({ script: 5000 });I.defineTimeout({ implicit: 10000, pageLoad: 10000, script: 5000 });Parameters
timeoutsany WebDriver timeouts object.
Detox
Not available in this helper.
I.dontSee()
Section titled “I.dontSee()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 elementParameters
textstring which is not present.context(string | object)? (optional) element located by CSS|XPath|strict locator in which to perfrom search.
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
textstring to check invisibilitycontext(string | object | null) element in which to search for text (optional, defaultnull)
I.dontSeeCheckboxIsChecked()
Section titled “I.dontSeeCheckboxIsChecked()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Verifies that the specified checkbox is not checked.
I.dontSeeCheckboxIsChecked('#agree'); // located by IDI.dontSeeCheckboxIsChecked('I agree to terms'); // located by labelI.dontSeeCheckboxIsChecked('agree'); // located by nameParameters
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dontSeeCurrentPathEquals()
Section titled “I.dontSeeCurrentPathEquals()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that current URL path does NOT match the expected path. Query strings and URL fragments are ignored.
I.dontSeeCurrentPathEquals('/form'); // fails for '/form', '/form?user=1', '/form#section'I.dontSeeCurrentPathEquals('/'); // fails for '/', '/?user=ok', '/#top'Parameters
pathstring value to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dontSeeElement()
Section titled “I.dontSeeElement()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 shownI.dontSeeElement('.modal', '#container');Parameters
locator(string | object) located by CSS|XPath|Strict locator.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
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 idI.dontSeeElement('~edit', '#menu'); // element inside #menuParameters
locator(string | object) element to locatecontext(string | object | null) context element (optional, defaultnull)
I.dontSeeElementExists()
Section titled “I.dontSeeElementExists()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 idI.dontSeeElementExist('~edit', '#menu'); // element inside #menuParameters
locator(string | object) element to locatecontext(string | object) context element (optional, defaultnull)
I.dontSeeElementInDOM()
Section titled “I.dontSeeElementInDOM()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Opposite to seeElementInDOM. Checks that element is not on page.
I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or notParameters
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dontSeeInField()
Section titled “I.dontSeeInField()”| Appium | Detox |
|---|---|
| Supported | Not 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 nameI.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS// within a contextI.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,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dontSeeInSource()
Section titled “I.dontSeeInSource()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that the current page does not contains the given string in its raw source code.
I.dontSeeInSource('<!--'); // no comments in sourceParameters
textvaluestring to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.doubleClick()
Section titled “I.doubleClick()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Performs a double-click on an element matched by link|button|label|CSS or XPath. Context can be specified as second parameter to narrow search.
I.doubleClick('Edit');I.doubleClick('Edit', '.actions');I.doubleClick({css: 'button.accept'});I.doubleClick('.btn.edit');Parameters
locator(string | object) clickable link or button located by text, or any element located by CSS|XPath|strict locator.context(string? | object) (optional,nullby default) element to search in CSS|XPath|Strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dragAndDrop()
Section titled “I.dragAndDrop()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Appium: not tested Drag an item to a destination element.
I.dragAndDrop('#dragHandle', '#container');Parameters
srcElement(string | object) located by CSS|XPath|strict locator.destElement(string | object) located by CSS|XPath|strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.dragSlider()
Section titled “I.dragSlider()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Drag the scrubber of a slider to a given position For fuzzy locators, fields are matched by label text, the “name” attribute, CSS, and XPath.
I.dragSlider('#slider', 30);I.dragSlider('#slider', -70);Parameters
locator(string | object) located by label|name|CSS|XPath|strict locator.offsetX[number][12] position to drag.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.fillField()
Section titled “I.fillField()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 labelI.fillField('Email', 'hello@world.com');// by nameI.fillField('password', secret('123456'));// by CSSI.fillField('form#login input[name=username]', 'John');// or by strict locatorI.fillField({css: 'form#login input[name=username]'}, 'John');// by ARIA role locatorI.fillField({role: 'textbox', name: 'Email'}, 'hello@world.com');// within a contextI.fillField('Name', 'John', '#section2');ℹ️ ARIA role locators (
{role, name}) match fields by their accessible name and survive markup refactors. See Locators.
Parameters
field(string | object) located by label|name|CSS|XPath|strict locator.value(string | object) text value to fill.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
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
I.focus()
Section titled “I.focus()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Calls focus on the matching element.
Examples:
I.dontSee('#add-to-cart-btn');I.focus('#product-tile')I.see('#add-to-cart-bnt');Parameters
locator(string | object) field located by label|name|CSS|XPath|strict locator.optionsany? Playwright only: [Additional options][14] for available options object as 2nd argument.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.forceClick()
Section titled “I.forceClick()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Perform an emulated click on a link or a button, given by a locator. Unlike normal click instead of sending native event, emulates a click with JavaScript. This works on hidden, animated or inactive elements as well.
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.
The second parameter is a context (CSS or XPath locator) to narrow the search.
// simple linkI.forceClick('Logout');// button of formI.forceClick('Submit');// CSS buttonI.forceClick('#form input[type=submit]');// XPathI.forceClick('//form/*[@type=submit]');// link in contextI.forceClick('Logout', '#nav');// using strict locatorI.forceClick({css: 'nav a.login'});Parameters
locator(string | object) clickable link or button located by text, or any element located by CSS|XPath|strict locator.context(string? | object) (optional,nullby default) element to search in CSS|XPath|Strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.forceRightClick()
Section titled “I.forceRightClick()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Emulates right click on an element. Unlike normal click instead of sending native event, emulates a click with JavaScript. This works on hidden, animated or inactive elements as well.
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.
The second parameter is a context (CSS or XPath locator) to narrow the search.
// simple linkI.forceRightClick('Menu');Parameters
locator(string | object) clickable link or button located by text, or any element located by CSS|XPath|strict locator.context(string? | object) (optional,nullby default) element to search in CSS|XPath|Strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.goBack()
Section titled “I.goBack()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Goes back on Android
I.goBack(); // on Android onlyI.grabAllContexts()
Section titled “I.grabAllContexts()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get list of all available contexts
let contexts = await I.grabAllContexts();Returns Promise<[Array][15]<string>> Appium: support Android and iOS
Detox
Not available in this helper.
I.grabAllWindowHandles()
Section titled “I.grabAllWindowHandles()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get all Window Handles.
Useful for referencing a specific handle when calling I.switchToWindow(handle)
const windows = await I.grabAllWindowHandles();Returns Promise<[Array][15]<string>>
Detox
Not available in this helper.
I.grabAttributeFrom()
Section titled “I.grabAttributeFrom()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<string> attribute value
Detox
Not available in this helper.
I.grabAttributeFromAll()
Section titled “I.grabAttributeFromAll()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<[Array][15]<string>> attribute value
Detox
Not available in this helper.
I.grabBrowserLogs()
Section titled “I.grabBrowserLogs()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get JS log from browser. Log buffer is reset after each request.
Resumes test execution, so should be used inside an async function with await operator.
let logs = await I.grabBrowserLogs();console.log(JSON.stringify(logs))Returns (Promise<[Array][15]<object>> | [undefined][16]) all browser logs
Detox
Not available in this helper.
I.grabContext()
Section titled “I.grabContext()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.grabCurrentActivity()
Section titled “I.grabCurrentActivity()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get current device activity.
let activity = await I.grabCurrentActivity();Returns Promise<string> Appium: support only Android
Detox
Not available in this helper.
I.grabCurrentWindowHandle()
Section titled “I.grabCurrentWindowHandle()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get the current Window Handle.
Useful for referencing it when calling I.switchToWindow(handle)
const window = await I.grabCurrentWindowHandle();Detox
Not available in this helper.
I.grabElementBoundingRect()
Section titled “I.grabElementBoundingRect()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Grab the width, height, location of given locator.
Provide width or heightas second param to get your desired prop.
Resumes test execution, so should be used inside an async function with await operator.
Returns an object with x, y, width, height keys.
const value = await I.grabElementBoundingRect('h3');// value is like { x: 226.5, y: 89, width: 527, height: 220 }To get only one metric use second parameter:
const width = await I.grabElementBoundingRect('h3', 'width');// width == 527Parameters
locator(string | object) element located by CSS|XPath|strict locator.propelementSizestring? x, y, width or height of the given element.
Returns (Promise
Detox
Not available in this helper.
I.grabFromClipboard()
Section titled “I.grabFromClipboard()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Grabs the text content of the system clipboard and returns it to test.
Resumes test execution, so should be used inside async function with await operator.
I.click('Copy to clipboard');let url = await I.grabFromClipboard();Reading the clipboard requires a secure context (https or localhost) and is supported
in Chromium-based browsers, where read access is granted automatically.
Returns Promise<string> the system clipboard contents.Appium: support both Android and iOS
Detox
Not available in this helper.
I.grabHTMLFrom()
Section titled “I.grabHTMLFrom()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Retrieves the innerHTML from an 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 - HTML of first element is returned.
let postHTML = await I.grabHTMLFrom('#post');Parameters
Returns Promise<string> HTML code for an element
Detox
Not available in this helper.
I.grabHTMLFromAll()
Section titled “I.grabHTMLFromAll()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Retrieves all the innerHTML from elements located by CSS or XPath and returns it to test.
Resumes test execution, so should be used inside async function with await operator.
let postHTMLs = await I.grabHTMLFromAll('.post');Parameters
Returns Promise<[Array][15]<string>> HTML code for an element
Detox
Not available in this helper.
I.grabNetworkConnection()
Section titled “I.grabNetworkConnection()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.grabNumberOfOpenTabs()
Section titled “I.grabNumberOfOpenTabs()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Grab number of open tabs.
Resumes test execution, so should be used inside async function with await operator.
let tabs = await I.grabNumberOfOpenTabs();Returns Promise<[number][12]> number of open tabs
Detox
Not available in this helper.
I.grabNumberOfVisibleElements()
Section titled “I.grabNumberOfVisibleElements()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<[number][12]> number of visible elements
Detox
Not available in this helper.
I.grabOrientation()
Section titled “I.grabOrientation()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Get current orientation.
let orientation = await I.grabOrientation();Returns Promise<string> Appium: support Android and iOS
Detox
Not available in this helper.
I.grabPageScrollPosition()
Section titled “I.grabPageScrollPosition()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Retrieves a page scroll position and returns it to test.
Resumes test execution, so should be used inside an async function with await operator.
let { x, y } = await I.grabPageScrollPosition();Returns Promise
Detox
Not available in this helper.
I.grabPlatform()
Section titled “I.grabPlatform()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Grab the device platform
const platform = await I.grabPlatform();I.grabSettings()
Section titled “I.grabSettings()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.grabSource()
Section titled “I.grabSource()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Retrieves page source and returns it to test.
Resumes test execution, so should be used inside async function with await operator.
let pageSource = await I.grabSource();Returns Promise<string> source code
Detox
Not available in this helper.
I.grabTextFrom()
Section titled “I.grabTextFrom()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<string> attribute value
Detox
Not available in this helper.
I.grabTextFromAll()
Section titled “I.grabTextFromAll()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<[Array][15]<string>> attribute value
Detox
Not available in this helper.
I.grabValueFrom()
Section titled “I.grabValueFrom()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<string> attribute value
Detox
Not available in this helper.
I.grabValueFromAll()
Section titled “I.grabValueFromAll()”| Appium | Detox |
|---|---|
| Supported | Not 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
Returns Promise<[Array][15]<string>> attribute value
Detox
Not available in this helper.
I.grabWebElement()
Section titled “I.grabWebElement()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Grab WebElement for given locator
Resumes test execution, so should be used inside an async function with await operator.
const webElement = await I.grabWebElement('#button');Parameters
Returns Promise
Detox
Not available in this helper.
I.grabWebElements()
Section titled “I.grabWebElements()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Grab WebElements for given locator
Resumes test execution, so should be used inside an async function with await operator.
const webElements = await I.grabWebElements('#button');Parameters
Returns Promise
Detox
Not available in this helper.
I.hideDeviceKeyboard()
Section titled “I.hideDeviceKeyboard()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Hide the keyboard.
// taps outside to hide keyboard per defaultI.hideDeviceKeyboard();Appium: support Android and iOS
Detox
Not available in this helper.
I.installApp()
Section titled “I.installApp()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Install an app on device.
I.installApp('/path/to/file.apk');Parameters
pathstring path to apk file
Returns Promise
Detox
Installs a configured application. Application is installed by default.
I.installApp();I.launchApp()
Section titled “I.launchApp()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Launches an application. If application instance already exists, use relaunchApp.
I.launchApp();I.longPress()
Section titled “I.longPress()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 secondsI.longPress('~nav', 1); // locate by accessibility label, hold for secondI.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 secondsParameters
locator(string | object) element to locatesecnumber number of seconds to hold tapcontext(string | object | null) context element (optional, defaultnull)
I.makeTouchAction()
Section titled “I.makeTouchAction()”| Appium | Detox |
|---|---|
| Supported | Not 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][17]
I.makeTouchAction("~buttonStartWebviewCD", 'tap');Parameters
locatoraction
Returns Promise
Detox
Not available in this helper.
I.moveCursorTo()
Section titled “I.moveCursorTo()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Moves cursor to element matched by locator. Extra shift can be set with offsetX and offsetY options.
An optional context (as a second parameter) can be specified to narrow the search to an element within a parent.
When the second argument is a non-number (string or locator object), it is treated as context.
I.moveCursorTo('.tooltip');I.moveCursorTo('#submit', 5,5);I.moveCursorTo('#submit', '.container');Parameters
locator(string | object) located by CSS|XPath|strict locator.xOffsetyOffsetoffsetX([number][12] | string | object) (optional,0by default) X-axis offset or context locator.offsetY[number][12] (optional,0by default) Y-axis offset.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.multiTap()
Section titled “I.multiTap()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 textI.multiTap('~nav', 2); // locate by accessibility labelI.multiTap('#user', 2); // locate by idI.multiTap('Update', 2, '#menu'); // locate by idParameters
locator(string | object) element to locatenumnumber number of tapscontext(string | object | null) context element (optional, defaultnull)
I.openNotifications()
Section titled “I.openNotifications()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Open the notifications panel on the device.
I.openNotifications();Returns Promise
Detox
Not available in this helper.
I.performSwipe()
Section titled “I.performSwipe()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.pullFile()
Section titled “I.pullFile()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Pulls a file from the device.
I.pullFile('/storage/emulated/0/DCIM/logo.png', 'my/path');// save file to output dirI.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);Parameters
Returns Promise<string> Appium: support Android and iOS
Detox
Not available in this helper.
I.relaunchApp()
Section titled “I.relaunchApp()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Relaunches an application.
I.relaunchApp();I.removeApp()
Section titled “I.removeApp()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.resetApp()
Section titled “I.resetApp()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Reset the currently running app for current session.
I.resetApp();Detox
Not available in this helper.
I.rightClick()
Section titled “I.rightClick()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Performs right click on a clickable element matched by semantic locator, CSS or XPath.
// right click element with id elI.rightClick('#el');// right click link or button with text "Click me"I.rightClick('Click me');// right click button with text "Click me" inside .contextI.rightClick('Click me', '.context');Parameters
locator(string | object) clickable element located by CSS|XPath|strict locator.context(string? | object) (optional,nullby default) element located by CSS|XPath|strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.rotate()
Section titled “I.rotate()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Perform a rotation gesture centered on the specified element.
I.rotate(120, 120)See corresponding [webdriverio reference][18].
Parameters
xydurationradiusrotationtouchCount
Returns Promise
Detox
Not available in this helper.
I.runInWeb()
Section titled “I.runInWeb()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Execute code only in Web mode.
I.runInWeb(() => { I.waitForElement('#data'); I.seeInCurrentUrl('/data');});Detox
Not available in this helper.
I.runOnAndroid()
Section titled “I.runOnAndroid()”| Appium | Detox |
|---|---|
| Supported | Supported |
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
capsanyfnany
Detox
Execute code only on Android
I.runOnAndroid(() => { I.click('Button'); I.see('Hi, Android');});Parameters
fnFunction a function which will be executed on android
I.runOnIOS()
Section titled “I.runOnIOS()”| Appium | Detox |
|---|---|
| Supported | Supported |
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
capsanyfnany
Detox
Execute code only on iOS
I.runOnIOS(() => { I.click('Button'); I.see('Hi, IOS');});Parameters
fnFunction a function which will be executed on iOS
I.saveElementScreenshot()
Section titled “I.saveElementScreenshot()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js). Filename is relative to output folder.
I.saveElementScreenshot(`#submit`,'debug.png');Parameters
locator(string | object) element located by CSS|XPath|strict locator.fileNamestring file name to save.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.saveScreenshot()
Section titled “I.saveScreenshot()”| Appium | Detox |
|---|---|
| Supported | Supported |
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
fileNamestring file name to save.
Returns Promise
Detox
Saves a screenshot to the output dir
I.saveScreenshot('main-window.png');Parameters
namestring
I.scrollDown()
Section titled “I.scrollDown()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Scrolls to the bottom of an element.
I.scrollDown('#container');Parameters
I.scrollIntoView()
Section titled “I.scrollIntoView()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Scroll element into viewport.
I.scrollIntoView('#submit');I.scrollIntoView('#submit', true);I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });Parameters
locator(string | object) located by CSS|XPath|strict locator.scrollIntoViewOptions(ScrollIntoViewOptions | boolean) either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][19].
Returns void automatically synchronized promise through #recorderSupported only for web testing
Detox
Not available in this helper.
I.scrollLeft()
Section titled “I.scrollLeft()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Scrolls to the left of an element.
I.scrollLeft('#container');Parameters
I.scrollPageToBottom()
Section titled “I.scrollPageToBottom()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Scroll page to the bottom.
I.scrollPageToBottom();Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.scrollPageToTop()
Section titled “I.scrollPageToTop()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Scroll page to the top.
I.scrollPageToTop();Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.scrollRight()
Section titled “I.scrollRight()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Scrolls to the right of an element.
I.scrollRight('#container');Parameters
I.scrollTo()
Section titled “I.scrollTo()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Scrolls to element matched by locator. Extra shift can be set with offsetX and offsetY options.
I.scrollTo('footer');I.scrollTo('#submit', 5, 5);Parameters
locator(string | object) located by CSS|XPath|strict locator.offsetX[number][12] (optional,0by default) X-axis offset.offsetY[number][12] (optional,0by default) Y-axis offset.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.scrollToElement()
Section titled “I.scrollToElement()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 tocontainerLocator(string | object) Locator of the scrollable containerdirectionstring ‘up’ or ‘down’ (optional, default'down')offsetnumber Offset for scroll, can be adjusted based on need (optional, default100)
I.scrollUp()
Section titled “I.scrollUp()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Scrolls to the top of an element.
I.scrollUp('#container');Parameters
I.see()
Section titled “I.see()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Checks that a page contains a visible text. Use context parameter to narrow down the search.
I.see('Welcome'); // text welcome on a pageI.see('Welcome', '.content'); // text inside .content divI.see('Register', {css: 'form.register'}); // use strict locatorParameters
textstring expected on page.context(string? | object) (optional,nullby default) element located by CSS|Xpath|strict locator in which to search for text.
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
textstring to check visibilitycontext(string | object | null) element inside which to search for text (optional, defaultnull)
I.seeAppIsInstalled()
Section titled “I.seeAppIsInstalled()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Check if an app is installed.
I.seeAppIsInstalled("com.example.android.apis");Parameters
bundleIdstring String ID of bundled app
Returns Promise
Detox
Not available in this helper.
I.seeAppIsNotInstalled()
Section titled “I.seeAppIsNotInstalled()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Check if an app is not installed.
I.seeAppIsNotInstalled("com.example.android.apis");Parameters
bundleIdstring String ID of bundled app
Returns Promise
Detox
Not available in this helper.
I.seeAttributesOnElements()
Section titled “I.seeAttributesOnElements()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that all elements with given locator have given attributes.
I.seeAttributesOnElements('//form', { method: "post"});Parameters
locator(string | object) located by CSS|XPath|strict locator.attributesobject attributes and their values to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeCheckboxIsChecked()
Section titled “I.seeCheckboxIsChecked()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Verifies that the specified checkbox is checked.
I.seeCheckboxIsChecked('Agree');I.seeCheckboxIsChecked('#agree'); // I suppose user agreed to termsI.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});Parameters
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeClipboardEquals()
Section titled “I.seeClipboardEquals()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that the system clipboard is equal to the given text.
I.click('Copy to clipboard');I.seeClipboardEquals('https://codecept.io');Reading the clipboard requires a secure context (https or localhost) and is supported
in Chromium-based browsers, where read access is granted automatically.
Parameters
textstring value to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeCurrentActivityIs()
Section titled “I.seeCurrentActivityIs()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Check current activity on an Android device.
I.seeCurrentActivityIs(".HomeScreenActivity")Parameters
currentActivitystring
Returns Promise
Detox
Not available in this helper.
I.seeCurrentPathEquals()
Section titled “I.seeCurrentPathEquals()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that current URL path matches the expected path. Query strings and URL fragments are ignored.
I.seeCurrentPathEquals('/info'); // passes for '/info', '/info?user=1', '/info#section'I.seeCurrentPathEquals('/'); // passes for '/', '/?user=ok', '/#top'Parameters
pathstring value to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeDeviceIsLocked()
Section titled “I.seeDeviceIsLocked()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Check whether the device is locked.
I.seeDeviceIsLocked();Returns Promise
Detox
Not available in this helper.
I.seeDeviceIsUnlocked()
Section titled “I.seeDeviceIsUnlocked()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Check whether the device is not locked.
I.seeDeviceIsUnlocked();Returns Promise
Detox
Not available in this helper.
I.seeElement()
Section titled “I.seeElement()”| Appium | Detox |
|---|---|
| Supported | Supported |
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');// using ARIA role locatorI.seeElement({role: 'dialog'});ℹ️ ARIA role locators (
{role, name}) match elements the way assistive technology does and survive markup refactors. See Locators.
Parameters
locator(string | object) located by CSS|XPath|strict locator.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
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 idI.seeElement('~edit', '#menu'); // element inside #menuParameters
locator(string | object) element to locatecontext(string | object | null) context element (optional, defaultnull)
I.seeElementExists()
Section titled “I.seeElementExists()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 idI.seeElementExists('~edit', '#menu'); // element inside #menuParameters
locator(string | object) element to locatecontext(string | object) context element (optional, defaultnull)
I.seeElementInDOM()
Section titled “I.seeElementInDOM()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that a given Element is present in the DOM Element is located by CSS or XPath.
I.seeElementInDOM('#modal');Parameters
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeInClipboard()
Section titled “I.seeInClipboard()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that the system clipboard contains the given text.
I.click('Copy to clipboard');I.seeInClipboard('https://codecept.io');Reading the clipboard requires a secure context (https or localhost) and is supported
in Chromium-based browsers, where read access is granted automatically.
Parameters
textstring value to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeInField()
Section titled “I.seeInField()”| Appium | Detox |
|---|---|
| Supported | Not 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 contextI.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,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeInSource()
Section titled “I.seeInSource()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that the current page contains the given string in its raw source code.
I.seeInSource('<h1>Green eggs & ham</h1>');Parameters
textstring value to check.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeNumberOfElements()
Section titled “I.seeNumberOfElements()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Asserts that an element appears a given number of times in the DOM. Element is located by label or name or CSS or XPath.
I.seeNumberOfElements('#submitBtn', 1);Parameters
locator(string | object) element located by CSS|XPath|strict locator.num[number][12] number of elements.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeNumberOfVisibleElements()
Section titled “I.seeNumberOfVisibleElements()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Asserts that an element is visible a given number of times. Element is located by CSS or XPath.
I.seeNumberOfVisibleElements('.buttons', 3);Parameters
locator(string | object) element located by CSS|XPath|strict locator.num[number][12] number of elements.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.seeOrientationIs()
Section titled “I.seeOrientationIs()”| Appium | Detox |
|---|---|
| Supported | Not 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
Detox
Not available in this helper.
I.seeTextEquals()
Section titled “I.seeTextEquals()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Checks that text is equal to provided one.
I.seeTextEquals('text', 'h1');Parameters
textstring element value to check.context(string | object)? element located by CSS|XPath|strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.selectOption()
Section titled “I.selectOption()”| Appium | Detox |
|---|---|
| Supported | Not 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 labelI.selectOption('subscription', 'Monthly'); // match option by textI.selectOption('subscription', '0'); // or by valueI.selectOption('//form/select[@name=account]','Premium');I.selectOption('form select[name=account]', 'Premium');I.selectOption({css: 'form select[name=account]'}, 'Premium');// within a contextI.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][15]) visible text or value of option.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorderSupported only for web testing
Detox
Not available in this helper.
I.sendDeviceKeyEvent()
Section titled “I.sendDeviceKeyEvent()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Send a key event to the device. List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][20]
I.sendDeviceKeyEvent(3);Parameters
keyValue[number][12] Device specific key value
Returns Promise
Detox
Not available in this helper.
I.setImmediateValue()
Section titled “I.setImmediateValue()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Set immediate value in app.
See corresponding [webdriverio reference][21].
Parameters
idvalue
Returns Promise
Detox
Not available in this helper.
I.setLandscapeOrientation()
Section titled “I.setLandscapeOrientation()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Switches device to landscape orientation
I.setLandscapeOrientation();I.setNetworkConnection()
Section titled “I.setNetworkConnection()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Set network connection mode.
- airplane mode
- wifi mode
- data data
I.setNetworkConnection(0) // airplane mode off, wifi off, data offI.setNetworkConnection(1) // airplane mode on, wifi off, data offI.setNetworkConnection(2) // airplane mode off, wifi on, data offI.setNetworkConnection(4) // airplane mode off, wifi off, data onI.setNetworkConnection(6) // airplane mode off, wifi on, data onSee corresponding [webdriverio reference][22].
Appium: support only Android
Parameters
value[number][12] The network connection mode bitmask
Returns Promise<[number][12]>
Detox
Not available in this helper.
I.setOrientation()
Section titled “I.setOrientation()”| Appium | Detox |
|---|---|
| Supported | Not 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.
I.setPortraitOrientation()
Section titled “I.setPortraitOrientation()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Switches device to portrait orientation
I.setPortraitOrientation();I.setSettings()
Section titled “I.setSettings()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Update the current setting on the device
I.setSettings({cyberdelia: 'open'});Parameters
settingsobject objectAppium: support Android and iOS
Detox
Not available in this helper.
I.shakeDevice()
Section titled “I.shakeDevice()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Perform a shake action on the device.
I.shakeDevice();Returns Promise
Detox
Shakes the device.
I.shakeDevice();I.simulateTouchId()
Section titled “I.simulateTouchId()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.
I.touchId(); // simulates valid fingerprintI.touchId(true); // simulates valid fingerprintI.touchId(false); // simulates invalid fingerprintParameters
match
Returns Promise
Detox
Not available in this helper.
I.startActivity()
Section titled “I.startActivity()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Start an arbitrary Android activity during a session.
I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');Appium: support only Android
Parameters
Returns Promise
Detox
Not available in this helper.
I.swipe()
Section titled “I.swipe()”| Appium | Detox |
|---|---|
| Supported | Not 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][23]
Parameters
locator(string | object)xoffset[number][12]yoffset[number][12]speed[number][12] (optional), 1000 by default
Returns Promise
Detox
Not available in this helper.
I.swipeDown()
Section titled “I.swipeDown()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Perform a swipe down on an element.
let locator = "#io.selendroid.testapp:id/LinearLayout1";I.swipeDown(locator); // simple swipeI.swipeDown(locator, 500); // set speedI.swipeDown(locator, 1200, 1000); // set offset and speedParameters
locator(string | object)yoffset[number][12]? (optional)speed[number][12] (optional), 1000 by default
Returns Promise
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 swipespeedstring a speed to perform:sloworfast. (optional, default'slow')
I.swipeLeft()
Section titled “I.swipeLeft()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Perform a swipe left on an element.
let locator = "#io.selendroid.testapp:id/LinearLayout1";I.swipeLeft(locator); // simple swipeI.swipeLeft(locator, 500); // set speedI.swipeLeft(locator, 1200, 1000); // set offset and speedParameters
locator(string | object)xoffset[number][12]? (optional)speed[number][12] (optional), 1000 by default
Returns Promise
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 swipespeedstring a speed to perform:sloworfast. (optional, default'slow')
I.swipeRight()
Section titled “I.swipeRight()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Perform a swipe right on an element.
let locator = "#io.selendroid.testapp:id/LinearLayout1";I.swipeRight(locator); // simple swipeI.swipeRight(locator, 500); // set speedI.swipeRight(locator, 1200, 1000); // set offset and speedParameters
locator(string | object)xoffset[number][12]? (optional)speed[number][12] (optional), 1000 by default
Returns Promise
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 swipespeedstring a speed to perform:sloworfast. (optional, default'slow')
I.swipeTo()
Section titled “I.swipeTo()”| Appium | Detox |
|---|---|
| Supported | Not 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
searchableLocatorstringscrollLocatorstringdirectionstringtimeout[number][12]offset[number][12]speed[number][12]
Returns Promise
Detox
Not available in this helper.
I.swipeUp()
Section titled “I.swipeUp()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Perform a swipe up on an element.
let locator = "#io.selendroid.testapp:id/LinearLayout1";I.swipeUp(locator); // simple swipeI.swipeUp(locator, 500); // set speedI.swipeUp(locator, 1200, 1000); // set offset and speedParameters
locator(string | object)yoffset[number][12]? (optional)speed[number][12] (optional), 1000 by default
Returns Promise
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 swipespeedstring a speed to perform:sloworfast. (optional, default'slow')
I.switchTo()
Section titled “I.switchTo()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Switches frame or in case of null locator reverts to parent.
I.switchTo('iframe'); // switch to first iframeI.switchTo(); // switch back to main pageParameters
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.switchToContext()
Section titled “I.switchToContext()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Switch to the specified context.
Parameters
contextany the context to switch to
Detox
Not available in this helper.
I.switchToNative()
Section titled “I.switchToNative()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Switches to native context. By default switches to NATIVE_APP context unless other specified.
I.switchToNative();
// or set context explicitlyI.switchToNative('SOME_OTHER_CONTEXT');Parameters
contextany?
Returns Promise
Detox
Not available in this helper.
I.switchToWeb()
Section titled “I.switchToWeb()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Switches to web context. If no context is provided switches to the first detected web context
// switch to first web contextI.switchToWeb();
// or set the context explicitlyI.switchToWeb('WEBVIEW_io.selendroid.testapp');Parameters
contextstring?
Returns Promise
Detox
Not available in this helper.
I.switchToWindow()
Section titled “I.switchToWindow()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Switch to the window with a specified handle.
const windows = await I.grabAllWindowHandles();// ... do somethingawait I.switchToWindow( windows[0] );
const window = await I.grabCurrentWindowHandle();// ... do somethingawait I.switchToWindow( window );Parameters
windowstring name of window handle.
Detox
Not available in this helper.
I.tap()
Section titled “I.tap()”| Appium | Detox |
|---|---|
| Supported | Supported |
Appium
Taps on element.
I.tap("~buttonStartWebviewCD");Shortcut for makeTouchAction
Parameters
locatorany
Returns Promise
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 textI.tap('~nav-1'); // locate by accessibility labelI.tap('#user'); // locate by idI.tap('Login', '#nav'); // locate by text inside #navI.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and AndroidParameters
I.tapByLabel()
Section titled “I.tapByLabel()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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 textI.tapByLabel('Login', '#nav'); // locate by text inside #navParameters
I.tapReturnKey()
Section titled “I.tapReturnKey()”| Appium | Detox |
|---|---|
| Not supported | Supported |
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
I.touchPerform()
Section titled “I.touchPerform()”| Appium | Detox |
|---|---|
| Supported | Not 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][15] Array of touch actions
Detox
Not available in this helper.
I.type()
Section titled “I.type()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Types out the given text into an active field.
To slow down typing use a second parameter, to set interval between key presses.
Note: Should be used when [fillField][24] is not an option.
// passing in a stringI.type('Type this out.');
// typing values with a 100ms intervalI.type('4141555311111111', 100);
// passing in an arrayI.type(['T', 'E', 'X', 'T']);
// passing a secretI.type(secret('123456'));Parameters
keysdelay[number][12]? (optional) delay in ms between key presseskey(string | [Array][15]<string>) or array of keys to type.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.uncheckOption()
Section titled “I.uncheckOption()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Appium: not tested Unselects 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.uncheckOption('#agree');I.uncheckOption('I Agree to Terms and Conditions');I.uncheckOption('agree', '//form');Parameters
field(string | object) checkbox located by label | name | CSS | XPath | strict locator.context(string? | object) (optional,nullby default) element located by CSS | XPath | strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.useWebDriverTo()
Section titled “I.useWebDriverTo()”| Appium | Detox |
|---|---|
| Supported | Not supported |
Appium
Use [webdriverio][25] API inside a test.
First argument is a description of an action. Second argument is async function that gets this helper as parameter.
{ [browser][25]) } object from WebDriver API is available.
I.useWebDriverTo('open multiple windows', async ({ browser }) { // create new window await browser.newWindow('https://webdriver.io');});Parameters
descriptionstring used to show in logs.fn[function][26] async functuion that executed with WebDriver helper as argument
Detox
Not available in this helper.
I.wait()
Section titled “I.wait()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Waits for number of seconds
I.wait(2); // waits for 2 secondsParameters
secnumber number of seconds to wait
I.waitForElement()
Section titled “I.waitForElement()”| Appium | Detox |
|---|---|
| Supported | Supported |
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 secsParameters
locator(string | object) element located by CSS|XPath|strict locator.sec[number][12]? (optional,1by default) time in seconds to wait
Returns void automatically synchronized promise through #recorder
Detox
Waits for an element to exist on page.
I.waitForElement('#message', 1); // wait for 1 secondParameters
locator(string | object) an element to wait forsecnumber number of seconds to wait, 5 by default (optional, default5)
I.waitForElementVisible()
Section titled “I.waitForElementVisible()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Waits for an element to be visible on page.
I.waitForElementVisible('#message', 1); // wait for 1 secondParameters
locator(string | object) an element to wait forsecnumber number of seconds to wait (optional, default5)
I.waitForInvisible()
Section titled “I.waitForInvisible()”| Appium | Detox |
|---|---|
| Supported | Not 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][12] (optional,1by default) time in seconds to wait
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.waitForText()
Section titled “I.waitForText()”| Appium | Detox |
|---|---|
| Supported | Not 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
textstring to wait for.sec[number][12] (optional,1by default) time in seconds to waitcontext(string | object)? (optional) element located by CSS|XPath|strict locator.
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.waitForVisible()
Section titled “I.waitForVisible()”| Appium | Detox |
|---|---|
| Supported | Not 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][12] (optional,1by default) time in seconds to wait
Returns void automatically synchronized promise through #recorder
Detox
Not available in this helper.
I.waitToHide()
Section titled “I.waitToHide()”| Appium | Detox |
|---|---|
| Not supported | Supported |
Appium
Not available in this helper.
Detox
Waits an elmenet to become not visible.
I.waitToHide('#message', 2); // wait for 2 secondsParameters