Locate an element on the screen with accessibility identifier. This method defaults to
a substring match, and this can be overridden by setting the exact option to true.
Usage:
const element = await device.getById("signup_button");
string to search for
Optionalexact?: booleanLocate an element on the screen with text content. This method defaults to a
substring match, and this be overridden by setting the exact option to true.
Usage:
// with string
const submitButton = device.getByText("Submit");
// with RegExp
const counter = device.getByText(/^Counter: \d+/);
string or regular expression to search for
Optionalexact?: booleanLocate an element on the screen with xpath.
Usage:
const element = await device.getByXpath(`//android.widget.Button[@text="Confirm"]`);
xpath to locate the element
Retrieves text content from the clipboard of the mobile device. This is useful after a "copy to clipboard" action has been performed. This returns base64 encoded string.
Usage:
const clipboardText = await device.getClipboardText();
Returns the text content of the clipboard in base64 encoded string.
OptionaltextSets a mock camera view using the specified image. This injects a mock image into the camera view. Currently, this functionality is supported only for BrowserStack.
Usage:
await device.setMockCameraView(`screenshot.png`);
path to the image file that will be used as the mock camera view.
Closes the automation session. This is called automatically after each test.
Usage: