Macaca

API docs

Members

assertAttribute :assert

Support: Web(WebView)

Check if element's attribute right.

Type:

Source:
helper.js#L430

assertTitle :assert

Support: Web(WebView)

Check if title exists.

Type:

Source:
helper.js#L414

coverage :utility

Support: Web(WebView)

Generate the coverage reporter.

Type:

Source:
helper.js#L152

elementTouch :utility

Support: Web(WebView)

Simulate the element touch event.

Type:

Source:
helper.js#L293

formatInput :utility

Support: Web(WebView)

Type content to input element.

Type:

Source:
helper.js#L254

getUrl :utility

Support: Web(WebView)

Get webpage from url util the page ready.

Type:

Source:
helper.js#L61

hasElementByCss :assert

Support: Web(WebView)

Check if element is existed.

Type:

Source:
helper.js#L396

hasText :assert

Support: Web(WebView)

Check if element has pointed text.

Type:

Source:
helper.js#L382

initWindow :utility

Support: Web(WebView)

Initial browser window.

Type:

Source:
helper.js#L43

keyboardEvent :utility

Support: Web(WebView)

Simulate the keyboard event.

Type:

Source:
helper.js#L334

mouseEvent :utility

Support: Web(WebView)

Simulate the mouse event.

Type:

Source:
helper.js#L360

openReporter :utility

Support: Web(WebView)

Open all reporters in browser.

Type:

Source:
helper.js#L180

saveScreenshots :utility

Support: Web(WebView)

Save screenshots to ./screenshots.

Type:

Source:
helper.js#L133

switchAllScenes :datahub

Support: Web(WebView)

Switch all scenes with DataHub.

Type:

Source:
helper.js#L239

switchMultiScenes :datahub

Support: Web(WebView)

Switch multi-scene with DataHub.

Type:

Source:
helper.js#L221

switchScene :datahub

Support: Web(WebView)

Switch scene with DataHub.

Type:

Source:
helper.js#L207

#acceptAlert() → { Promise.<string> }

Support: Android iOS

Accepts the currently displayed alert dialog.

Source:
macaca-wd.js#L615
See:

Returns:

Type
Promise.<string>

#alertKeys(keys) → { Promise.<string> }

Support: iOS

Sends keystrokes to a JavaScript prompt() dialog.

Parameters:

Name Type Description
keys
Source:
macaca-wd.js#L640
See:

Returns:

Type
Promise.<string>

#alertText() → { Promise.<string> }

Support: iOS

Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog.

Source:
macaca-wd.js#L631
See:

Returns:

Type
Promise.<string>

#allCookies() → { Promise.<string> }

Support: Web(WebView)

Returns all cookies associated with the address of the current browsing context’s active document.

Source:
macaca-wd.js#L776
See:

Returns:

Type
Promise.<string>

#back() → { Promise.<string> }

Support: Android Web(WebView)

Navigate backwards in the browser history, if possible.

Source:
macaca-wd.js#L676
See:

Returns:

Type
Promise.<string>

#clear() → { Promise.<string> }

Support: Android iOS Web(WebView)

Clear a TEXTAREA or text INPUT element's value.

Source:
macaca-wd.js#L552
See:

Returns:

Type
Promise.<string>

#click() → { Promise }

Support: Android iOS Web(WebView)

Click on an element.

Source:
macaca-wd.js#L517
See:

Returns:

Type
Promise

#close() → { Promise.<string> }

Support: Web(WebView)

Close the current window.

Source:
macaca-wd.js#L702
See:

Returns:

Type
Promise.<string>

#context(contextRef) → { Promise }

Support: Android iOS

Set the current context.

Parameters:

Name Type Description
contextRef string context reference from contexts
Source:
macaca-wd.js#L49

Returns:

Type
Promise

#contexts() → { Promise.<Array> }

Support: Android iOS

Get a list of the available contexts.

Source:
macaca-wd.js#L56

Returns:

A list of available contexts.
Type
Promise.<Array>

#currentContext() → { Promise.<string> }

Support: Android iOS

Get the current context.

Source:
macaca-wd.js#L41

Returns:

Type
Promise.<string>

#deleteAllCookies() → { Promise.<string> }

Support: Web(WebView)

Allows deletion of all cookies associated with the active document’s address.

Source:
macaca-wd.js#L800
See:

Returns:

Type
Promise.<string>

#deleteCookie() → { Promise.<string> }

Support: Web(WebView)

Delete either a single cookie by parameter name, or all the cookies associated with the active document’s address if name is undefined.

Source:
macaca-wd.js#L792
See:

Returns:

Type
Promise.<string>

#dismissAlert() → { Promise.<string> }

Support: Android iOS

Dismisses the currently displayed alert dialog.

Source:
macaca-wd.js#L623
See:

Returns:

Type
Promise.<string>

#element(using, value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
using string The locator strategy to use.
value string The search target.
Source:
macaca-wd.js#L97
See:

Returns:

Type
Promise.<Element>

#elementByClassName(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The class name
Source:
macaca-wd.js#L106
See:

Returns:

Type
Promise.<Element>

#elementByClassNameIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The class name
Source:
macaca-wd.js#L365
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByClassNameOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The class name
Source:
macaca-wd.js#L283
See:

Returns:

Type
Promise.<(Element|null)>

#elementByCss(value) → { Promise.<Element> }

Support: Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The css selector
Source:
macaca-wd.js#L115
See:

Returns:

Type
Promise.<Element>

#elementByCssIfExists(value) → { Promise.<(Element|undefined)> }

Support: Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The css selector
Source:
macaca-wd.js#L374
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByCssOrNull(value) → { Promise.<(Element|null)> }

Support: Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The css selector
Source:
macaca-wd.js#L292
See:

Returns:

Type
Promise.<(Element|null)>

#elementById(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The ID attribute
Source:
macaca-wd.js#L124
See:

Returns:

Type
Promise.<Element>

#elementByIdIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The ID attribute
Source:
macaca-wd.js#L383
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByIdOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The ID attribute
Source:
macaca-wd.js#L301
See:

Returns:

Type
Promise.<(Element|null)>

#elementByLinkText(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The text
Source:
macaca-wd.js#L142
See:

Returns:

Type
Promise.<Element>

#elementByLinkTextIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The text
Source:
macaca-wd.js#L401
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByLinkTextOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The text
Source:
macaca-wd.js#L319
See:

Returns:

Type
Promise.<(Element|null)>

#elementByName(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The name attribute
Source:
macaca-wd.js#L133
See:

Returns:

Type
Promise.<Element>

#elementByNameIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The name attribute
Source:
macaca-wd.js#L392
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByNameOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The name attribute
Source:
macaca-wd.js#L310
See:

Returns:

Type
Promise.<(Element|null)>

#elementByPartialLinkText(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The partially text
Source:
macaca-wd.js#L151
See:

Returns:

Type
Promise.<Element>

#elementByPartialLinkTextIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The partially text
Source:
macaca-wd.js#L410
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByPartialLinkTextOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The partially text
Source:
macaca-wd.js#L328
See:

Returns:

Type
Promise.<(Element|null)>

#elementByTagName(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The tag name
Source:
macaca-wd.js#L160
See:

Returns:

Type
Promise.<Element>

#elementByTagNameIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The tag name
Source:
macaca-wd.js#L419
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByTagNameOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The tag name
Source:
macaca-wd.js#L337
See:

Returns:

Type
Promise.<(Element|null)>

#elementByXPath(value) → { Promise.<Element> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The XPath expression
Source:
macaca-wd.js#L169
See:

Returns:

Type
Promise.<Element>

#elementByXPathIfExists(value) → { Promise.<(Element|undefined)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The XPath expression
Source:
macaca-wd.js#L428
See:

Returns:

Type
Promise.<(Element|undefined)>

#elementByXPathOrNull(value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
value string The XPath expression
Source:
macaca-wd.js#L346
See:

Returns:

Type
Promise.<(Element|null)>

#elementIfExists(using, value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
using string The locator strategy to use.
value string The search target.
Source:
macaca-wd.js#L356
See:

Returns:

Type
Promise.<(Element|null)>

#elementOrNull(using, value) → { Promise.<(Element|null)> }

Support: Android iOS Web(WebView)

Search for an element on the page, starting from the document root.

Parameters:

Name Type Description
using string The locator strategy to use.
value string The search target.
Source:
macaca-wd.js#L274
See:

Returns:

Type
Promise.<(Element|null)>

#elements(using, value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
using string The locator strategy to use.
value string The search target.
Source:
macaca-wd.js#L179
See:

Returns:

Type
Promise.<Array>

#elementsByClassName(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The class name
Source:
macaca-wd.js#L188
See:

Returns:

Type
Promise.<Array>

#elementsByCss(value) → { Promise.<Array> }

Support: Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The css selector
Source:
macaca-wd.js#L197
See:

Returns:

Type
Promise.<Array>

#elementsById(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The ID attribute
Source:
macaca-wd.js#L206
See:

Returns:

Type
Promise.<Array>

#elementsByLinkText(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The text
Source:
macaca-wd.js#L224
See:

Returns:

Type
Promise.<Array>

#elementsByName(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The name attribute
Source:
macaca-wd.js#L215
See:

Returns:

Type
Promise.<Array>

#elementsByPartialLinkText(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The partially text
Source:
macaca-wd.js#L233
See:

Returns:

Type
Promise.<Array>

#elementsByTagName(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The tag name
Source:
macaca-wd.js#L242
See:

Returns:

Type
Promise.<Array>

#elementsByXPath(value) → { Promise.<Array> }

Support: Android iOS Web(WebView)

Search for multiple elements on the page, starting from the document root.

Parameters:

Name Type Description
value string The XPath expression
Source:
macaca-wd.js#L251
See:

Returns:

Type
Promise.<Array>

#execute(code, argsopt) → { Promise.<string> }

Support: Web(WebView)

Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame.

Parameters:

Name Type Attributes Description
code script
args <optional>
script argument array
Source:
macaca-wd.js#L599
See:

Returns:

Type
Promise.<string>

#forward() → { Promise.<string> }

Support: Web(WebView)

Navigate forwards in the browser history, if possible.

Source:
macaca-wd.js#L667
See:

Returns:

Type
Promise.<string>

#frame(frameRef) → { Promise.<string> }

Support: Web(WebView)

Change focus to another frame on the page.

Parameters:

Name Type Description
frameRef string | number | null Identifier(id/name) for the frame to change focus to
Source:
macaca-wd.js#L757
See:

Returns:

Type
Promise.<string>

#get(url) → { Promise.<string> }

Support: Web(WebView)

Navigate to a new URL.

Parameters:

Name Type Description
url get a new url.
Source:
macaca-wd.js#L658
See:

Returns:

Type
Promise.<string>

#getComputedCss(propertyName) → { Promise.<string> }

Support: Web(WebView)

Query the value of an element's computed CSS property.

Parameters:

Name Type Description
propertyName string The property name
Source:
macaca-wd.js#L580
See:

Returns:

Type
Promise.<string>

#getProperty(name) → { Promise.<string> }

Support: Android iOS Web(WebView). iOS: 'isVisible', 'isAccessible', 'isEnabled', 'type', 'label', 'name', 'value', Android: 'selected', 'description', 'text'

Get the result of a property of a element.

Parameters:

Name Type Description
name string The property name
Source:
macaca-wd.js#L570
See:

Returns:

Type
Promise.<string>

#getRect() → { Promise.<string> }

Support: Android iOS.

Get the dimensions and coordinates of the given element with a object including x/y/height/width.

Source:
macaca-wd.js#L589
See:

Returns:

Type
Promise.<string>

#getWindowSize(handleopt) → { Promise.<string> }

Support: Android iOS Web(WebView)

Get the size of the specified window.

Parameters:

Name Type Attributes Description
handle <optional>
window handle to set size for (optional, default: 'current')
Source:
macaca-wd.js#L727
See:

Returns:

Type
Promise.<string>

#hasElement(using, value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
using string The locator strategy to use.
value string The search target.
Source:
macaca-wd.js#L439
See:

Returns:

Type
Promise.<boolean>

#hasElementByClassName(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The class name.
Source:
macaca-wd.js#L449
See:

Returns:

Type
Promise.<boolean>

#hasElementById(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The ID attribute.
Source:
macaca-wd.js#L459
See:

Returns:

Type
Promise.<boolean>

#hasElementByLinkText(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The text.
Source:
macaca-wd.js#L479
See:

Returns:

Type
Promise.<boolean>

#hasElementByName(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The name attribute.
Source:
macaca-wd.js#L469
See:

Returns:

Type
Promise.<boolean>

#hasElementByPartialLinkText(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The partially text.
Source:
macaca-wd.js#L489
See:

Returns:

Type
Promise.<boolean>

#hasElementByTagName(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The tag name.
Source:
macaca-wd.js#L499
See:

Returns:

Type
Promise.<boolean>

#hasElementByXPath(value) → { Promise.<boolean> }

Support: Android iOS Web(WebView)

Check if element exists.

Parameters:

Name Type Description
value string The XPath expression.
Source:
macaca-wd.js#L509
See:

Returns:

Type
Promise.<boolean>

#init(desired) → { Promise.<Object> }

Support: Android iOS Web(WebView)

Create a new session.

Parameters:

Name Type Description
desired Object Desired Capabilities
Source:
macaca-wd.js#L18
See:

Returns:

Type
Promise.<Object>

#isDisplayed() → { Promise.<string> }

Support: Android Web(WebView)

Determine if an element is currently displayed.

Source:
macaca-wd.js#L560

Returns:

Type
Promise.<string>

#keys(keys) → { Promise }

Support: Android Web(WebView) More: https://github.com/alibaba/macaca/issues/487

Send a sequence of key strokes to the active window.

Parameters:

Name Type Description
keys string The keys sequence to be sent.
Source:
macaca-wd.js#L535

Returns:

Type
Promise

#maximize(handle) → { Promise.<string> }

Support: Web(WebView)

Maximize the specified window if not already maximized.

Parameters:

Name Type Description
handle window handle
Source:
macaca-wd.js#L748
See:

Returns:

Type
Promise.<string>

#quit() → { Promise }

Support: Android iOS Web(WebView)

Delete the session.

Source:
macaca-wd.js#L34
See:

Returns:

Type
Promise

#refresh() → { Promise.<string> }

Support: Web(WebView)

Refresh the current page.

Source:
macaca-wd.js#L685
See:

Returns:

Type
Promise.<string>

#saveScreenshot(filepath) → { Promise.<string> }

Support: Android iOS Web(WebView)

Save the screenshot of the current page.

Parameters:

Name Type Description
filepath str The path to save the screenshot or left blank (will create a file in the system temp dir).
Source:
macaca-wd.js#L79

Returns:

The filepath of the screenshot.
Type
Promise.<string>

#sendKeys(keys) → { Promise }

Support: Android iOS Web(WebView)

Send a sequence of key strokes to the active element.

Parameters:

Name Type Description
keys string The keys sequence to be sent.
Source:
macaca-wd.js#L527
See:

Returns:

Type
Promise

#sessions() → { Promise.<Array> }

Support: Android iOS Web(WebView)

Returns a list of the currently active sessions.

Source:
macaca-wd.js#L25

Returns:

Type
Promise.<Array>

#setCookie() → { Promise.<string> }

Support: Web(WebView)

Adds a single cookie to the cookie store associated with the active document’s address. {url: 'https://macacajs.github.io', name:'foo', value:'bar'} Optional cookie fields: secure, expiry

Source:
macaca-wd.js#L784
See:

Returns:

Type
Promise.<string>

#setWindowSize(width, height, handleopt) → { Promise.<string> }

Support: Web(WebView)

Change the size of the specified window.

Parameters:

Name Type Attributes Description
width width in pixels to set size to
height height in pixels to set size to
handle <optional>
window handle to set size for (optional, default: 'current')
Source:
macaca-wd.js#L738
See:

Returns:

Type
Promise.<string>

#sleep(ms) → { Promise }

Support: Android iOS Web(WebView)

Set the amount of time the driver should wait.

Parameters:

Name Type Description
ms number The amount of time to wait, in milliseconds
Source:
macaca-wd.js#L64

Returns:

Type
Promise

#source() → { Promise.<string> }

Support: Android iOS Web(WebView)

Get the current page source.

Source:
macaca-wd.js#L87
See:

Returns:

Type
Promise.<string>

#status() → { Promise.<Object> }

Support: Android iOS Web(WebView)

Query the server's current status.

Source:
macaca-wd.js#L8

Returns:

The server's current status.
Type
Promise.<Object>

#takeScreenshot() → { Promise.<string> }

Support: Android iOS Web(WebView)

Take a screenshot of the current page.

Source:
macaca-wd.js#L71

Returns:

The screenshot as a base64 encoded PNG.
Type
Promise.<string>

#text() → { Promise.<string> }

Support: Android iOS Web(WebView)

Returns the visible text for the element.

Source:
macaca-wd.js#L543

Returns:

Type
Promise.<string>

#title() → { Promise.<string> }

Support: Android iOS Web(WebView)

Get the current page title or focus activity or viewController.

Source:
macaca-wd.js#L607
See:

Returns:

Type
Promise.<string>

#touch(action, objectopt) → { Promise.<string> }

Support: iOS, Android

Apply touch actions on devices.

Parameters:

Name Type Attributes Description
action string Name of the action, tap/doubleTap/press/pinch/rotate/drag.
object <optional>
args Parameters of the action more params
Source:
macaca-wd.js#L768
See:

Returns:

Type
Promise.<string>

Example

driver.touch('doubleTap', {x: 100, y: 100});

#url() → { Promise.<string> }

Support: Web(WebView)

Retrieve the URL of the current page.

Source:
macaca-wd.js#L648
See:

Returns:

Type
Promise.<string>

#waitForElement(using, value, asserteropt, timeoutopt, intervalopt) → { Promise.<Array> }

Support: Android iOS Web(WebView)

All the element-related methods above (except which suffixed with OrNull, IfExists) could be prefixed with the "waitFor-" (need to capitalize the 'e', e.g., waitForElementByClassName)

Parameters:

Name Type Attributes Default Description
using string The locator strategy to use, omitted when using specific method like waitForElementByClassName.
value string The css selector
asserter function <optional>
The asserter function (commonly used asserter function can be found at wd.asserters) (optional)
timeout number <optional>
1000ms The timeout before find the element (optional)
interval number <optional>
200ms The interval between each searching (optional)
Source:
macaca-wd.js#L264

Returns:

Type
Promise.<Array>

Example

waitForElementByClassName('btn', 2000, 100) Search for element which class name is 'btn' at intervals of 100ms, last for 2000ms.

#window() → { Promise.<string> }

Support: Web(WebView)

Change focus to another window.

Source:
macaca-wd.js#L693
See:

Returns:

Type
Promise.<string>

#windowHandle() → { Promise.<string> }

Support: Web(WebView)

Retrieve the current window handle.

Source:
macaca-wd.js#L710
See:

Returns:

Type
Promise.<string>

#windowHandles() → { Promise.<string> }

Support: Web(WebView)

Retrieve the list of all window handles available to the session.

Source:
macaca-wd.js#L718
See:

Returns:

Type
Promise.<string>