# WebdriverIO > Next-gen browser and mobile automation test framework for Node.js ## community ### donate If your company uses WebdriverIO and benefits from it, please ask your manager or your marketing team to support the project by donating to the collective. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. - [Donate](/community/donate.md): If your company uses WebdriverIO and benefits from it, please ask your manager or your marketing team to support the project by donating to the collective. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. ### events The WebdriverIO community organizes events around the world. The project is completely community driven and we encourage and support everyone who likes to host and run WebdriverIO meetups and events. - [WebdriverIO Events](/community/events.md): The WebdriverIO community organizes events around the world. The project is completely community driven and we encourage and support everyone who likes to host and run WebdriverIO meetups and events. - [WebdriverIO Days at Technical Test Experts Nederland group](/community/events/2024-04-10-technical-testers.md): WebdriverIO Days at Technical Test Experts Nederland group - [Empowering Enterprise Testing: WebdriverIO Meets wdi5 Meets UI5 for Cross-Platform Excellence](/community/events/2024-04-11-webdriverio-meets-wdi5-meets-ui5.md): Empowering Enterprise Testing: WebdriverIO Meets wdi5 Meets UI5 for Cross-Platform Excellence - [WebDriverIO X BrowserStack London Meetup](/community/events/2024-04-16-webdriverio-x-browserstack.md): WebDriverIO X BrowserStack London Meetup - [WebdriverIO v9 Release Party: Browser Automation's Future](/community/events/2024-08-15-v9-release-party.md): WebdriverIO v9 Release Party: Browser Automation's Future - [WebDriverIO X BrowserStack New York Meetup](/community/events/2024-10-17-webdriverio-x-browserstack.md): WebDriverIO X BrowserStack New York Meetup ### materials If you want to use WebdriverIO materials for your own workshops or events feel free to grab them directly from here. - [Materials](/community/materials.md): If you want to use WebdriverIO materials for your own workshops or events feel free to grab them directly from here. ### openofficehours Contributing to a big Open Source project can be hard. Especially if the codebase is large and requires a lot of context to understand what certain changes do. Then there is the possibility that tools or infrastructure is being used that are unknown. Nevertheless the project depends on your contributions and help to identify bugs and fix them. How can we overcome this hurdle? - [Office Hours](/community/openofficehours.md): Contributing to a big Open Source project can be hard. Especially if the codebase is large and requires a lot of context to understand what certain changes do. Then there is the possibility that tools or infrastructure is being used that are unknown. Nevertheless the project depends on your contributions and help to identify bugs and fix them. How can we overcome this hurdle? ### resources There are many wonderful curated resources the WebdriverIO community has put together. - [Resources](/community/resources.md): There are many wonderful curated resources the WebdriverIO community has put together. ### support This project is maintained by a dedicated group of people. - [Need Help?](/community/support.md): This project is maintained by a dedicated group of people. ### team The WebdriverIO development is led by a dedicated team of developers and SDETs from various companies as well contributions from people around the world. - [Team](/community/team.md): The WebdriverIO development is led by a dedicated team of developers and SDETs from various companies as well contributions from people around the world. ## docs ### accessibility-testing - [Axe Core](/docs/accessibility-testing/axe-core.md): You can include accessibility tests within your WebdriverIO test suite using the open-source accessibility tools from Deque called Axe. The setup is very easy, all you need to do is to install the WebdriverIO Axe adapter via: - [BrowserStack Accessibility Testing](/docs/accessibility-testing/browserstack.md): You can easily integrate accessibility tests in your WebdriverIO test suites using the Automated tests feature of BrowserStack Accessibility Testing. - [TestMu AI Accessibility Testing](/docs/accessibility-testing/testmuai.md): You can easily integrate accessibility tests in your WebdriverIO test suites using TestMu AI Accessibility Testing. ### allure-reporter A WebdriverIO reporter plugin to create Allure Test Reports. - [Allure Reporter](/docs/allure-reporter.md): A WebdriverIO reporter plugin to create Allure Test Reports. ### api Welcome to the WebdriverIO API docs. These pages contain reference materials for all implemented protocol bindings and convenience commands. Protocol commands, including WebDriver, WebDriver Bidi or mobile commands like Appium are commands that are directly send to the underlying driver backend. Convenience commands provided by the browser, element or mock object offer higher level interactivity. - [Introduction](/docs/api.md): Welcome to the WebdriverIO API docs. These pages contain reference materials for all implemented protocol bindings and convenience commands. Protocol commands, including WebDriver, WebDriver Bidi or mobile commands like Appium are commands that are directly send to the underlying driver backend. Convenience commands provided by the browser, element or mock object offer higher level interactivity. - [Appium](/docs/api/appium.md): getLogTypes - [The Browser Object](/docs/api/browser.md): Extends: EventEmitter - [$](/docs/api/browser/$.md): The $ command is a short and handy way in order to fetch a single element on the page. - [$$](/docs/api/browser/$$.md): The $$ command is a short and handy way in order to fetch multiple elements on the page. - [action](/docs/api/browser/action.md): The action command is a low-level interface for providing virtualized device input actions to the web browser. - [actions](/docs/api/browser/actions.md): Allows to run multiple action interactions at once, e.g. to simulate a pinch zoom or hold a modifier key while - [addCommand](/docs/api/browser/addCommand.md): The browser method addCommand helps you to write your own set of commands. - [addInitScript](/docs/api/browser/addInitScript.md): Adds a script which would be evaluated in one of the following scenarios: - [call](/docs/api/browser/call.md): You can use call to execute any async action within your test spec. - [custom$](/docs/api/browser/custom$.md): The custom$ allows you to use a custom strategy declared by using browser.addLocatorStrategy. - [custom$$](/docs/api/browser/custom$$.md): The customs$$ allows you to use a custom strategy declared by using browser.addLocatorStrategy. - [debug](/docs/api/browser/debug.md): This command helps you to debug your integration tests. It stops the running browser and gives - [deleteCookies](/docs/api/browser/deleteCookies.md): Delete cookies visible to the current page. By providing a cookie name it - [downloadFile](/docs/api/browser/downloadFile.md): Download a file from the remote computer running Selenium node to local file system - [emulate](/docs/api/browser/emulate.md): WebdriverIO allows you to emulate Web APIs using the emulate command. These Web APIs can then - [execute](/docs/api/browser/execute.md): Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. - [executeAsync](/docs/api/browser/executeAsync.md): The executeAsync command is deprecated and will be removed in a future version. - [getCookies](/docs/api/browser/getCookies.md): Retrieve a cookie - [getPuppeteer](/docs/api/browser/getPuppeteer.md): Get the Puppeteer Browser instance - [getWindowSize](/docs/api/browser/getWindowSize.md): Returns browser window size. - [keys](/docs/api/browser/keys.md): Send a sequence of key strokes to the "active" element. You can make an input element active by just clicking - [mock](/docs/api/browser/mock.md): Mock the response of a request. You can define a mock based on a matching - [mockClearAll](/docs/api/browser/mockClearAll.md): Resets all information stored in all registered mocks of the session. - [mockRestoreAll](/docs/api/browser/mockRestoreAll.md): Restores all mock information and behavior stored in all registered - [newWindow](/docs/api/browser/newWindow.md): Open new window or tab in browser (defaults to a new window if not specified). - [overwriteCommand](/docs/api/browser/overwriteCommand.md): The browser method overwriteCommand helps you to overwrite the browser's and element's native commands like pause and click. - [pause](/docs/api/browser/pause.md): Pauses execution for a specific amount of time. It is recommended to not use this command to wait for an - [react$](/docs/api/browser/react$.md): The react$ command is a useful command to query React Components by their - [react$$](/docs/api/browser/react$$.md): The react$$ command is a useful command to query multiple React Components - [reloadSession](/docs/api/browser/reloadSession.md): Creates a new Selenium session with your current capabilities. This is useful if you - [restore](/docs/api/browser/restore.md): This command restores specific or all emulated behaviors that were set using the emulate command. - [savePDF](/docs/api/browser/savePDF.md): Prints the page of the current browsing context to a PDF file on your OS. - [saveRecordingScreen](/docs/api/browser/saveRecordingScreen.md): Save a video started by startRecordingScreen command to file. - [saveScreenshot](/docs/api/browser/saveScreenshot.md): Save a screenshot of the current browsing context to a PNG file on your OS. Be aware that - [scroll](/docs/api/browser/scroll.md): Scroll within the browser viewport. Note that x and y coordinates are relative to the current - [setCookies](/docs/api/browser/setCookies.md): Sets one or more cookies for the current page. Make sure you are - [setTimeout](/docs/api/browser/setTimeout.md): Sets the timeouts associated with the current session, timeout durations control such - [setViewport](/docs/api/browser/setViewport.md): Resizes the browser viewport within the browser. As oppose to setWindowSize, - [setWindowSize](/docs/api/browser/setWindowSize.md): Resizes browser window outer size according to provided width and height. Based on your operating - [switchFrame](/docs/api/browser/switchFrame.md): Switches the active context to a frame, e.g. an iframe on the page. There are multiple ways you can query a frame - [switchWindow](/docs/api/browser/switchWindow.md): Switch focus to a particular tab / window. - [throttle](/docs/api/browser/throttle.md): use browser.throttleNetwork instead - [throttleCPU](/docs/api/browser/throttleCPU.md): Throttles the CPU to emulate a slower processor. - [throttleNetwork](/docs/api/browser/throttleNetwork.md): Throttle the network capabilities of the browser. This can help to - [touchAction](/docs/api/browser/touchAction.md): The touchAction command is deprecated and will be removed in a future version. - [uploadFile](/docs/api/browser/uploadFile.md): Uploads a file to the Selenium Standalone server or other browser driver - [url](/docs/api/browser/url.md): The url command loads an URL in the browser. If a baseUrl is specified in the config, - [waitUntil](/docs/api/browser/waitUntil.md): This wait command is your universal weapon if you want to wait on something. It expects a condition - [Chromium](/docs/api/chromium.md): isAlertOpen - [The Clock Object](/docs/api/clock.md): You can modify the browser system clock using the emulate command. It overrides native global functions related to time allowing them to be controlled synchronously via clock.tick() or the yielded clock object. This includes controlling: - [restore](/docs/api/clock/restore.md): Restore all overridden native functions. This is automatically called between tests, so should not - [setSystemTime](/docs/api/clock/setSystemTime.md): Change the system time to the new now. Now can be a timestamp, date object, or not passed in which defaults - [tick](/docs/api/clock/tick.md): Move the clock the specified number of milliseconds. Any timers within the affected range of time will be called. - [The Dialog Object](/docs/api/dialog.md): Dialog objects are dispatched by browser via the browser.on('dialog') event. - [accept](/docs/api/dialog/accept.md): Accepts the dialog and returns when the dialog has been handled. - [defaultValue](/docs/api/dialog/defaultValue.md): If dialog is prompt, returns default prompt value. Otherwise, returns empty string. - [dismiss](/docs/api/dialog/dismiss.md): Dismisses the dialog and returns when the dialog has been handled. - [message](/docs/api/dialog/message.md): A message displayed in the dialog. - [type](/docs/api/dialog/type.md): Returns dialog's type, can be one of alert, beforeunload, confirm or prompt. - [The Element Object](/docs/api/element.md): An Element Object is an object representing an element on the remote user agent, e.g. a DOM Node when running a session within a browser or a mobile element for mobile. It can be received using one of the many element query commands, e.g. $, custom$, react$ or shadow$. - [$](/docs/api/element/$.md): The $ command is a short and handy way in order to fetch a single element on the page. - [$$](/docs/api/element/$$.md): The $$ command is a short and handy way in order to fetch multiple elements on the page. - [addValue](/docs/api/element/addValue.md): Add a value to an input or textarea element found by given selector. - [clearValue](/docs/api/element/clearValue.md): Clear the value of an input or textarea element. Make sure you can interact with the - [click](/docs/api/element/click.md): Click on an element. - [custom$](/docs/api/element/custom$.md): The custom$ allows you to use a custom strategy declared by using browser.addLocatorStrategy. - [custom$$](/docs/api/element/custom$$.md): The customs$$ allows you to use a custom strategy declared by using browser.addLocatorStrategy. - [doubleClick](/docs/api/element/doubleClick.md): Double-click on an element. - [dragAndDrop](/docs/api/element/dragAndDrop.md): Drag an item to a destination element or position. - [execute](/docs/api/element/execute.md): Inject a snippet of JavaScript into the page for execution in the context of the currently selected - [executeAsync](/docs/api/element/executeAsync.md): The executeAsync command is deprecated and will be removed in a future version. - [getAttribute](/docs/api/element/getAttribute.md): Get an attribute from a DOM-element based on the attribute name. - [getComputedLabel](/docs/api/element/getComputedLabel.md): Get the computed WAI-ARIA label of an element. - [getComputedRole](/docs/api/element/getComputedRole.md): Get the computed WAI-ARIA label of an element. - [getCSSProperty](/docs/api/element/getCSSProperty.md): Get a css property from a DOM-element selected by given selector. The return value - [getElement](/docs/api/element/getElement.md): Access WebdriverIO.Element properties like selector or elementId from the element reference. - [getElements](/docs/api/element/getElements.md): Access WebdriverIO.ElementArray properties like length or selector from the elements reference. - [getHTML](/docs/api/element/getHTML.md): Get source code of specified DOM element by selector. By default, it automatically - [getLocation](/docs/api/element/getLocation.md): Determine an element’s location on the page. The point (0, 0) refers to - [getProperty](/docs/api/element/getProperty.md): The Get Element Property command will return the result of getting a property of an - [getSize](/docs/api/element/getSize.md): Get the width and height for an DOM-element. - [getTagName](/docs/api/element/getTagName.md): Get tag name of a DOM-element. - [getText](/docs/api/element/getText.md): Get the text content from a DOM-element. Make sure the element - [getValue](/docs/api/element/getValue.md): Get the value of a `, or text ` found by given selector. - [isClickable](/docs/api/element/isClickable.md): An element is considered to be clickable when the following conditions are met: - [isDisplayed](/docs/api/element/isDisplayed.md): Return true if the selected DOM-element is displayed (even when the element is outside the viewport). It is using - [isEnabled](/docs/api/element/isEnabled.md): Return true or false if the selected DOM-element is enabled. - [isEqual](/docs/api/element/isEqual.md): Return true if the selected element matches with the provided one. - [isExisting](/docs/api/element/isExisting.md): Returns true if element exists in the DOM. - [isFocused](/docs/api/element/isFocused.md): Return true or false if the selected DOM-element currently has focus. If the selector matches - [isSelected](/docs/api/element/isSelected.md): Will return true or false whether or not an ` or ` element of type - [isStable](/docs/api/element/isStable.md): Will return true when the element is stable (not animating) or false when unstable (currently animating). - [moveTo](/docs/api/element/moveTo.md): Move the mouse by an offset of the specified element. If no element is specified, - [nextElement](/docs/api/element/nextElement.md): Returns the next sibling element of the selected DOM-element. - [parentElement](/docs/api/element/parentElement.md): Returns the parent element of the selected DOM-element. - [previousElement](/docs/api/element/previousElement.md): Returns the previous sibling element of the selected DOM-element. - [react$](/docs/api/element/react$.md): The react$ command is a useful command to query React Components by their - [react$$](/docs/api/element/react$$.md): The react$$ command is a useful command to query multiple React Components - [saveScreenshot](/docs/api/element/saveScreenshot.md): Save a screenshot of an element to a PNG file on your OS. - [scrollIntoView](/docs/api/element/scrollIntoView.md): Scroll element into viewport for Desktop/Mobile Web AND Mobile Native Apps. - [selectByAttribute](/docs/api/element/selectByAttribute.md): Select option with a specific value. - [selectByIndex](/docs/api/element/selectByIndex.md): Select option with a specific index. - [selectByVisibleText](/docs/api/element/selectByVisibleText.md): Select option with displayed text matching the argument. - [setValue](/docs/api/element/setValue.md): Send a sequence of key strokes to an element after the input has been cleared before. If the element doesn't need - [shadow$](/docs/api/element/shadow$.md): Access an element inside a given element's shadowRoot. If you are working - [shadow$$](/docs/api/element/shadow$$.md): Access elements inside a given element's shadowRoot. If you are working - [touchAction](/docs/api/element/touchAction.md): The touchAction command is deprecated and will be removed in a future version. - [waitForClickable](/docs/api/element/waitForClickable.md): Wait for an element for the provided amount of milliseconds to be clickable or not clickable. - [waitForDisplayed](/docs/api/element/waitForDisplayed.md): true to check if the element is within the viewport. false by default. - [waitForEnabled](/docs/api/element/waitForEnabled.md): Wait for an element (selected by css selector) for the provided amount of - [waitForExist](/docs/api/element/waitForExist.md): Wait for an element for the provided amount of - [waitForStable](/docs/api/element/waitForStable.md): Wait for an element for the provided amount of - [waitUntil](/docs/api/element/waitUntil.md): This wait command is your universal weapon if you want to wait on something. It expects a condition - [Environment Variables](/docs/api/environment.md): WebdriverIO sets the following environment variables within every worker: - [Expect](/docs/api/expect-webdriverio.md): When you're writing tests, you often need to check that values meet certain conditions. expect gives you access to a number of "matchers" that let you validate different things on the browser, an element or mock object. - [Firefox](/docs/api/gecko.md): fullPageScreenshot - [Globals](/docs/api/globals.md): In your test files, WebdriverIO puts each of these methods and objects into the global environment. You don't have to import anything to use them. However, if you prefer explicit imports, you can do import { browser, $, $$, expect } from '@wdio/globals' and set injectGlobals: false in your WDIO configuration. - [Mobile JSON Wire Protocol](/docs/api/mjsonwp.md): getPageIndex - [Introduction to custom and enhanced Mobile Commands in WebdriverIO](/docs/api/mobile.md): Testing mobile apps and mobile web applications comes with its own challenges, especially when dealing with platform-specific differences between Android and iOS. While Appium provides the flexibility to handle these differences, it often requires you to dive deep into complex, platform-dependent docs (Android, iOS) and commands. This can make writing test scripts more time-consuming, error-prone, and difficult to maintain. - [acceptDialog](/docs/api/mobile/acceptDialog.md): Accept a native mobile alert or permission dialog. - [background](/docs/api/mobile/background.md): Send the currently running app for this session to the background. - [closeApp](/docs/api/mobile/closeApp.md): Close a specific app or the currently active app on the device. - [deepLink](/docs/api/mobile/deepLink.md): Open a deep link URL in the mobile app based on the url and the app's package name (Android) or bundle ID (iOS). - [dismissDialog](/docs/api/mobile/dismissDialog.md): Dismiss a native mobile alert or permission dialog. - [dragAndDrop](/docs/api/mobile/dragAndDrop.md): Drag an item to a destination element or position. - [fingerPrint](/docs/api/mobile/fingerPrint.md): Authenticate users by using their fingerprint scan on supported Android emulators. The - [getClipboard](/docs/api/mobile/getClipboard.md): Get the content of the system clipboard as a base64-encoded string. - [getContext](/docs/api/mobile/getContext.md): Retrieve the context of the current session. - [getContexts](/docs/api/mobile/getContexts.md): The WebdriverIO getContexts method is an improved version of the default Appium contexts - [getCurrentActivity](/docs/api/mobile/getCurrentActivity.md): Get the name of the current Android activity. - [getCurrentPackage](/docs/api/mobile/getCurrentPackage.md): Get the name of the current Android package. - [getDisplayDensity](/docs/api/mobile/getDisplayDensity.md): Get the display density from the device. - [getPerformanceData](/docs/api/mobile/getPerformanceData.md): Get performance data for a specific application. Returns system state information like cpu, - [getPerformanceDataTypes](/docs/api/mobile/getPerformanceDataTypes.md): Returns the information types of the system state which is supported to read - [getStrings](/docs/api/mobile/getStrings.md): Get app strings for a specific language. Returns a key-value object of all string resources - [getSystemBars](/docs/api/mobile/getSystemBars.md): Retrieve visibility and bounds information of the status and navigation bars. - [gsmCall](/docs/api/mobile/gsmCall.md): Make a GSM call on the Android emulator. Valid actions: 'call', 'accept', 'cancel', 'hold'. - [gsmSignal](/docs/api/mobile/gsmSignal.md): Set the GSM signal strength on the Android emulator. - [gsmVoice](/docs/api/mobile/gsmVoice.md): Set the GSM voice state on the Android emulator. Valid values: 'unregistered', 'home', - [isLocked](/docs/api/mobile/isLocked.md): Check whether the device screen is locked. - [launchApp](/docs/api/mobile/launchApp.md): Launch or activate an app on the device. If no bundleId (iOS) or appId (Android) is provided, - [lock](/docs/api/mobile/lock.md): Lock the device screen. - [longPress](/docs/api/mobile/longPress.md): Performs a long press gesture on the given element on the screen. - [longPressKeyCode](/docs/api/mobile/longPressKeyCode.md): Press and hold a particular key code on the device. - [openNotifications](/docs/api/mobile/openNotifications.md): Open Android notifications. - [pinch](/docs/api/mobile/pinch.md): Performs a pinch gesture on the given element on the screen. - [powerAC](/docs/api/mobile/powerAC.md): Set the state of the battery charger on the Android emulator. Valid values: 'on', 'off'. - [powerCapacity](/docs/api/mobile/powerCapacity.md): Set the battery percentage on the Android emulator. Value must be in the range [0, 100]. - [pressKeyCode](/docs/api/mobile/pressKeyCode.md): Press a particular key on the device. The keycode values correspond to Android KeyEvent constants. - [relaunchActiveApp](/docs/api/mobile/relaunchActiveApp.md): Performs a restart of the active native app by: - [scrollIntoView](/docs/api/mobile/scrollIntoView.md): Scroll element into viewport for Desktop/Mobile Web AND Mobile Native Apps. - [sendKeyEvent](/docs/api/mobile/sendKeyEvent.md): Send a key event to the Android device. - [sendSms](/docs/api/mobile/sendSms.md): Simulate an SMS message being received on the Android emulator. - [setClipboard](/docs/api/mobile/setClipboard.md): Set the content of the system clipboard. - [shake](/docs/api/mobile/shake.md): Perform a shake action on the device. Supports iOS Simulator and real devices. - [startActivity](/docs/api/mobile/startActivity.md): The package name of the app to start. - [swipe](/docs/api/mobile/swipe.md): Swipe in a specific direction within viewport or element for Desktop/Mobile Web AND Mobile Native Apps. - [switchContext](/docs/api/mobile/switchContext.md): Switch to a specific context using a given Webview name, title, or url. - [tap](/docs/api/mobile/tap.md): Performs a tap gesture on: - [toggleAirplaneMode](/docs/api/mobile/toggleAirplaneMode.md): Set the airplane mode state on the device. - [toggleData](/docs/api/mobile/toggleData.md): Set the mobile data state on the device. - [toggleEnrollTouchId](/docs/api/mobile/toggleEnrollTouchId.md): Toggle Touch ID enrollment on iOS Simulator. - [toggleLocationServices](/docs/api/mobile/toggleLocationServices.md): Toggle the state of the location service. - [toggleNetworkSpeed](/docs/api/mobile/toggleNetworkSpeed.md): Set the network speed for the Android emulator. Valid values: 'full', 'gsm', 'edge', 'hscsd', - [toggleWiFi](/docs/api/mobile/toggleWiFi.md): Set the WiFi state on the device. - [touchId](/docs/api/mobile/touchId.md): Simulate a Touch ID or Face ID biometric match event on iOS Simulator. - [unlock](/docs/api/mobile/unlock.md): Unlock the device screen. - [zoom](/docs/api/mobile/zoom.md): Performs a zoom gesture on the given element on the screen. - [The Mock Object](/docs/api/mock.md): The mock object is an object that represents a network mock and contains information about requests that were matching given url and filterOptions. It can be received using the mock command. - [abort](/docs/api/mock/abort.md): Abort the request with one of the following error codes: - [abortOnce](/docs/api/mock/abortOnce.md): Abort the request once with one of the following error codes: - [clear](/docs/api/mock/clear.md): Resets all information stored in the mock.calls array. - [redirect](/docs/api/mock/redirect.md): Sets up a redirect for a given mock. This allows you to redirect a request to another URL. - [request](/docs/api/mock/request.md): Allows you do modify requests the browser makes during the session. This can be useful for the following use cases: - [requestOnce](/docs/api/mock/requestOnce.md): Only change request parameter once with given overwrite for the next request. You can call requestOnce multiple - [respond](/docs/api/mock/respond.md): Always respond with same overwrite. - [respondOnce](/docs/api/mock/respondOnce.md): Only respond once with given overwrite. You can call respondOnce multiple - [restore](/docs/api/mock/restore.md): Does everything that mock.clear() does, and also removes any mocked return values or implementations. - [waitForResponse](/docs/api/mock/waitForResponse.md): Wait until at least one matching request has received a response. - [Modules](/docs/api/modules.md): WebdriverIO publishes various modules to NPM and other registries that you can use to build your own automation framework. See more documentation on WebdriverIO setup types here. - [Protocol Commands](/docs/api/protocols.md): WebdriverIO is an automation framework that relies on various automation protocols to control a remote agent, e.g. for a browser, mobile device or television. Based on the remote device different protocols come into play. These commands are assigned to the Browser or Element Object depending on the session information by the remote server (e.g. browser driver). - [Sauce Labs](/docs/api/saucelabs.md): All commands are only supported on Chrome using Sauce Labs - [Selenium Standalone](/docs/api/selenium.md): file - [WebDriver Protocol](/docs/api/webdriver.md): newSession - [WebDriver Bidi Protocol](/docs/api/webdriverBidi.md): These protocol commands are generated based on the current living ### appium With WebdriverIO you can test not only web application in the browser but also other platforms such as: - [Appium Setup](/docs/appium.md): With WebdriverIO you can test not only web application in the browser but also other platforms such as: ### appium-service Handling the Appium server is out of the scope of the actual WebdriverIO project. This service helps you to run the Appium server seamlessly when running tests with the WDIO testrunner. It starts the Appium Server in a child process. - [Appium Service](/docs/appium-service.md): Handling the Appium server is out of the scope of the actual WebdriverIO project. This service helps you to run the Appium server seamlessly when running tests with the WDIO testrunner. It starts the Appium Server in a child process. ### assertion The WDIO testrunner comes with a built in assertion library that allows you to make powerful assertions on various aspects of the browser or elements within your (web) application. It extends Jests Matchers functionality with additional, for e2e testing optimized, matchers, e.g.: - [Assertion](/docs/assertion.md): The WDIO testrunner comes with a built in assertion library that allows you to make powerful assertions on various aspects of the browser or elements within your (web) application. It extends Jests Matchers functionality with additional, for e2e testing optimized, matchers, e.g.: ### async-migration Due to changes in V8 the WebdriverIO team announced to deprecate synchronous command execution by April 2023. The team has been working hard to make the transition as easy as possible. In this guide we explain how you can slowly migrate your test suite from sync to async. As an example project we use the Cucumber Boilerplate but the approach is the same with all other projects as well. - [From Sync to Async](/docs/async-migration.md): Due to changes in V8 the WebdriverIO team announced to deprecate synchronous command execution by April 2023. The team has been working hard to make the transition as easy as possible. In this guide we explain how you can slowly migrate your test suite from sync to async. As an example project we use the Cucumber Boilerplate but the approach is the same with all other projects as well. ### autocompletion IntelliJ - [Autocompletion](/docs/autocompletion.md): IntelliJ ### automationProtocols With WebdriverIO, you can choose between multiple automation technologies when running your E2E tests locally or in the cloud. By default, WebdriverIO will attempt to start a local automation session using the WebDriver Bidi protocol. - [Automation Protocols](/docs/automationProtocols.md): With WebdriverIO, you can choose between multiple automation technologies when running your E2E tests locally or in the cloud. By default, WebdriverIO will attempt to start a local automation session using the WebDriver Bidi protocol. ### autowait When using a command that directly interacts with an element WebdriverIO will automatically wait for the element to be visible and interactable, no manual waits are needed when using the commands (think of click, setValue etc). - [Auto-waiting](/docs/autowait.md): When using a command that directly interacts with an element WebdriverIO will automatically wait for the element to be visible and interactable, no manual waits are needed when using the commands (think of click, setValue etc). ### badisi-wdio-harness @badisi/wdio-harness is a 3rd party package, for more information please see GitHub | npm - [Support for Angular component test harnesses Service](/docs/badisi-wdio-harness.md): @badisi/wdio-harness is a 3rd party package, for more information please see GitHub | npm ### bamboo WebdriverIO offers a tight integration to CI systems like Bamboo. With the JUnit or Allure reporter, you can easily debug your tests as well as keep track of your test results. The integration is pretty easy. - [Bamboo](/docs/bamboo.md): WebdriverIO offers a tight integration to CI systems like Bamboo. With the JUnit or Allure reporter, you can easily debug your tests as well as keep track of your test results. The integration is pretty easy. ### best-practices - [Browser Logs](/docs/best-practices/browser-logs.md): When running tests the browser may log important information that you are interested or want to assert against. - [File Download](/docs/best-practices/file-download.md): When automating file downloads in web testing, it's essential to handle them consistently across different browsers to ensure reliable test execution. ### bestpractices This guide aims to share our best practices that help you write performant and resilient tests. - [Best Practices](/docs/bestpractices.md): This guide aims to share our best practices that help you write performant and resilient tests. ### boilerplates Over time, our community has developed several projects that you can use as inspiration to set up your own test suite. - [v9 Boilerplate Projects](/docs/boilerplates.md): Over time, our community has developed several projects that you can use as inspiration to set up your own test suite. ### capabilities A capability is a definition for a remote interface. It helps WebdriverIO to understand in which browser or mobile environment you like to run your tests on. Capabilities are less crucial when developing tests locally as you run it on one remote interface most of the time but becomes more important when running a large set of integration tests in CI/CD. - [Capabilities](/docs/capabilities.md): A capability is a definition for a remote interface. It helps WebdriverIO to understand in which browser or mobile environment you like to run your tests on. Capabilities are less crucial when developing tests locally as you run it on one remote interface most of the time but becomes more important when running a large set of integration tests in CI/CD. ### cloudservices Using on-demand services like Sauce Labs, Browserstack, TestingBot, TestMu AI (Formerly LambdaTest) or Perfecto with WebdriverIO is pretty simple. All you need to do is to set your service's user and key in your options. - [Using Cloud Services](/docs/cloudservices.md): Using on-demand services like Sauce Labs, Browserstack, TestingBot, TestMu AI (Formerly LambdaTest) or Perfecto with WebdriverIO is pretty simple. All you need to do is to set your service's user and key in your options. ### component-testing With WebdriverIOs Browser Runner you can run tests within an actual desktop or mobile browser while using WebdriverIO and the WebDriver protocol to automate and interact what gets rendered on the page. This approach has many advantages compared to other test frameworks that only allow testing against JSDOM. - [Component Testing](/docs/component-testing.md): With WebdriverIOs Browser Runner you can run tests within an actual desktop or mobile browser while using WebdriverIO and the WebDriver protocol to automate and interact what gets rendered on the page. This approach has many advantages compared to other test frameworks that only allow testing against JSDOM. - [Coverage](/docs/component-testing/coverage.md): WebdriverIO's browser runner supports code coverage reporting using istanbul. The testrunner will automatically instrument your code using Vite and capture code coverage for you. - [Lit](/docs/component-testing/lit.md): Lit is a simple library for building fast, lightweight web components. Testing Lit web components with WebdriverIO is very easy thanks to WebdriverIOs shadow DOM selectors you can query in shadow roots nested elements with just one single command. - [Mocking](/docs/component-testing/mocking.md): When writing tests it's only a matter of time before you need to create a "fake" version of an internal — or external — service. This is commonly referred to as mocking. WebdriverIO provides utility functions to help you out. You can import { fn, spyOn, mock, unmock } from '@wdio/browser-runner' to access it. See more information about the available mocking utilities in the API docs. - [Preact](/docs/component-testing/preact.md): Preact is a fast 3kB alternative to React with the same modern API. You can test Preact components directly in a real browser using WebdriverIO and its browser runner. - [React](/docs/component-testing/react.md): React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. You can test React components directly in a real browser using WebdriverIO and its browser runner. - [SolidJS](/docs/component-testing/solid.md): SolidJS is a framework to build user interfaces with simple and performant reactivity. You can test SolidJS components directly in a real browser using WebdriverIO and its browser runner. - [Stencil](/docs/component-testing/stencil.md): Stencil is a library for building reusable, scalable component libraries. You can test Stencil components directly in a real browser using WebdriverIO and its browser runner. - [Svelte](/docs/component-testing/svelte.md): Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app. You can test Svelte components directly in a real browser using WebdriverIO and its browser runner. - [Vue.js](/docs/component-testing/vue.md): Vue.js is an approachable, performant and versatile framework for building web user interfaces. You can test Vue.js components directly in a real browser using WebdriverIO and its browser runner. ### concise-reporter A WebdriverIO plugin to report in concise style. - [Concise Reporter](/docs/concise-reporter.md): A WebdriverIO plugin to report in concise style. ### configuration Based on the setup type (e.g. using the raw protocol bindings, WebdriverIO as standalone package or the WDIO testrunner) there is a different set of options available to control the environment. - [Configuration](/docs/configuration.md): Based on the setup type (e.g. using the raw protocol bindings, WebdriverIO as standalone package or the WDIO testrunner) there is a different set of options available to control the environment. ### configurationfile The configuration file contains all necessary information to run your test suite. It’s a NodeJS module that exports a JSON. - [Configuration File](/docs/configurationfile.md): The configuration file contains all necessary information to run your test suite. It’s a NodeJS module that exports a JSON. ### contribute You like WebdriverIO and want to help making it better? Awesome! We are working to make this process as easy and transparent as possible. We might be not quite there yet but this guide will help you to ramp you up as a contributor and give you everything you need to make your first contribution. If there is any information missing that prevents you from sending in a pull request, please let us know. We treat these kind of issues like actual bugs. - [Contribute](/docs/contribute.md): You like WebdriverIO and want to help making it better? Awesome! We are working to make this process as easy and transparent as possible. We might be not quite there yet but this guide will help you to ramp you up as a contributor and give you everything you need to make your first contribution. If there is any information missing that prevents you from sending in a pull request, please let us know. We treat these kind of issues like actual bugs. ### customcommands If you want to extend the browser instance with your own set of commands, the browser method addCommand is here for you. You can write your command in an asynchronous way, just as in your specs. - [Custom Commands](/docs/customcommands.md): If you want to extend the browser instance with your own set of commands, the browser method addCommand is here for you. You can write your command in an asynchronous way, just as in your specs. ### custommatchers WebdriverIO uses a Jest style expect assertion library that comes with special features and custom matchers specific for running web and mobile tests. While the library of matchers is big, it certainly doesn't fit all possible situations. Therefore it is possible to extend the existing matchers with custom ones defined by you. - [Custom Matchers](/docs/custommatchers.md): WebdriverIO uses a Jest style expect assertion library that comes with special features and custom matchers specific for running web and mobile tests. While the library of matchers is big, it certainly doesn't fit all possible situations. Therefore it is possible to extend the existing matchers with custom ones defined by you. ### customreporter You can write your own custom reporter for the WDIO test runner that is tailored to your needs. And it’s easy! - [Custom Reporter](/docs/customreporter.md): You can write your own custom reporter for the WDIO test runner that is tailored to your needs. And it’s easy! ### customservices You can write your own custom service for the WDIO test runner to custom-fit your needs. - [Custom Services](/docs/customservices.md): You can write your own custom service for the WDIO test runner to custom-fit your needs. ### debugging Debugging is significantly more difficult when several processes spawn dozens of tests in multiple browsers. - [Debugging](/docs/debugging.md): Debugging is significantly more difficult when several processes spawn dozens of tests in multiple browsers. ### desktop-testing - [Dioxus](/docs/desktop-testing/dioxus.md): Dioxus is a Rust framework for building cross-platform apps from a single codebase. Its desktop apps render in the operating system's native webview (Wry), and WebdriverIO's Dioxus service automates their discovery, launch, and driving on Windows (WebView2), macOS (WKWebView), and Linux (WebKitGTK) so the same test suite works everywhere. - [API Reference](/docs/desktop-testing/dioxus/api.md): Complete API reference for @wdio/dioxus-service. - [Browser Mode](/docs/desktop-testing/dioxus/browser-mode.md): Browser mode lets you test your Dioxus frontend UI in plain Chrome against a running dev server — no Dioxus binary, no driver. The Dioxus invoke API is intercepted at the JavaScript boundary in the renderer, so you can mock individual commands and assert on call arguments just like in native mode. - [Coexistence](/docs/desktop-testing/dioxus/coexistence.md): This guide explains how to run @wdio/dioxus-service alongside @wdio/tauri-service and @wdio/electron-service in the same monorepo. - [Configuration](/docs/desktop-testing/dioxus/configuration.md): Complete guide to configuring @wdio/dioxus-service in your WebdriverIO setup. - [Deeplink Testing](/docs/desktop-testing/dioxus/deeplink-testing.md): The service provides the ability to test custom protocol handlers and deeplinks in your Dioxus application using the browser.dioxus.triggerDeeplink() method. - [Edge WebDriver on Windows](/docs/desktop-testing/dioxus/edge-webdriver-windows.md): Overview - [Log Forwarding](/docs/desktop-testing/dioxus/log-forwarding.md): Capture and forward logs from your Dioxus application to WebdriverIO's logger system. - [Platform Support](/docs/desktop-testing/dioxus/platform-support.md): Complete guide to platform-specific requirements, limitations, and driver setup for Dioxus testing. - [Bridge Setup](/docs/desktop-testing/dioxus/plugin-setup.md): Overview - [Quick Start](/docs/desktop-testing/dioxus/quick-start.md): Get up and running with WebdriverIO and Dioxus E2E testing in minutes. - [Troubleshooting](/docs/desktop-testing/dioxus/troubleshooting.md): Solutions for common issues when testing Dioxus applications with WebdriverIO. - [Usage Examples](/docs/desktop-testing/dioxus/usage-examples.md): Practical examples for testing Dioxus applications with WebdriverIO. - [Electron](/docs/desktop-testing/electron.md): Electron is a framework for building desktop applications using JavaScript, HTML, and CSS. By embedding Chromium and Node.js into its binary, Electron allows you to maintain one JavaScript codebase and create cross-platform apps that work on Windows, macOS, and Linux — no native development experience is required. - [Accessing Electron APIs](/docs/desktop-testing/electron/api.md): This guide covers how to work with Electron APIs in your tests, including accessing APIs from the main process and mocking them for testing. - [API Reference](/docs/desktop-testing/electron/api-reference.md): This document provides a complete reference for all browser.electron.* methods and exported utility functions provided by the service. - [Common Issues](/docs/desktop-testing/electron/common-issues.md): These are some common issues which others have encountered whilst using the service. For debugging tools and features, see the Debugging guide. - [Configuration](/docs/desktop-testing/electron/configuration.md): This document covers all configuration options for the WDIO Electron Service, including service options and Chromedriver configuration. - [Debugging](/docs/desktop-testing/electron/debugging.md): This guide covers the debugging tools and features available in the Electron service to help you gain visibility into your application's behavior during tests. - [Deeplink Testing](/docs/desktop-testing/electron/deeplink-testing.md): The service provides the ability to test custom protocol handlers and deeplinks in your Electron application using the browser.electron.triggerDeeplink() method. This feature automatically handles platform-specific differences, particularly on Windows where deeplinks would normally launch a new instance instead of reaching the test instance. - [Standalone Mode](/docs/desktop-testing/electron/standalone.md): You can also use the service without the WDIO testrunner, e.g. in a normal Node.js script. - [Window Management](/docs/desktop-testing/electron/window-management.md): The service automatically tracks the active Electron BrowserWindow and ensures WebdriverIO commands target it. You can write tests against your app without manually shuffling window handles when the renderer changes (for example, splash screen → main window). - [MacOS](/docs/desktop-testing/macos.md): WebdriverIO can automate arbitrary MacOS application using Appium. All you need is XCode installed on your system, Appium and the Mac2 Driver installed as dependency and the correct capabilities set. - [Tauri](/docs/desktop-testing/tauri.md): Tauri is a framework for building lightweight, secure cross-platform desktop applications using a Rust backend and the operating system's native webview. WebdriverIO's Tauri service automates the discovery, launch, and driving of Tauri apps on Windows (WebView2), macOS (WKWebView), and Linux (WebKitGTK) so the same test suite works everywhere. - [API Reference](/docs/desktop-testing/tauri/api.md): Complete API reference for @wdio/tauri-service. - [Configuration](/docs/desktop-testing/tauri/configuration.md): Complete guide to configuring @wdio/tauri-service in your WebdriverIO setup. - [CrabNebula Setup](/docs/desktop-testing/tauri/crabnebula-setup.md): This guide walks you through setting up CrabNebula's tauri-driver for cross-platform Tauri testing. - [Deeplink Testing](/docs/desktop-testing/tauri/deeplink-testing.md): The service provides the ability to test custom protocol handlers and deeplinks in your Tauri application using the browser.tauri.triggerDeeplink() method. - [Edge WebDriver on Windows](/docs/desktop-testing/tauri/edge-webdriver-windows.md): Overview - [Log Forwarding](/docs/desktop-testing/tauri/log-forwarding.md): Capture and forward logs from your Tauri application to WebDriverIO's logger system. - [Platform Support](/docs/desktop-testing/tauri/platform-support.md): Complete guide to platform-specific requirements, limitations, and WebDriver setup for Tauri testing. - [Plugin Setup](/docs/desktop-testing/tauri/plugin-setup.md): Overview - [Quick Start](/docs/desktop-testing/tauri/quick-start.md): Get up and running with WebdriverIO and Tauri E2E testing in minutes. - [Troubleshooting](/docs/desktop-testing/tauri/troubleshooting.md): Solutions for common issues when testing Tauri applications with WebdriverIO. - [Usage Examples](/docs/desktop-testing/tauri/usage-examples.md): Practical examples for testing Tauri applications with WebdriverIO. - [Windows](/docs/desktop-testing/windows.md): Unfortunately there is at the moment no stable driver for automating Windows applications. Even though Appium maintains a Windows Driver that is based on Microsoft's WinAppDriver server, we would not recommend using it given that Microsoft has stopped maintaining the server and there are a lot of known bugs. ### devtools DevTools is a powerful browser-based debugging interface for visualizing, controlling, and inspecting your test executions in real-time. It works with WebdriverIO, Nightwatch.js, and Selenium WebDriver (any runner) — same backend, same UI, same capture infrastructure. - [DevTools](/docs/devtools.md): DevTools is a powerful browser-based debugging interface for visualizing, controlling, and inspecting your test executions in real-time. It works with WebdriverIO, Nightwatch.js, and Selenium WebDriver (any runner) — same backend, same UI, same capture infrastructure. - [Allure Integration](/docs/devtools/allure.md): Trace-mode artifacts — the trace zip and each test's per-test screenshot and video — attach to an Allure report automatically, so you can open them straight from the report. See Trace Mode for how to enable trace mode and produce these artifacts. - [Cross-Framework Support](/docs/devtools/cross-framework.md): The trace format and the show-trace player are identical across WebdriverIO / Selenium / Nightwatch; this page shows where capture completeness differs. For the full trace-mode reference, see Trace Mode. - [The Dashboard](/docs/devtools/dashboard.md): Live mode opens the DevTools UI in an external browser window and streams your test run in real time. It's the interactive counterpart to Trace Mode, which skips the UI and writes a portable offline artifact instead. Live mode is enabled by default (mode: 'live'), so simply running your WebdriverIO tests launches the dashboard. - [Getting Started](/docs/devtools/getting-started.md): WebdriverIO DevTools gives your end-to-end browser tests a developer-tools UI for running, debugging, and inspecting automation — DOM replay, per-command screenshots, network and console capture, and session screencasts. It runs in two modes. Live mode opens an interactive dashboard in a browser window while your tests execute, so you can watch and rerun them in real time. Trace mode skips the UI and writes a portable, offline trace artifact (trace.zip) you can open later in the show-trace player — ideal for CI. This page gets you into live mode fast; trace mode is one option away. - [Trace Mode Limitations](/docs/devtools/limitations.md): What Trace Mode deliberately skips, plus the known gaps across adapters. - [Nightwatch DevTools](/docs/devtools/nightwatch.md): Nightwatch adapter for WebdriverIO DevTools - brings the same visual debugging UI to your Nightwatch test suite with zero test code changes. - [Configuration Reference](/docs/devtools/reference.md): All DevTools options at a glance, across the three adapters. Option names, types, and defaults are identical on every adapter; where behaviour differs, it's noted. For the full explanation of each trace option see the linked section on the Trace Mode page. - [Selenium DevTools](/docs/devtools/selenium.md): Selenium WebDriver adapter for WebdriverIO DevTools - brings the same visual debugging UI to any Selenium test, in Node.js or Python, regardless of the test runner. - [Trace Player](/docs/devtools/trace-player.md): The show-trace player opens any trace produced in Trace Mode in the WebdriverIO DevTools UI itself — a dedicated, read-only player mode for offline replay, review, and AI-agent diffing. - [WebDriverIO DevTools](/docs/devtools/wdio.md): A WebdriverIO service that provides a developer tools UI for running, debugging, and inspecting browser automation tests. Features include DOM mutation replay, per-command screenshots, network request inspection, console log capture, and session screencast recording. - [Console Logs](/docs/devtools/wdio/console-logs.md): Capture and inspect all browser console output during test execution. DevTools records console messages from your application (console.log(), console.warn(), console.error(), console.info(), console.debug()) as well as WebDriverIO framework logs based on the logLevel configured in your wdio.conf.ts. - [Interactive Test Rerunning & Visualization](/docs/devtools/wdio/interactive-test-rerunning.md): Watch your tests execute in real-time with live browser previews and automatic screenshots captured after each WebDriver command. The UI displays a complete visual timeline of your test execution, showing the exact browser state at each step. - [Metadata](/docs/devtools/wdio/metadata.md): Inspect the full context of every browser session your test opens. The Metadata tab surfaces the capabilities, environment, and timing behind each run, so you can confirm exactly what was under test without digging through logs. - [Multi-Framework Support](/docs/devtools/wdio/multi-framework-support.md): DevTools automatically works with Mocha, Jasmine, and Cucumber without requiring any framework-specific configuration. Simply add the service to your WebDriverIO config and all features work seamlessly regardless of which test framework you're using. - [Network Logs](/docs/devtools/wdio/network-logs.md): Monitor and inspect all network activity during your tests. DevTools captures every HTTP request and response, giving you complete visibility into API calls, resource loading, and network timing - just like browser DevTools. - [Preserve & Rerun (Compare)](/docs/devtools/wdio/preserve-and-rerun.md): When a test fails, the usual debugging loop is: rerun it, then compare two walls of logs to work out what changed. Preserve & Rerun collapses that into a single click. It snapshots the failing run and re-executes the test in one action, then shows both runs side-by-side in a Compare view aligned command-by-command - so you can see exactly where the two diverged without re-reading anything. - [Session Screencast](/docs/devtools/wdio/screencast.md): Records browser sessions as .webm videos. Videos are displayed in the DevTools UI alongside the snapshot and DOM mutation views. - [TestLens](/docs/devtools/wdio/testlens.md): TestLens provides intelligent code navigation between the DevTools UI and your test source files. Click on any test in the UI to jump directly to that test's definition in your code editor, complete with exact line numbers. - [Trace Mode](/docs/devtools/wdio/trace-mode.md): Headless capture path — no DevTools UI window opens. At session end the adapter writes trace artifacts into a test-results/ folder next to your spec / config directory. For session / spec granularity that's a trace-.zip (or a trace-/ directory); for test granularity each test gets its own subfolder (see Trace granularity). The artifact is portable and ships everything needed for offline replay, AI-agent diffing, or any consumer that prefers a file over a live UI. ### docker Docker is a powerful containerization technology that allows to encapsulate your test suite into a container that behaves the same on every system. This can avoid flakiness due to different browser or platform versions. In order to run your tests within a container, create a Dockerfile in your project directory, e.g.: - [Docker](/docs/docker.md): Docker is a powerful containerization technology that allows to encapsulate your test suite into a container that behaves the same on every system. This can avoid flakiness due to different browser or platform versions. In order to run your tests within a container, create a Dockerfile in your project directory, e.g.: ### dot-reporter A WebdriverIO plugin to report in dot style. - [Dot Reporter](/docs/dot-reporter.md): A WebdriverIO plugin to report in dot style. ### driverbinaries To run automation based on the WebDriver protocol you need to have browser drivers set up that translate the automation commands and are able to execute them in the browser. - [Driver Binaries](/docs/driverbinaries.md): To run automation based on the WebDriver protocol you need to have browser drivers set up that translate the automation commands and are able to execute them in the browser. ### emulation With WebdriverIO you can emulate Web APIs using the emulate command to return custom values that help you emulate certain browser behaviors. Note that this requires your application to explicitly use these APIs. - [Emulation](/docs/emulation.md): With WebdriverIO you can emulate Web APIs using the emulate command to return custom values that help you emulate certain browser behaviors. Note that this requires your application to explicitly use these APIs. ### enterprise Available as part of the Tidelift Subscription - [WebdriverIO for Enterprise](/docs/enterprise.md): Available as part of the Tidelift Subscription ### extension-testing - [VS Code Extension Testing](/docs/extension-testing/vscode-extensions.md): WebdriverIO allows you to seamlessly test your VS Code extensions from end to end in the VS Code Desktop IDE or as web extension. You only need to provide a path to your extension and the framework does the rest. With the wdio-vscode-service everything is taken care of and much more: - [Web Extension Testing](/docs/extension-testing/web-extensions.md): WebdriverIO is the ideal tool to automate a browser. Web Extensions are a part of the browser and can be automated in the same way. Whenever your web extension uses content scripts to run JavaScript on websites or offer a popup modal, you can run an e2e test for that using WebdriverIO. ### firefox-profile-service You want to run your Firefox browser with a specific extension or need to set a couple preferences? Selenium allows you to use a profile for the Firefox browser by passing this profile as base64 string to the moz:firefoxOptions.profile property in your desired capabilities. This requires building that profile and converting it into base64. This service for the wdio testrunner takes the work of compiling the profile out of your hand and lets you define your desired options comfortably from the wdio.conf.js file. - [Firefox Profile Service](/docs/firefox-profile-service.md): You want to run your Firefox browser with a specific extension or need to set a couple preferences? Selenium allows you to use a profile for the Firefox browser by passing this profile as base64 string to the moz:firefoxOptions.profile property in your desired capabilities. This requires building that profile and converting it into base64. This service for the wdio testrunner takes the work of compiling the profile out of your hand and lets you define your desired options comfortably from the wdio.conf.js file. ### flowcharts - [Create worker process](/docs/flowcharts/createlocalworkerprocess.md): This flowchart explains how a worker process is created. - [High level overview](/docs/flowcharts/highleveloverview.md): Flow chart provides a high level overview of how the WebdriverIO ecosystem interacts with the core packages. - [Test Execution](/docs/flowcharts/testexecution.md): This flowchart explains the test execution process and the interaction between @wdio/runner and the most of the other WebdriverIO packages. - [WDIO Commands](/docs/flowcharts/wdiocommands.md): This flowchart provides a high level overview of the @wdio/cli run, repl, config and install commands. ### flutter-testing - [Base Appium Configuration](/docs/flutter-testing/base-appium-configuration.md): WebdriverIO uses Appium to run tests across mobile emulators, simulators, and real devices. The @wdio/appium-service automatically manages the Appium server lifecycle during test execution. - [Introduction](/docs/flutter-testing/introduction.md): This guide covers configuring, structuring, and running End-to-End (E2E) tests for Flutter applications using WebdriverIO and Appium. - [Preparing the Flutter App](/docs/flutter-testing/preparing-flutter-application.md): For WebdriverIO and Appium to inspect and interact with internal elements inside the Flutter canvas, the application must expose a communication channel. This is achieved by enabling Flutter's test extension in the application's source code. - [Setting up WebdriverIO in your environment](/docs/flutter-testing/setting-up-webdriverio.md): The wdio.conf.ts file is the core configuration file of any WebdriverIO project. This is where you define where tests run, which test frameworks to use, and the necessary capabilities for Appium to correctly initialize the Flutter application. - [Writing Tests](/docs/flutter-testing/writing-tests.md): This section covers the practical structure for creating automated test scenarios, how to interact directly with Flutter's internal component tree using WebdriverIO. ### frameworks WebdriverIO Runner has built-in support for Mocha, Jasmine, and Cucumber.js. You can also integrate it with 3rd-party open-source frameworks, such as Serenity/JS. - [Frameworks](/docs/frameworks.md): WebdriverIO Runner has built-in support for Mocha, Jasmine, and Cucumber.js. You can also integrate it with 3rd-party open-source frameworks, such as Serenity/JS. ### gettingstarted Welcome to the WebdriverIO documentation. It will help you to get started fast. If you run into problems, you can find help and answers on our Discord Support Server or you can hit us on 𝕏. - [Getting Started](/docs/gettingstarted.md): Welcome to the WebdriverIO documentation. It will help you to get started fast. If you run into problems, you can find help and answers on our Discord Support Server or you can hit us on 𝕏. ### githubactions If your repository is hosted on Github, you can use Github Actions to run your tests on Github's infrastructure. - [Github Actions](/docs/githubactions.md): If your repository is hosted on Github, you can use Github Actions to run your tests on Github's infrastructure. ### gmangiapelo-wdio-azure-devops-service @gmangiapelo/wdio-azure-devops-service is a 3rd party package, for more information please see GitHub | npm - [Azure DevOps Test Plans Service](/docs/gmangiapelo-wdio-azure-devops-service.md): @gmangiapelo/wdio-azure-devops-service is a 3rd party package, for more information please see GitHub | npm ### headless-and-xvfb How WebdriverIO uses Xvfb for headless testing on Linux, configuration options, CI recipes, and troubleshooting. - [Headless & Xvfb with the Testrunner](/docs/headless-and-xvfb.md): How WebdriverIO uses Xvfb for headless testing on Linux, configuration options, CI recipes, and troubleshooting. ### jenkins WebdriverIO offers a tight integration to CI systems like Jenkins. With the junit reporter, you can easily debug your tests as well as keep track of your test results. The integration is pretty easy. - [Jenkins](/docs/jenkins.md): WebdriverIO offers a tight integration to CI systems like Jenkins. With the junit reporter, you can easily debug your tests as well as keep track of your test results. The integration is pretty easy. ### json-reporter Installation - [Json Reporter](/docs/json-reporter.md): Installation ### junit-reporter A WebdriverIO reporter that creates Jenkins compatible XML based JUnit reports - [Junit Reporter](/docs/junit-reporter.md): A WebdriverIO reporter that creates Jenkins compatible XML based JUnit reports ### lighthouse-service A WebdriverIO service that allows you to run accessibility and performance tests with Google Lighthouse. - [Lighthouse Service](/docs/lighthouse-service.md): A WebdriverIO service that allows you to run accessibility and performance tests with Google Lighthouse. ### mcp What can it do? - [MCP (Model Context Protocol)](/docs/mcp.md): What can it do? - [Cloud Providers](/docs/mcp/cloud-providers.md): The WebdriverIO MCP server has native support for running browser and mobile automation sessions on cloud device farms. No local drivers, emulators, or simulators required. Four providers are supported: - [Configuration](/docs/mcp/configuration.md): This page documents all configuration options for the WebdriverIO MCP server. - [FAQ](/docs/mcp/faq.md): Frequently asked questions about WebdriverIO MCP. - [Resources](/docs/mcp/resources.md): MCP resources provide read-only access to live session state. Unlike tools, resources are pulled by the AI model at will; they don't execute actions. All resources use the wdio:// URI scheme. - [Selectors](/docs/mcp/selectors.md): The WebdriverIO MCP server supports multiple selector strategies for locating elements on web pages and mobile apps. - [Tools](/docs/mcp/tools.md): The WebdriverIO MCP server exposes 29 tools organized by function. Tools marked browser-only require a platform "ios" or platform: "android". - [Transport](/docs/mcp/transport.md): The WebdriverIO MCP server supports two transport modes: stdio (default) and HTTP. ### mocksandspies WebdriverIO comes with built-in support for modifying network responses that allows you to focus testing your frontend application without having to setup your backend or a mock server. You can define custom responses for web resources like REST API requests in your test and modify them dynamically. - [Request Mocks and Spies](/docs/mocksandspies.md): WebdriverIO comes with built-in support for modifying network responses that allows you to focus testing your frontend application without having to setup your backend or a mock server. You can define custom responses for web resources like REST API requests in your test and modify them dynamically. ### multiremote WebdriverIO allows you to run multiple automated sessions in a single test. This becomes handy when you’re testing features that require multiple users (for example, chat or WebRTC applications). - [Multiremote](/docs/multiremote.md): WebdriverIO allows you to run multiple automated sessions in a single test. This becomes handy when you’re testing features that require multiple users (for example, chat or WebRTC applications). ### ocr-testing - [CLI Wizard](/docs/ocr-testing/cli-wizard.md): You can validate which text can be found in an image without running a test by using the OCR CLI Wizard. The only thing that are needed are: - [Getting Started](/docs/ocr-testing/getting-started.md): Installation - [Test execution time](/docs/ocr-testing/more-test-optimization.md): By default, this module will check if you have a local installation of Tesseract on your machine/in your pipeline. If you don't have a local installation it will automatically use a NodeJS version. This might cause some slowness because the image processing will be done by Node.js. NodeJS is not the best system to do - [ocrClickOnText](/docs/ocr-testing/ocr-click-on-text.md): Click on an element based on the provided texts. The command will search for the provided text and try to find a match based on Fuzzy Logic from Fuse.js. This means that if you might provide a selector with a typo, or the found text might not be a 100% match it will still try to give you back an element. See the logs below. - [Frequently Asked Questions](/docs/ocr-testing/ocr-faq.md): My tests are very slow - [ocrGetElementPositionByText](/docs/ocr-testing/ocr-get-element-position-by-text.md): Get the position of a text on the screen. The command will search for the provided text and try to find a match based on Fuzzy Logic from Fuse.js. This means that if you might provide a selector with a typo, or the found text might not be a 100% match it will still try to give you back an element. See the logs below. - [ocrGetText](/docs/ocr-testing/ocr-get-text.md): Get the text on an image. - [ocrSetValue](/docs/ocr-testing/ocr-set-value.md): Send a sequence of key strokes to an element. It will: - [OCR Testing](/docs/ocr-testing/ocr-testing.md): Automated testing on mobile native apps and desktop sites can be particularly challenging when dealing with elements that lack unique identifiers. Standard WebdriverIO selectors may not always help you. Enter the world of the @wdio/ocr-service, a powerful service that leverages OCR (Optical Character Recognition) to search, wait for, and interact with on-screen elements based on their visible text. - [ocrWaitForTextDisplayed](/docs/ocr-testing/ocr-wait-for-text-displayed.md): Wait for a specific text to be displayed on the screen. ### organizingsuites As projects grow, inevitably more and more integration tests are added. This increases build time and slows productivity. - [Organizing Test Suite](/docs/organizingsuites.md): As projects grow, inevitably more and more integration tests are added. This increases build time and slows productivity. ### pageobjects Version 5 of WebdriverIO was designed with Page Object Pattern support in mind. By introducing the "elements as first class citizens" principle, it is now possible to build up large test suites using this pattern. - [Page Object Pattern](/docs/pageobjects.md): Version 5 of WebdriverIO was designed with Page Object Pattern support in mind. By introducing the "elements as first class citizens" principle, it is now possible to build up large test suites using this pattern. ### parameterize-tests You can simply parameterize tests on a test level, via simple for loops e.g.: - [Parameterize Tests](/docs/parameterize-tests.md): You can simply parameterize tests on a test level, via simple for loops e.g.: ### percy-overview Introduction - [Unlocking Percy - An Overview](/docs/percy-overview.md): Introduction ### protractor-migration This tutorial is for people who are using Protractor and want to migrate their framework to WebdriverIO. It was initiated after the Angular team has announced that Protractor won't be longer supported. WebdriverIO has been influenced by a lot of Protractors design decisions which is why it is probably the closest framework to migrate over. The WebdriverIO team appreciates the work of every single Protractor contributor and hopes that this tutorial makes the transition to WebdriverIO easy and straightforward. - [From Protractor](/docs/protractor-migration.md): This tutorial is for people who are using Protractor and want to migrate their framework to WebdriverIO. It was initiated after the Angular team has announced that Protractor won't be longer supported. WebdriverIO has been influenced by a lot of Protractors design decisions which is why it is probably the closest framework to migrate over. The WebdriverIO team appreciates the work of every single Protractor contributor and hopes that this tutorial makes the transition to WebdriverIO easy and straightforward. ### proxy You can tunnel two different types of request through a proxy: - [Proxy Setup](/docs/proxy.md): You can tunnel two different types of request through a proxy: ### qajonatasmartins-wdio-google-chat-service @qajonatasmartins/wdio-google-chat-service is a 3rd party package, for more information please see GitHub | npm - [Google Chat Service](/docs/qajonatasmartins-wdio-google-chat-service.md): @qajonatasmartins/wdio-google-chat-service is a 3rd party package, for more information please see GitHub | npm ### record Chrome DevTools has a Recorder panel that allows users to record and playback automated steps within Chrome. These steps can be exported into WebdriverIO tests with an extension making writing test very easy. - [Record Tests](/docs/record.md): Chrome DevTools has a Recorder panel that allows users to record and playback automated steps within Chrome. These steps can be exported into WebdriverIO tests with an extension making writing test very easy. ### repl With v4.5.0, WebdriverIO introduced a REPL interface that helps you to not only learn the framework API, but also debug and inspect your tests. It can be used in multiple ways. - [REPL interface](/docs/repl.md): With v4.5.0, WebdriverIO introduced a REPL interface that helps you to not only learn the framework API, but also debug and inspect your tests. It can be used in multiple ways. ### retry You can rerun certain tests with the WebdriverIO testrunner that turn out to be unstable due to things like a flaky network or race conditions. (However, it is not recommended to simply increase the rerun rate if tests become unstable!) - [Retry Flaky Tests](/docs/retry.md): You can rerun certain tests with the WebdriverIO testrunner that turn out to be unstable due to things like a flaky network or race conditions. (However, it is not recommended to simply increase the rerun rate if tests become unstable!) ### runner A runner in WebdriverIO orchestrates how and where tests are being run when using the testrunner. WebdriverIO currently supports two different types of runner: local and browser runner. - [Runner](/docs/runner.md): A runner in WebdriverIO orchestrates how and where tests are being run when using the testrunner. WebdriverIO currently supports two different types of runner: local and browser runner. ### sap_oss-wdio-qmate-service @saposs/wdio-qmate-service is a 3rd party package, for more information please see GitHub | npm - [Qmate Service](/docs/sap_oss-wdio-qmate-service.md): @saposs/wdio-qmate-service is a 3rd party package, for more information please see GitHub | npm ### sauce-service WebdriverIO service that provides a better integration into Sauce Labs. This service can be used for: - [Sauce Service](/docs/sauce-service.md): WebdriverIO service that provides a better integration into Sauce Labs. This service can be used for: ### security WebdriverIO has the security aspect in mind when providing solutions. Below are some ways to better secure your test. - [Security](/docs/security.md): WebdriverIO has the security aspect in mind when providing solutions. Below are some ways to better secure your test. ### selectors The WebDriver Protocol provides several selector strategies to query an element. WebdriverIO simplifies them to keep selecting elements simple. Please note that even though the command to query elements is called $ and $$, they have nothing to do with jQuery or the Sizzle Selector Engine. - [Selectors](/docs/selectors.md): The WebDriver Protocol provides several selector strategies to query an element. WebdriverIO simplifies them to keep selecting elements simple. Please note that even though the command to query elements is called $ and $$, they have nothing to do with jQuery or the Sizzle Selector Engine. ### seleniumgrid You can use WebdriverIO with your existing Selenium Grid instance. To connect your tests to Selenium Grid, you just need to update the options in your test runner configurations. - [Selenium Grid](/docs/seleniumgrid.md): You can use WebdriverIO with your existing Selenium Grid instance. To connect your tests to Selenium Grid, you just need to update the options in your test runner configurations. ### serenity-js-html-reporter @serenity-js/html-reporter is a 3rd party package, for more information please see GitHub | npm - [Serenity/JS HTML Reporter](/docs/serenity-js-html-reporter.md): @serenity-js/html-reporter is a 3rd party package, for more information please see GitHub | npm ### setuptypes WebdriverIO can be used for various purposes. It implements the WebDriver protocol API and can run a browser in an automated way. The framework is designed to work in any arbitrary environment and for any kind of task. It is independent from any 3rd party frameworks and only requires Node.js to run. - [Setup Types](/docs/setuptypes.md): WebdriverIO can be used for various purposes. It implements the WebDriver protocol API and can run a browser in an automated way. The framework is designed to work in any arbitrary environment and for any kind of task. It is independent from any 3rd party frameworks and only requires Node.js to run. ### sharding By default, WebdriverIO runs tests in parallel and strives for optimal utilization of CPU cores on your machine. In order to achieve even greater parallelisation, you can further scale WebdriverIO test execution by running tests on multiple machines simultaneously. We call this mode of operation "sharding". - [Sharding](/docs/sharding.md): By default, WebdriverIO runs tests in parallel and strives for optimal utilization of CPU cores on your machine. In order to achieve even greater parallelisation, you can further scale WebdriverIO test execution by running tests on multiple machines simultaneously. We call this mode of operation "sharding". ### shared-store-service Exchange data between main process and workers (specs). - [Shared Store Service](/docs/shared-store-service.md): Exchange data between main process and workers (specs). ### snapshot Snapshot tests can be very useful for asserting a wide range of aspects of your component or logic at the same time. In WebdriverIO you can take snapshots of any arbitrary object as well as a WebElement DOM structure or WebdriverIO command results. - [Snapshot](/docs/snapshot.md): Snapshot tests can be very useful for asserting a wide range of aspects of your component or logic at the same time. In WebdriverIO you can take snapshots of any arbitrary object as well as a WebElement DOM structure or WebdriverIO command results. ### spec-reporter A WebdriverIO plugin to report in spec style. - [Spec Reporter](/docs/spec-reporter.md): A WebdriverIO plugin to report in spec style. ### sponsor WebdriverIO, an open-source project under the MIT license, is freely accessible for use. The sustainability of this expansive ecosystem, along with the development of innovative features, is made possible through the generous financial support of our sponsors, who contribute significantly to the maintenance and continuous growth of the project. - [Become a WebdriverIO Sponsor](/docs/sponsor.md): WebdriverIO, an open-source project under the MIT license, is freely accessible for use. The sustainability of this expansive ecosystem, along with the development of innovative features, is made possible through the generous financial support of our sponsors, who contribute significantly to the maintenance and continuous growth of the project. ### static-server-service Some projects are front-end assets only, and don't run on more than a static server. This service helps you to run a static file server during testing. - [Static Server Service](/docs/static-server-service.md): Some projects are front-end assets only, and don't run on more than a static server. This service helps you to run a static file server during testing. ### sumologic-reporter A WebdriverIO reporter that sends test results to Sumologic for data analyses - [Sumologic Reporter](/docs/sumologic-reporter.md): A WebdriverIO reporter that sends test results to Sumologic for data analyses ### testingbot-service WebdriverIO service that provides a better integration into TestingBot. It updates the job metadata ('name', 'passed', 'tags', 'public', 'build', 'extra') and runs TestingBot Tunnel if desired. - [Testingbot Service](/docs/testingbot-service.md): WebdriverIO service that provides a better integration into TestingBot. It updates the job metadata ('name', 'passed', 'tags', 'public', 'build', 'extra') and runs TestingBot Tunnel if desired. ### testplanit-wdio-reporter @testplanit/wdio-reporter is a 3rd party package, for more information please see GitHub | npm - [TestPlanIt Reporter Reporter](/docs/testplanit-wdio-reporter.md): @testplanit/wdio-reporter is a 3rd party package, for more information please see GitHub | npm ### testrunner WebdriverIO comes with its own test runner to help you start testing as quickly as possible. It is supposed to do all the work for you, allows integrate to 3rd party services, and helps you to run your tests as efficiently as possible. - [Testrunner](/docs/testrunner.md): WebdriverIO comes with its own test runner to help you start testing as quickly as possible. It is supposed to do all the work for you, allows integrate to 3rd party services, and helps you to run your tests as efficiently as possible. ### timeouts Each command in WebdriverIO is an asynchronous operation. A request is fired to the Selenium server (or a cloud service like Sauce Labs), and its response contains the result once the action has completed or failed. - [Timeouts](/docs/timeouts.md): Each command in WebdriverIO is an asynchronous operation. A request is fired to the Selenium server (or a cloud service like Sauce Labs), and its response contains the result once the action has completed or failed. ### tvlabs-wdio-service @tvlabs/wdio-service is a 3rd party package, for more information please see GitHub | npm - [TV Labs Service](/docs/tvlabs-wdio-service.md): @tvlabs/wdio-service is a 3rd party package, for more information please see GitHub | npm ### typescript You can write tests using TypeScript to get auto-completion and type safety. - [TypeScript Setup](/docs/typescript.md): You can write tests using TypeScript to get auto-completion and type safety. ### v6-migration This tutorial is for people who are still using v5 of WebdriverIO and want to migrate to v6 or to the latest version of WebdriverIO. As mentioned in our release blog post the changes for this version upgrade can be summarised as following: - [From v5 to v6](/docs/v6-migration.md): This tutorial is for people who are still using v5 of WebdriverIO and want to migrate to v6 or to the latest version of WebdriverIO. As mentioned in our release blog post the changes for this version upgrade can be summarised as following: ### v7-migration This tutorial is for people who are still using v6 of WebdriverIO and want to migrate to v7. As mentioned in our release blog post the changes are mostly under the hood and upgrading should be a straight forward process. - [From v6 to v7](/docs/v7-migration.md): This tutorial is for people who are still using v6 of WebdriverIO and want to migrate to v7. As mentioned in our release blog post the changes are mostly under the hood and upgrading should be a straight forward process. ### visual-testing What can it do? - [Visual Testing](/docs/visual-testing.md): What can it do? - [Elevate Your Visual Testing with Argos](/docs/visual-testing/argos.md): Introduction - [Compare Options](/docs/visual-testing/compare-options.md): Compare options are options that influence the way the comparison is being executed. - [Key Considerations for Optimal Use](/docs/visual-testing/considerations.md): Before diving into the powerful features of the @wdio/visual-service, it's crucial to understand some key considerations that ensure you get the most out of this tool. The following points are designed to guide you through best practices and common pitfalls, helping you achieve accurate and efficient visual testing results. These considerations are not just recommendations, but essential aspects to keep in mind for effectively utilizing the service in real-world scenarios. - [FAQ](/docs/visual-testing/faq.md): Do I need to use a save(Screen/Element/FullPageScreen) methods when I want to run check(Screen/Element/FullPageScreen)? - [For Mobile Application](/docs/visual-testing/integrate-with-app-percy.md): Integrate your WebdriverIO tests with App Percy - [For Web Application](/docs/visual-testing/integrate-with-percy.md): Integrate your WebdriverIO tests with Percy - [SmartUI](/docs/visual-testing/integrate-with-smartui.md): TestMu AI (Formerly LambdaTest) SmartUI provides AI-powered visual regression testing for your WebdriverIO tests. It captures screenshots, compares them against baselines, and highlights visual differences with intelligent comparison algorithms. - [Save Options](/docs/visual-testing/method-options.md): Methods options are the options that can be set per method. If the option has the same key as an option that has been set during the instantiation of the plugin, this method option will override the plugin option value. - [Methods](/docs/visual-testing/methods.md): The following methods are added to the global WebdriverIO browser-object. - [Default Options](/docs/visual-testing/service-options.md): Service options are the options that can be set when the service is instantiated and will be used for each method call. - [Test Output](/docs/visual-testing/test-output.md): This WebdriverIO demo site has been used for the example image output. - [Prerequisites](/docs/visual-testing/visual-reporter.md): The Visual Reporter is a new feature introduced in the @wdio/visual-service, starting from version v5.2.0. This reporter allows users to visualize the JSON diff reports generated by the Visual Testing service and transform them into a human-readable format. It helps teams better analyze and manage the visual testing results by providing a graphical interface for reviewing the output. - [Writing Tests](/docs/visual-testing/writing-tests.md): Testrunner Framework Support ### watcher With the WDIO testrunner you can watch files while you are working on them. They automatically rerun if you change either something in your app or in your test files. By adding a --watch flag when calling the wdio command the testrunner will wait for file changes after it ran all tests, e.g. - [Watch Test Files](/docs/watcher.md): With the WDIO testrunner you can watch files while you are working on them. They automatically rerun if you change either something in your app or in your test files. By adding a --watch flag when calling the wdio command the testrunner will wait for file changes after it ran all tests, e.g. ### wdio-aws-device-farm-service wdio-aws-device-farm-service is a 3rd party package, for more information please see GitHub | npm - [AWS Device Farm Service](/docs/wdio-aws-device-farm-service.md): wdio-aws-device-farm-service is a 3rd party package, for more information please see GitHub | npm ### wdio-camera-service wdio-camera-service is a 3rd party package, for more information please see GitHub | npm - [Camera Service Service](/docs/wdio-camera-service.md): wdio-camera-service is a 3rd party package, for more information please see GitHub | npm ### wdio-cleanuptotal-service wdio-cleanuptotal-service is a 3rd party package, for more information please see GitHub | npm - [CleanupTotal Service](/docs/wdio-cleanuptotal-service.md): wdio-cleanuptotal-service is a 3rd party package, for more information please see GitHub | npm ### wdio-cucumber-viewport-logger-service wdio-cucumber-viewport-logger-service is a 3rd party package, for more information please see GitHub | npm - [Cucumber Viewport Logger Service](/docs/wdio-cucumber-viewport-logger-service.md): wdio-cucumber-viewport-logger-service is a 3rd party package, for more information please see GitHub | npm ### wdio-cucumberjs-json-reporter wdio-cucumberjs-json-reporter is a 3rd party package, for more information please see GitHub | npm - [CucumberJS JSON Reporter](/docs/wdio-cucumberjs-json-reporter.md): wdio-cucumberjs-json-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-delta-reporter-service wdio-delta-reporter-service is a 3rd party package, for more information please see GitHub | npm - [Delta Reporter Reporter](/docs/wdio-delta-reporter-service.md): wdio-delta-reporter-service is a 3rd party package, for more information please see GitHub | npm ### wdio-devtools-service @wdio/devtools-service is a 3rd party package, for more information please see GitHub | npm - [DevTools (Test Debugging & Visualization) Service](/docs/wdio-devtools-service.md): @wdio/devtools-service is a 3rd party package, for more information please see GitHub | npm ### wdio-dioxus-service @wdio/dioxus-service is a 3rd party package, for more information please see GitHub | npm - [Dioxus Service](/docs/wdio-dioxus-service.md): @wdio/dioxus-service is a 3rd party package, for more information please see GitHub | npm ### wdio-docker-service wdio-docker-service is a 3rd party package, for more information please see GitHub | npm - [Docker Service](/docs/wdio-docker-service.md): wdio-docker-service is a 3rd party package, for more information please see GitHub | npm ### wdio-electron-service @wdio/electron-service is a 3rd party package, for more information please see GitHub | npm - [Electron Service](/docs/wdio-electron-service.md): @wdio/electron-service is a 3rd party package, for more information please see GitHub | npm ### wdio-eslinter-service wdio-eslinter-service is a 3rd party package, for more information please see GitHub | npm - [Auto-detect missing imports w/eslint Service](/docs/wdio-eslinter-service.md): wdio-eslinter-service is a 3rd party package, for more information please see GitHub | npm ### wdio-gmail-service wdio-gmail-service is a 3rd party package, for more information please see GitHub | npm - [Gmail Service](/docs/wdio-gmail-service.md): wdio-gmail-service is a 3rd party package, for more information please see GitHub | npm ### wdio-html-nice-reporter wdio-html-nice-reporter is a 3rd party package, for more information please see GitHub | npm - [wdio-html-nice-reporter](/docs/wdio-html-nice-reporter.md): wdio-html-nice-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-intercept-service wdio-intercept-service is a 3rd party package, for more information please see GitHub | npm - [Intercept Service](/docs/wdio-intercept-service.md): wdio-intercept-service is a 3rd party package, for more information please see GitHub | npm ### wdio-json-html-reporter wdio-json-html-reporter is a 3rd party package, for more information please see GitHub | npm - [JSON HTML Reporter Reporter](/docs/wdio-json-html-reporter.md): wdio-json-html-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-lambdatest-service wdio-lambdatest-service is a 3rd party package, for more information please see GitHub | npm - [TestMu AI (Formerly LambdaTest) Service](/docs/wdio-lambdatest-service.md): wdio-lambdatest-service is a 3rd party package, for more information please see GitHub | npm ### wdio-light-reporter wdio-light-reporter is a 3rd party package, for more information please see GitHub | npm - [Light Reporter Reporter](/docs/wdio-light-reporter.md): wdio-light-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-ng-apimock-service wdio-ng-apimock-service is a 3rd party package, for more information please see GitHub | npm - [Ng-apimock Service](/docs/wdio-ng-apimock-service.md): wdio-ng-apimock-service is a 3rd party package, for more information please see GitHub | npm ### wdio-novus-visual-regression-service wdio-novus-visual-regression-service is a 3rd party package, for more information please see GitHub | npm - [Novus Visual Regression Service](/docs/wdio-novus-visual-regression-service.md): wdio-novus-visual-regression-service is a 3rd party package, for more information please see GitHub | npm ### wdio-null-driver-service wdio-null-driver-service is a 3rd party package, for more information please see GitHub | npm - [Null Driver Service](/docs/wdio-null-driver-service.md): wdio-null-driver-service is a 3rd party package, for more information please see GitHub | npm ### wdio-nuxt-service wdio-nuxt-service is a 3rd party package, for more information please see GitHub | npm - [Nuxt Service Service](/docs/wdio-nuxt-service.md): wdio-nuxt-service is a 3rd party package, for more information please see GitHub | npm ### wdio-obsidian-service wdio-obsidian-service is a 3rd party package, for more information please see GitHub | npm - [Obsidian Plugin Testing Service](/docs/wdio-obsidian-service.md): wdio-obsidian-service is a 3rd party package, for more information please see GitHub | npm ### wdio-ocr-service @wdio/ocr-service is a 3rd party package, for more information please see GitHub | npm - [OCR Testing Service](/docs/wdio-ocr-service.md): @wdio/ocr-service is a 3rd party package, for more information please see GitHub | npm ### wdio-performancetotal-service wdio-performancetotal-service is a 3rd party package, for more information please see GitHub | npm - [PerformanceTotal Service](/docs/wdio-performancetotal-service.md): wdio-performancetotal-service is a 3rd party package, for more information please see GitHub | npm ### wdio-qunit-service wdio-qunit-service is a 3rd party package, for more information please see GitHub | npm - [QUnit Service](/docs/wdio-qunit-service.md): wdio-qunit-service is a 3rd party package, for more information please see GitHub | npm ### wdio-reportportal-reporter wdio-reportportal-reporter is a 3rd party package, for more information please see GitHub | npm - [Report Portal Reporter](/docs/wdio-reportportal-reporter.md): wdio-reportportal-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-reportportal-service wdio-reportportal-service is a 3rd party package, for more information please see GitHub | npm - [Report Portal Service](/docs/wdio-reportportal-service.md): wdio-reportportal-service is a 3rd party package, for more information please see GitHub | npm ### wdio-rerun-service wdio-rerun-service is a 3rd party package, for more information please see GitHub | npm - [Re-run Service](/docs/wdio-rerun-service.md): wdio-rerun-service is a 3rd party package, for more information please see GitHub | npm ### wdio-robonut-service wdio-robonut-service is a 3rd party package, for more information please see GitHub | npm - [Robonut Service](/docs/wdio-robonut-service.md): wdio-robonut-service is a 3rd party package, for more information please see GitHub | npm ### wdio-roku-service wdio-roku-service is a 3rd party package, for more information please see GitHub | npm - [Roku Service](/docs/wdio-roku-service.md): wdio-roku-service is a 3rd party package, for more information please see GitHub | npm ### wdio-slack-reporter wdio-slack-reporter is a 3rd party package, for more information please see GitHub | npm - [Slack Reporter Reporter](/docs/wdio-slack-reporter.md): wdio-slack-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-slack-service wdio-slack-service is a 3rd party package, for more information please see GitHub | npm - [Slack Service](/docs/wdio-slack-service.md): wdio-slack-service is a 3rd party package, for more information please see GitHub | npm ### wdio-tauri-service @wdio/tauri-service is a 3rd party package, for more information please see GitHub | npm - [Tauri Service](/docs/wdio-tauri-service.md): @wdio/tauri-service is a 3rd party package, for more information please see GitHub | npm ### wdio-teamcity-reporter wdio-teamcity-reporter is a 3rd party package, for more information please see GitHub | npm - [Teamcity Reporter Reporter](/docs/wdio-teamcity-reporter.md): wdio-teamcity-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-testrail-reporter @wdio/testrail-reporter is a 3rd party package, for more information please see GitHub | npm - [Testrail Reporter Reporter](/docs/wdio-testrail-reporter.md): @wdio/testrail-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-tesults-service wdio-tesults-service is a 3rd party package, for more information please see GitHub | npm - [Tesults Service](/docs/wdio-tesults-service.md): wdio-tesults-service is a 3rd party package, for more information please see GitHub | npm ### wdio-timeline-reporter wdio-timeline-reporter is a 3rd party package, for more information please see GitHub | npm - [Timeline Reporter](/docs/wdio-timeline-reporter.md): wdio-timeline-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-ui5-service wdio-ui5-service is a 3rd party package, for more information please see GitHub | npm - [UI5 Service](/docs/wdio-ui5-service.md): wdio-ui5-service is a 3rd party package, for more information please see GitHub | npm ### wdio-video-reporter wdio-video-reporter is a 3rd party package, for more information please see GitHub | npm - [Installation](/docs/wdio-video-reporter.md): wdio-video-reporter is a 3rd party package, for more information please see GitHub | npm ### wdio-visual-service @wdio/visual-service is a 3rd party package, for more information please see GitHub | npm - [Image Comparison (Visual Regression Testing) Service](/docs/wdio-visual-service.md): @wdio/visual-service is a 3rd party package, for more information please see GitHub | npm ### wdio-vscode-service wdio-vscode-service is a 3rd party package, for more information please see GitHub | npm - [VSCode Extension Testing Service](/docs/wdio-vscode-service.md): wdio-vscode-service is a 3rd party package, for more information please see GitHub | npm ### wdio-wait-for wdio-wait-for is a 3rd party package, for more information please see GitHub | npm - [Library of useful expected conditions Service](/docs/wdio-wait-for.md): wdio-wait-for is a 3rd party package, for more information please see GitHub | npm ### wdio-winappdriver-service wdio-winappdriver-service is a 3rd party package, for more information please see GitHub | npm - [winappdriver Service](/docs/wdio-winappdriver-service.md): wdio-winappdriver-service is a 3rd party package, for more information please see GitHub | npm ### wdio-wiremock-service wdio-wiremock-service is a 3rd party package, for more information please see GitHub | npm - [WireMock Service](/docs/wdio-wiremock-service.md): wdio-wiremock-service is a 3rd party package, for more information please see GitHub | npm ### wdio-ywinappdriver-service wdio-ywinappdriver-service is a 3rd party package, for more information please see GitHub | npm - [ywinappdriver Service](/docs/wdio-ywinappdriver-service.md): wdio-ywinappdriver-service is a 3rd party package, for more information please see GitHub | npm ### wdio-zafira-listener-service wdio-zafira-listener-service is a 3rd party package, for more information please see GitHub | npm - [Zafira Listener Service](/docs/wdio-zafira-listener-service.md): wdio-zafira-listener-service is a 3rd party package, for more information please see GitHub | npm ### webdriver-mock-service Internal mock service to stub all endpoints for testing purposes. - [Webdriver Mock Service](/docs/webdriver-mock-service.md): Internal mock service to stub all endpoints for testing purposes. ### why-webdriverio WebdriverIO is a progressive automation framework built to automate modern web and mobile applications. It simplifies the interaction with your app and provides a set of plugins that help you create a scalable, robust and stable test suite. - [Why Webdriver.IO?](/docs/why-webdriverio.md): WebdriverIO is a progressive automation framework built to automate modern web and mobile applications. It simplifies the interaction with your app and provides a set of plugins that help you create a scalable, robust and stable test suite. --- # Full Documentation Content # Donate If your company uses WebdriverIO and benefits from it, please ask your manager or your marketing team to support the project by donating to the collective. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Please checkout our [OpenCollective page](https://opencollective.com/webdriverio) for further information on how to donate to the project. Thank you to everyone who will or has donated money to the collective and therefore has supported the project and everyone who contributed to it. It really means a lot ❤️ ## Expense Policies[​](#expense-policies "Direct link to Expense Policies") We want to be transparent in the way we accept expenses to the collective. Everyone should be eligible to participate and send in expenses for development on certain features. We also want to give back to the community by allowing us to expense event expenses. The following expense types may be eligible to be reimbursed from the collective: ### Event Expenses[​](#event-expenses "Direct link to Event Expenses") If you host an event that has a speaker talking about using WebdriverIO and it's features you can expense up to **$100**. Reimbursement requirements for event expenses include: * You or the event account must share the project on social media (𝕏, Facebook or LinkedIn) at least 3x * The event page must have the WebdriverIO logo and a link to the project page in your meetup description * You must use the funds for qualified event expenses such as food, beverage, room or equipment rental. * You must submit receipts with your reimbursement request. ### Development Expenses[​](#development-expenses "Direct link to Development Expenses") If you have done development work on any of the repositories within the GitHub WebdriverIO organisation you may reimburse up to **$1000** if the following requirements are met: * You must have submitted qualifying pull requests that have closed at least 10 issues that were labeled with [`Expensable 💸`](https://github.com/webdriverio/webdriverio/labels/Expensable%20%F0%9F%92%B8) * Every additional issue closed with that label can be expensed with $100 * You must submit links to all issues you’ve closed due to your pull requests * In order to close the ticket automatically, you must have one commit message with the Fix keyword. For example, Fix #1234 to close ticket #1234. * Pull Requests must be merged by someone from the [core team](https://github.com/webdriverio/webdriverio/blob/main/AUTHORS.md#tsc-technical-steering-committee). If there are several Pull Requests, the core team member either selects the most recent one or the best one - that’s up to them to decide what is best for the project. * You must claim an [`Expensable 💸`](https://github.com/webdriverio/webdriverio/labels/Expensable%20%F0%9F%92%B8) issue by commenting to the issue thread to ensure that no one else is working on the same issue. * Anyone contributing to WebdriverIO is eligible to expense their work if the implemented features or bug fixes are not objectives of a commercial job. ### Travel Expenses[​](#travel-expenses "Direct link to Travel Expenses") If you are a member of the [Technical Steering Committee team](https://github.com/webdriverio/webdriverio/blob/main/AUTHORS.md#tsc-technical-steering-committee) you are eligible to expense flights and hotel accommodations for travel to conferences or meetups as part of a speaking engagement on WebdriverIO, not paid by the event itself or a company. You may expense up to $500. Reimbursement requirements for travel expenses include: * You must send out a post from your main social media account (e.g. 𝕏, LinkedIn or personal blog) thanking all contributors of the collective after the event took place. * You must use the funds for qualified travel expenses such as ground or air transportation to the event and hotel accomodations. * You must submit receipts with your reimbursement request. --- # WebdriverIO Events The WebdriverIO community organizes events around the world. The project is completely community driven and we encourage and support everyone who likes to host and run WebdriverIO meetups and events. Loading... # Host your own WebdriverIO Event? You would like to host a WebdriverIO meetup? Awesome ❤️! We would love to support you and provide Pizza and drinks. Let's get in touch: please [raise an issue](https://github.com/webdriverio/webdriverio/issues/new?assignees=\&labels=Event+%F0%9F%93%85%2CNeeds+Triaging+%E2%8F%B3\&projects=\&template=event-proposal.yml\&title=%5B%F0%9F%93%85+Event+Suggestion%5D%3A+%3Ctitle%3E) in the WebdriverIO repository and we will take it from there. --- # WebdriverIO Days at Technical Test Experts Nederland group ![WebdriverIO Days at Technical Test Experts Nederland group](https://events.webdriver.io//technical-test-experts-nederland.png) 📅 **Date:** Wed Apr 10 2024
⏰ **Time:** 3:30 PM GMT+0000 (Coordinated Universal Time)
📍 **Location:** Tractieweg 41, studio b · Utrecht ([Google Maps](https://www.google.com/maps/search/Tractieweg%2041%2C%20studio%20b%20%C2%B7%20Utrecht))
🎤 **Hosts:** [![](https://secure.meetupstatic.com/photos/member/4/6/0/d/highres_317237933.jpeg)Wim Selles](https://twitter.com/wswebcreation)[![](https://secure.meetupstatic.com/photos/member/7/a/6/1/highres_318211329.jpeg)Huub Jansen](https://www.linkedin.com/in/huub-jansen-235808/?originalSubdomain=nl)[![](https://secure.meetupstatic.com/photos/member/b/0/b/7/highres_313065239.jpeg)Martijn Rijsdijk](https://twitter.com/MartijnRijsdijk)

We are excited to kick off the WebdriverIO days as part of the **Technical Test Experts Nederland group** meetup group. We will have two talks in one evening! This event is once again organized by [deTesters](http://www.detesters.nl/), [TestCoders](https://testcoders.nl/), and [TechChamps](https://techchamps.io/) - three specialized test automation companies. It will be held at our office in the Werkspoorkathedraal in Utrecht. But these are not just any two talks. This time, we are treating you to an evening full of open-source software. We have presentations from [Christian Bromann](https://bromann.dev/), Core Contributor of WebdriverIO and an Open Source & Open Standards Advocate, and [Erwin Heitzman](https://github.com/erwinheitzman), Sr. Test Automation Engineer at deTesters and Technical Steering Committee Member & Core Contributor of WebdriverIO. ## Talk 1: Beyond User Actions: Embracing WebDriver Bidi for Next-Gen Browser Automation with WebdriverIO - Christian Bromann[​](#talk-1-beyond-user-actions-embracing-webdriver-bidi-for-next-gen-browser-automation-with-webdriverio---christian-bromann "Direct link to Talk 1: Beyond User Actions: Embracing WebDriver Bidi for Next-Gen Browser Automation with WebdriverIO - Christian Bromann") Two decades ago, the realm of browser automation was founded on a simple yet powerful premise: replicate every possible user interaction. However, as the frontend landscape evolved, with browsers gaining more control and sophisticated execution abilities, it became clear that mimicking user actions was just the tip of the iceberg. The real challenge lies in uncovering the underlying issues that hinder application performance, leading to a paradigm shift in automation strategies. Enter WebDriver Bidi, the groundbreaking standard reshaping the future of browser automation. This new protocol has become a beacon for tools traditionally tethered to older standards, now transitioning to harness the expansive capabilities provided by modern browser vendors. This has unlocked a new horizon of cross-browser automation possibilities, transforming the way developers interact with web applications. In this presentation, Christian Bromann, a core maintainer of WebdriverIO, delves into the transformative journey of WebdriverIO as it integrates the WebDriver Bidi standard. He will unveil the forthcoming changes for users, the enhanced capabilities on the horizon, and the impact of these advancements on the automation landscape. Attendees will gain insights into how WebDriver Bidi is set to revolutionize browser automation, simplifying workflows for framework maintainers and end-users alike, and setting a new benchmark for the industry's future. ### About the Speaker[​](#about-the-speaker "Direct link to About the Speaker") Christian Bromann is a Senior Software Engineer at OutSystems, working with the Stencil team. He's well known for his role as a W3C Invited Expert, the main contributor/owner of WebdriverIO, and as a representative of WebdriverIO in the OpenJS Foundation's Cross Project Council. His career spans key positions at Outsystems, Stateful and Sauce Labs, where he played a crucial role in shaping browser automation standards. He's a passionate advocate for open source and open standards, and actively seeks collaboration on his various projects, which are showcased on his GitHub profile. ### Recording[​](#recording "Direct link to Recording") You can watch a recording of this session on the [WebdriverIO YouTube channel](https://www.youtube.com/@webdriverio): ## Talk 2: Mastering debugging: strategies for the technical tester - Erwin Heitzman[​](#talk-2-mastering-debugging-strategies-for-the-technical-tester---erwin-heitzman "Direct link to Talk 2: Mastering debugging: strategies for the technical tester - Erwin Heitzman") Debugging can be a huge challenge, even for the most experienced technical testers. In this presentation, Erwin will share his insights and strategies for tackling bugs in test code and even browsers/drivers like Chrome and ChromeDriver. Learn how to approach debugging systematically, using a mix of logic, intuition, and experience. This talk will provide you with the necessary skills to not only identify and resolve bugs efficiently but also to understand their root causes, enhancing your overall testing expertise. ### About the Speaker[​](#about-the-speaker-1 "Direct link to About the Speaker") Erwin has gained experience with WebdriverIO through various projects since 2015. As of 2017 he has been actively involved in the development of WebdriverIO and is now a maintainer of the project, helping it's users by reviewing issues and pull requests, making code contributions like new features and fixing issues. He also helps the community by answering questions in the community chat and GitHub discussions and giving advice based on his knowledge and experience as a test automation engineer, software engineer and his experience with WebdriverIO. ### Recording[​](#recording-1 "Direct link to Recording") You can watch a recording of this session on the [WebdriverIO YouTube channel](https://www.youtube.com/@webdriverio): ## Target audience for this workshop[​](#target-audience-for-this-workshop "Direct link to Target audience for this workshop") Testers with a technical background and an interest in/experience with test automation. This evening will be entirely in English. ## Signup[​](#signup "Direct link to Signup") To attend the event make sure to head over to the [meetup.com](https://www.meetup.com/technical-test-experts-nederland/events/299651453/) page to sign up. # Program **17:30** Reception and dinner
**18:30** Short introduction/kickoff
**19:00** Start of talk 1: Beyond User Actions: Embracing WebDriver Bidi for Next-Gen Browser Automation with WebdriverIO - Christian Bromann
**19:45** break
**20:00** Start of talk 2: Mastering debugging: strategies for the technical tester - Erwin Heitzman
**21:15** Closing followed by drinks 🍻🥂 [Back to Events](/community/events.md) --- # Empowering Enterprise Testing: WebdriverIO Meets wdi5 Meets UI5 for Cross-Platform Excellence ![Empowering Enterprise Testing: WebdriverIO Meets wdi5 Meets UI5 for Cross-Platform Excellence](https://events.webdriver.io//webdriverio-meets-wdi5-meets-ui5.png) 📅 **Date:** Thu Apr 11 2024
⏰ **Time:** 12:00 PM GMT+0000 (Coordinated Universal Time)
📍 **Location:** Cloud44 SAP Guesthouse ([Google Maps](https://www.google.com/maps/search/Cloud44%20SAP%20Guesthouse))
👥 **Attendees:** 20 ( 5 spots left)
🎤 **Hosts:** [![](https://pbs.twimg.com/profile_images/1335304940340785152/mnudm_Hc_400x400.jpg)Volker Buzek](https://twitter.com/vobu)[![](https://pbs.twimg.com/profile_images/1719448324535627777/99BHommX_400x400.jpg)Peter Muessig](https://twitter.com/pmuessig)[![](https://openui5.org/ui5con/germany2022/images/team/margot-wollny.png)Margot Wollny](https://www.linkedin.com/in/margot-wollny-864ba96/)

Join us for an insightful and collaborative meetup where we delve into the dynamic world of cross-platform testing for enterprise-grade applications. In this session, we'll explore the powerful combination of [WebdriverIO](https://webdriver.io/), [wdi5](https://ui5-community.github.io/wdi5/#/) and [UI5](https://ui5.sap.com), the leading technologies in the realm of web development and testing. We will be joined by the WebdriverIO core team and some of the leading faces behind wdi5. Whether you're a seasoned tester, a developer, or a curious enthusiast, this meetup offers a unique opportunity to learn, share knowledge, and network with like-minded professionals. ## Agenda[​](#agenda "Direct link to Agenda") * **14:00 - Arrive, Mingle, Coffee:** Kick off the meetup by networking with fellow professionals over a cup of coffee. Connect with peers and share insights before the presentations begin. * **14:30 - Presentations by [Christian Bromann](https://github.com/christian-bromann) (WebdriverIO Core Maintainer):** * **Talk:** "Beyond User Actions: Embracing WebDriver Bidi for Next-Gen Browser Automation with WebdriverIO" * **Discussion:** "What’s new in v9?" Explore the latest updates and features in WebdriverIO version 9 * **15:30 - Open QA with the Core Maintainers:** Engage in an interactive Q\&A session with core maintainers Christian, Erwin, and others. Get your burning questions answered and gain deeper insights into WebdriverIO and UI5. * **16:00 - SAP-internal Webinar:** Join a special webinar where the WebdriverIO team connects with wdi5 and UI5 Maintainers [Peter Muessig](https://twitter.com/pmuessig), [Margot Wollny](https://www.linkedin.com/in/margot-wollny-864ba96), [Volker Buzek](https://twitter.com/vobu), and Christian. Gain exclusive insights into the collaboration between these technologies within SAP. * **17:00 - Talk by [Erwin Heitzman](https://github.com/erwinheitzman) (WebdriverIO Core Maintainer):** * **Topic:** "Mastering debugging: strategies for the technical tester" Enhance your debugging skills with expert tips and strategies shared by Erwin. * **Afterwards:** Happy Hour: Wind down and continue networking with your newfound connections over refreshments during our happy hour session. Don't miss this opportunity to enhance your testing knowledge, connect with industry experts, and expand your professional network. We look forward to seeing you there! [Back to Events](/community/events.md) --- # WebDriverIO X BrowserStack London Meetup ![WebDriverIO X BrowserStack London Meetup](https://events.webdriver.io//webdriverio-x-browserstack.jpeg) 📅 **Date:** Tue Apr 16 2024
⏰ **Time:** 5:00 PM GMT+0000 (Coordinated Universal Time)
📍 **Location:** London ([Google Maps](https://www.google.com/maps/search/London))
🎤 **Hosts:** [![](https://browserstack.wpenginepowered.com/wp-content/uploads/2024/03/Christy@2x.jpg)Christian Bromann](https://twitter.com/bromann)[![](https://browserstack.wpenginepowered.com/wp-content/uploads/2024/04/jpeg-optimizer_jan-molak-1-1-1.png)Jan Molak](https://twitter.com/JanMolak)[![](https://browserstack.wpenginepowered.com/wp-content/uploads/2024/04/David-Burns.png)David Burns](https://twitter.com/AutomatedTester)

Join us for an exciting WebDriverIO X BrowserStack Meetup in London, Meet with the Creators of WebDriverIO, Serenity/Js, and Nightwatch JS and learn from them firsthand how these tools and Frameworks can help make your lives easy as a tester. If your organization is looking for AI-powered Test Reporting and Debugging or If you are a QA professional, a QA Leader who wants to learn more about WebDriverIO or SerenityJS, or If you are Open source enthusiast, this meetup is for you. ## What you will learn[​](#what-you-will-learn "Direct link to What you will learn") * You will learn about How to debug your tests faster with BrowserStack Test Observability. * What is WebDriverIO and Serenity/JS * Integrating WebDriverIO with BrowserStack * Real World scenarios to use BrowserStack Test Observability. ## Signup[​](#signup "Direct link to Signup") Secure your spot now and sign up for the event on [browserstack.com](https://www.browserstack.com/events/browserstack-webdriverio-london-meetup). [Back to Events](/community/events.md) --- # WebdriverIO v9 Release Party: Browser Automation's Future ![WebdriverIO v9 Release Party: Browser Automation's Future](https://events.webdriver.io//v9-release-party.png) 📅 **Date:** Fri Aug 16 2024
⏰ **Time:** 1:00 AM GMT+0000 (Coordinated Universal Time)
📍 **Location:** San Francisco ([Google Maps](https://www.google.com/maps/search/San%20Francisco))
🎤 **Hosts:** [![](https://media.licdn.com/dms/image/C5603AQFl2yyBQ-fQYA/profile-displayphoto-shrink_800_800/0/1549315564606?e=1727913600\&v=beta\&t=XpxyOKbNxc7HVYxIny-aq6ehepSZArljbO8gLl1gPYA)Tristan Lombard](https://www.linkedin.com/in/tristanlombard/)

Calling all test automation developers and open source fans! The time has come to celebrate the release of Webdriver.io V9, a next-gen browser and mobile automation test framework for Node.js. Join us as Christian Bromann, creator of Webdriver.io shares live new features coming in v9: We will discuss the new release and talk about various new features, including: * Automatically enabled WebDriver Bidi for supported sessions, enabling features like: * request mocking across Chrome, Firefox, and Edge * support for automatic piercing of WebComponents and iFrames * setting custom headers and authentication credentials as part of the `url` command * new `addInitScript` command for manipulating application runtimes * support for simulating time-dependent behavior for verifying the correctness of applications * Implemented native fetch * removed support for old JSONWireProtocol and deprecated interfaces * Renamed @wdio/devtools-service to @wdio/lighthouse-service, consolidating Lighthouse-related commands; removed devtools features in favor of Puppeteer and the getPuppeteer command * Faster tests due to new TypeScript runtime environment In our interactive meetup, Christian will show how these community-driven enhancements are designed to enable new capabilities using modern automation standards, improve performance, and provide a more powerful toolset for ensuring improved software quality. Attendees will learn how these updates can be leveraged to create more effective and maintainable test suites, as well as how to earn money contributing to the future of this open source project. Come for continuous learning opportunities, stay for delicious food/bev and networking opportunities with your favorite local continuous testing meetup community. ## Signup[​](#signup "Direct link to Signup") Secure your spot now and sign up for the event on [meetup.com](https://www.meetup.com/continuous-testing-meetup-san-francisco/events/302535825). [Back to Events](/community/events.md) --- # WebDriverIO X BrowserStack New York Meetup ![WebDriverIO X BrowserStack New York Meetup](https://events.webdriver.io//mot.png) 📅 **Date:** Thu Oct 17 2024
⏰ **Time:** 10:00 PM GMT+0000 (Coordinated Universal Time)
📍 **Location:** New York ([Google Maps](https://www.google.com/maps/search/New%20York))
🎤 **Hosts:** [![](https://media.licdn.com/dms/image/v2/D4E03AQFF_aY_ewQFqA/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1724795239950?e=1734566400\&v=beta\&t=rrfF_RnmSwRYkmHCWqil3yxZmkRC8o4nt1Ov-Y68R4I)Hari Prasad Renganathan](https://www.linkedin.com/in/hariprasad20/)[![](https://media.licdn.com/dms/image/v2/D4E03AQGFtQWc2_S4ww/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1728089885362?e=1734566400\&v=beta\&t=qoetye3E4-DJkAuW52xH0wu7r-e5qI9-YmT0vmFLNrc)Satyam Pandey](https://www.linkedin.com/in/pandeysatyam/)[![](https://events.webdriver.io/speaker/khan.png)Umer Ali Khan](https://github.com/umer-ali-khan)[![](https://browserstack.wpenginepowered.com/wp-content/uploads/2024/03/Christy@2x.jpg)Christian Bromann](https://twitter.com/bromann)

Join us for an in-depth exploration of WebdriverIO v9, the latest milestone in test automation. This talk will delve into the groundbreaking features and improvements that this release brings, driven by the adoption of the WebDriver Bidi protocol. Learn how WebdriverIO v9 positions itself at the forefront of modern automation capabilities with enhanced command functionalities, cross-browser request mocking, and seamless shadow root piercing for Web Components. ## Agenda[​](#agenda "Direct link to Agenda") * Doors: 5 PM * Introductions (BrowserStack and Webdriver) * Hari Prasad Renganathan. | Machine Learning Model Testing and Validation * Satyam Pandey | The Evolution Towards AI-Driven QA * Umer Ali Khan | Enhancing WebdriverIO Tests with Google Lighthouse: A Deep Dive into Performance and Quality Metrics * Christian Broman | WebdriverIO v9: Browser Automation's Future * Networking We'll cover significant new features such as the evolved url command, which now supports custom headers, basic authentication, and initialization scripts. Discover the expanded request mocking capabilities now available across all browsers and see how automatic shadow root piercing simplifies testing applications with nested Web Components. The session will also highlight the improved argument serialization and the new setViewport command for precise mobile emulation. Whether you're a seasoned WebdriverIO user or new to the framework, this talk will provide valuable knowledge to help you leverage the latest advancements in WebdriverIO v9 for your automation projects. Don't miss out on learning about the future direction of WebdriverIO and how it continues to innovate in the testing industry. ## Signup[​](#signup "Direct link to Signup") Secure your spot now and sign up for the event on [meetup.com](https://www.meetup.com/mot-nyc-meetup/events/303650885/). [Back to Events](/community/events.md) --- # Materials If you want to use WebdriverIO materials for your own workshops or events feel free to grab them directly from here. ## Workshops[​](#workshops "Direct link to Workshops") The WebdriverIO community gives workshops around the world. Feel free to use these materials to host your own. * [webdriverio/workshop](https://github.com/webdriverio/workshop) ## Assets[​](#assets "Direct link to Assets") If you create your own WebdriverIO content for education purposes, feel free to grab these assets to include in your materials. ### Roboter Logo[​](#roboter-logo "Direct link to Roboter Logo") ![Roboter Logo](/assets/images/robot-3677788dd63849c56aa5cb3f332b12d5.svg "Roboter Logo") ![Roboter Logo White](/assets/images/robot-white-efa2a168533bfa9b626ddaad0581bf43.svg "Roboter Logo White") ### Project Logo[​](#project-logo "Direct link to Project Logo") ![Roboter Logo](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgNjQgNjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+TG9nbyBSZWd1bGFyPC90aXRsZT4KICAgIDxnIGlkPSJMb2dvLVJlZ3VsYXIiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIGZpbGw9IiNFQTU5MDYiIHg9IjAiIHk9IjAiIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgcng9IjUiPjwvcmVjdD4KICAgICAgICA8cGF0aCBkPSJNOCwxNiBMOCw0OCBMNiw0OCBMNiwxNiBMOCwxNiBaIE00MywxNiBDNTEuODM2NTU2LDE2IDU5LDIzLjE2MzQ0NCA1OSwzMiBDNTksNDAuODM2NTU2IDUxLjgzNjU1Niw0OCA0Myw0OCBDMzQuMTYzNDQ0LDQ4IDI3LDQwLjgzNjU1NiAyNywzMiBDMjcsMjMuMTYzNDQ0IDM0LjE2MzQ0NCwxNiA0MywxNiBaIE0yNywxNiBMMTQuMTA2LDQ3Ljk5OTIwNzggTDExLjk5OSw0Ny45OTkyMDc4IEwyNC44OTQsMTYgTDI3LDE2IFogTTQzLDE4IEMzNS4yNjgwMTM1LDE4IDI5LDI0LjI2ODAxMzUgMjksMzIgQzI5LDM5LjczMTk4NjUgMzUuMjY4MDEzNSw0NiA0Myw0NiBDNTAuNzMxOTg2NSw0NiA1NywzOS43MzE5ODY1IDU3LDMyIEM1NywyNC4yNjgwMTM1IDUwLjczMTk4NjUsMTggNDMsMTggWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg== "Project Logo") --- # Office Hours Contributing to a big Open Source project can be hard. Especially if the codebase is large and requires a lot of context to understand what certain changes do. Then there is the possibility that tools or infrastructure is being used that are unknown. Nevertheless the project depends on your contributions and help to identify bugs and fix them. How can we overcome this hurdle? The WebdriverIO projects has introduced Open Office Hours that allow everyone to schedule individual 1:1 pairing sessions with the WebdriverIO contributors. This allows you to get started contributing to WebdriverIO easily with the help of people that know the code base well. We only ask you to pick [a task](https://github.com/webdriverio/webdriverio/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Afirst-timers-only) you would like to work on up-front so that the pairing partner can be prepared for the session to provide better guidance. This is a free opportunity for you to not only give back to the WebdriverIO community but also get to know the team behind the project. Currently we offer 4 slots a week from: every Wednesday 10am - 12am (CEST / GMT+2) for our European friends as well as: 11am - 13am (PDT / GMT -7) for people living on the west side of this hemisphere. Before you book an appointment, make sure you can meet the following basic requirements needed to contribute to WebdriverIO: * you've found an issue you like to contribute to in the [issue tracker](https://github.com/webdriverio/webdriverio/issues) (without an issue, your appointment will be cancelled immediatelly) * you have been working on a Node.js project before (these sessions can't be used to learn Node.js fundamentals) * you've read the [Contribution Guidelines](https://github.com/webdriverio/webdriverio/blob/main/CONTRIBUTING.md#set-up-project) and have the project set-up locally or in an ephemeral workspace * you can run the projects unit tests, and they are passing After that, you can book an appointment at any time on: [calendly.com/webdriverio/open-office-hours](https://calendly.com/webdriverio/open-office-hours) All sessions will be held over [Zoom](https://zoom.us/) or [Google Hangouts](https://hangouts.google.com/) but alternative platforms are possible, please let us know in the comment section. Also please note that this is not a way to get individual consulting for your own projects. The time is to be used to work on WebdriverIO related bugs or features. For support questions we still ask you to use our [Discord Support Server](https://discord.webdriver.io). We are looking forward to meet you all online and hope to find more collaborators helping us to push the project forward! --- # Resources There are many wonderful curated resources the WebdriverIO community has put together. Make sure to contribute yours at [`awesome-webdriverio`](https://github.com/webdriverio-community/awesome-webdriverio)! * [WebdriverIO Ecosystem](#webdriverio-ecosystem) * [Support WebdriverIO](#support-webdriverio) * [Documentation](#documentation) * [Community](#community) * [Twitter](#twitter) * [Plugins](#plugins) * [Services](#services) * [Reporters](#reporters) * [Miscellaneous](#miscellaneous) * [Research & Training](#research--training) * [Articles](#articles) * [Videos](#videos) * [Conference/Meetup Talks/Webinars](#conferencemeetup-talkswebinars) * [Courses](#courses) * [Books](#books) * [WebdriverIO Examples](#webdriverio-examples) ## WebdriverIO Ecosystem[​](#webdriverio-ecosystem "Direct link to WebdriverIO Ecosystem") ### Support WebdriverIO[​](#support-webdriverio "Direct link to Support WebdriverIO") *The following references give you more information on how to financially support the project.* * [WebdriverIO Open Collective](https://opencollective.com/webdriverio) - Help support the teams ongoing development efforts. * [Sponsor Documentation](https://webdriver.io/docs/sponsor) * [GitHub Sponsor Page](https://github.com/sponsors/webdriverio) * [Tidelift Sponsor Page](https://tidelift.com/subscription/pkg/npm-webdriverio?utm_source=npm-webdriverio\&utm_medium=github_sponsor_button) ### Documentation[​](#documentation "Direct link to Documentation") * [WebdriverIO 4.x](http://v4.webdriver.io) - WebdriverIO 4.x Documentation. * [WebdriverIO 5.x](http://v5.webdriver.io) - WebdriverIO 5.x Documentation. * [WebdriverIO 6.x](http://v6.webdriver.io) - WebdriverIO 6.x Documentation. * [WebdriverIO 7.x](http://v7.webdriver.io) - WebdriverIO 7.x Documentation. * [WebdriverIO 8.x](http://v8.webdriver.io) - WebdriverIO 8.x Documentation. ### Community[​](#community "Direct link to Community") * [Discord Server](https://discord.webdriver.io) * [#webdriverio in Selenium Slack](https://seleniumhq.slack.com/join/shared_invite/zt-f7jwg1n7-RVw4v4sMA7Zjufira_~EVw) * [Stack Overflow](http://stackoverflow.com/tags/webdriver-io) ### Twitter[​](#twitter "Direct link to Twitter") *People passionate about WebdriverIO (In no particular order)* * [Christian Bromann](https://twitter.com/bromann) - Staff Software Engineer at the Open Source Program Office at Sauce Labs. * [Kevin Lamping](https://twitter.com/klamping) - Senior Front End Engineer. * [Wim Selles](https://twitter.com/wswebcreation) - Senior Solutions Architect at Sauce Labs. ## Plugins[​](#plugins "Direct link to Plugins") ### Services[​](#services "Direct link to Services") * [WebdriverIO Community Services](https://github.com/webdriverio-community?q=service) - A set of community maintained services. * [Wdi5](https://github.com/js-soft/wdi5) - Cross-platform test framework for hybrid UI5 apps. wdi5 = Webdriver.IO + UI5 Test API + appium. * [ChromeDriver](https://github.com/webdriverio-community/wdio-chromedriver-service) - Run Chrome browser seamlessly when running tests. * [SafariDriver](https://github.com/webdriverio-community/wdio-safaridriver-service) - Run Safari browser seamlessly when running tests. * [GeckoDriver](https://github.com/webdriverio-community/wdio-geckodriver-service) - Run Gecko browser seamlessly when running tests. * [EdgeDriver](https://github.com/webdriverio-community/wdio-edgedriver-service) - Run Microsoft Edge browser seamlessly when running tests. * [Gmail](https://github.com/webdriverio-community/wdio-gmail-service) - Fetch e-mails from Google Mail. * [Intercept](https://github.com/webdriverio-community/wdio-intercept-service) - Capture and assert HTTP ajax calls. * [Zafira Listener](https://github.com/shashidharus/wdio-zafira-listener-service) - Report tests to Zafira Dashboard. * [Report Portal](https://github.com/borisosipov/wdio-reportportal-service) - Service used by Report Portal Reporter. * [Docker](https://github.com/stsvilik/wdio-docker-service) - Helps run functional/integration tests against/using containerized applications. * [WireMock](https://github.com/erwinheitzman/wdio-wiremock-service) - Run WireMock seamlessly when running tests. * [Slack](https://github.com/carmenmitru/wdio-slack-service) - Send test results as a slack notification/message to channels. * [LambdaTest](https://github.com/LambdaTest/wdio-lambdatest-service) - Manage tunnel and job metadata for LambdaTest users. * [Image Comparison (Visual Regression Testing)](https://github.com/wswebcreation/wdio-image-comparison-service) - Image comparison and visual regression testing. * [Ng-apimock](https://github.com/ng-apimock/webdriverio-plugin) - Service used by @ng-apimock/core. * [Novus Visual Regression](https://github.com/Jnegrier/wdio-novus-visual-regression-service) - Visual regression testing. * [Re-run](https://github.com/jwplayer/wdio-rerun-service) - Tracks failing tests and scenarios, allowing failing or unstable tests or scenarios to be re-run. * [winappdriver](https://github.com/licanhua/wdio-winappdriver-service) - Run WinAppDriver server seamlessly when running tests. * [ywinappdriver](https://github.com/licanhua/wdio-ywinappdriver-service) - Run ywinappdriver server seamlessly when running tests. * [PerformanceTotal](https://github.com/tzurp/performance-total) - Analyze performance of test automated flows. * [CleanupTotal](https://github.com/tzurp/cleanup-total) - Proper cleanup after each test made easy. * [AWS Device Farm](https://github.com/awslabs/wdio-aws-device-farm-service) - AWS Device Farm service. * [OCR service for Appium Native Apps](https://github.com/wswebcreation/wdio-ocr-service) - Run Tesseract OCR for Appium Native App tests. * [Auto-detect missing imports w/eslint](https://github.com/jamesmortensen/wdio-eslinter-service) - Automatically run eslint checks prior to executing tests. * [wopee.wdio](https://github.com/autonomous-testing/wopee.wdio) - Visual regression testing service by Wopee.io with autonomous test maintenance and AI-powered healing. * [tracelane](https://github.com/Cubenest/rrweb-stack) - Records failed end-to-end tests as self-contained, offline-replayable HTML reports with session replay, console and failed-network panels. No backend. ### Reporters[​](#reporters "Direct link to Reporters") * [WebdriverIO Community Reporters](https://github.com/webdriverio-community?q=reporter) - A set of community maintained reporters. * [Report Portal](https://github.com/borisosipov/wdio-reportportal-reporter) - Report results to Report Portal. * [Video](https://github.com/presidenten/wdio-video-reporter) - Makes videos of failed tests and has optional allure integration. * [HTML](https://github.com/rpii/wdio-html-reporter) - Generates a nice HTML report. * [JSON](https://github.com/fijijavis/wdio-json-reporter) - Report results in JSON format. * [Mochawesome](https://github.com/fijijavis/wdio-mochawesome-reporter) - Report results in Mochawesome format. * [Timeline](https://github.com/QualityOps/wdio-timeline-reporter) - Report results in an aggregated visualisation interface. * [CucumberJS](https://github.com/wswebcreation/wdio-cucumberjs-json-reporter) - Report results in CucumberJS JSON format. * [Markdown](https://github.com/carmenmitru/wdio-markdown-reporter) - Report results in Markdown format. * [Delta Reporter](https://github.com/delta-reporter/delta-reporter-wdio) - Report results in Delta Reporter format. * [Teamcity](https://github.com/webdriverio-community/wdio-teamcity-reporter) - Report results to the build results page of Teamcity Portal. ### Miscellaneous[​](#miscellaneous "Direct link to Miscellaneous") * [wdio-wait-for](https://github.com/webdriverio-community/wdio-wait-for) - A lightweight library of useful expected conditions for the WebdriverIO framework. * [@wdio/schematics](https://github.com/webdriverio/webdriverio-schematics) - A schematic to add WebdriverIO to an Angular project. * [@badisi/wdio-harness](https://github.com/Badisi/wdio-harness) - WebdriverIO support for Angular component test harnesses. * [@rbnx/webdriverio](https://github.com/Roozenboom/rbnx/tree/main/packages/webdriverio) - Nx plugin that adds WebdriverIO support to a Nx workspace. * [@rahularanger/WTicks](https://github.com/RahulARanger/WTicks) - A tool for exporting Selenium `.side` files into a WebdriverIO script. ## Research & Training[​](#research--training "Direct link to Research & Training") ### Articles[​](#articles "Direct link to Articles") * Ross Addinall | 20-Apr-21 - [Cypress vs WebDriverIO](https://vitaq.io/2021/04/20/cypress-vs-webdriverio). ### Videos[​](#videos "Direct link to Videos") * [UI Automation with WebdriverIO](https://testautomationu.applitools.com/webdriverio-tutorial) - By Julia Pottinger. * [Automated Software Testing with WebdriverIO](https://www.udemy.com/course/automated-software-testing-with-webdriverio/) - By Kaniel Outis. * [WebdriverIO - Tutorial for beginners](https://www.youtube.com/watch?v=e8goAKb6CC0\&list=PL6AdzyjjD5HBbt9amjf3wIVMaobb28ZYN) - By Automation Bro. * [Learn WebdriverIO Course](https://www.youtube.com/watch?v=I5hRcPH5dx8\&list=PL0y7qCn3hjLY6JvohBcmUHKHf_iOi8WuF\&ab_channel=Front-endTestingwithKevin) - By Kevin Lamping. * [WebDriverIO - JavaScript Tool](https://www.youtube.com/watch?v=7J3FnyEGXd4\&list=PLFGoYjJG_fqqswF8qDdWNG3b-BtZfiqQn\&ab_channel=NaveenAutomationLabs) - By Naveen AutomationLabs. * [WebdriverIO : NETWORK LOGS](https://www.youtube.com/watch?v=Be9IPyxHmLs) - By Seventeenth Sep. * [WebdriverIO with TypeScript and BDD Framework](https://www.youtube.com/watch?v=FnC--5WB8ow\&list=PLGk7ftfMz7jbZcArQU894rAfo6B1PbXbG\&ab_channel=TestAutomationHub) - By TestAutomationHub. ### Conference/Meetup Talks/Webinars[​](#conferencemeetup-talkswebinars "Direct link to Conference/Meetup Talks/Webinars") * [Electron Testing with WebdriverIO](https://www.youtube.com/watch?v=mAqxh3L_sP4) - By Christian Bromann. * [My favourite features of WebdriverIO](https://www.youtube.com/watch?v=CHcjEI3YZ7Y) - By Julia Pottinger. * [The Nuts and Bolts of WebdriverIO](https://www.youtube.com/watch?v=jOmvPpzLMf8) - By Christian Bromann. * [Using WebdriverIO with Data Provider](https://www.youtube.com/watch?v=0YQCVJk8K_Q) - By Kumar Vikram. * [Scale Your Automated Testing with BrowserStack and WebdriverIO](https://www.youtube.com/watch?v=bW3SM46xslE) - By Kevin Lamping. * [WebdriverIO - Bootstrap your test suite in mins](https://www.youtube.com/watch?v=a7tdIkTeM0o) - By Shweta Varma. ### Courses[​](#courses "Direct link to Courses") * [Web App Testing with WebdriverIO](https://learn.webdriver.io) - By Kevin Lamping. ### Books[​](#books "Direct link to Books") * [Enhanced Test Automation with WebdriverIO: Unlock the superpowers of hybrid testing frameworks](https://www.amazon.co.uk/dp/1837630186?ref_=cm_sw_r_cp_ud_dp_7PPKW4XNVXHFQ9XA2A0D) - Elevate your testing game to the next level using advanced techniques and proven strategies with this book for WebdriverIO beginners and automation pros alike. * [The Web App Testing Guidebook](https://leanpub.com/webapp-testing-guidebook) - Covers everything you need to know to get off the ground with UI testing. Examples are built using real-world scenarios, showing how you would actually write your tests. It's a step-by-step guide on how to effectively write UI test automation for the real world. * [Practical WebDriverIO](https://www.springer.com/de/book/9781484266601) - Teaches you intermediate and advanced methods for using WebDriverIO APIs. ### WebdriverIO Examples[​](#webdriverio-examples "Direct link to WebdriverIO Examples") * [Boilerplate Projects](https://webdriver.io/docs/boilerplates) - Over time, our community has developed several projects that you can use as inspiration to set up your own test suite. [Back to top](#contents) --- # Need Help? This project is maintained by a dedicated group of people. If you're interested in making a contribution to the WebdriverIO project, check out [the free "Office Hours" program](/blog/2020/07/01/office-hours) to help you with your efforts. If you're seeking immediate help with your own project, reach out to a trusted WebdriverIO expert: * [Kevin Lamping](https://www.codementor.io/@kevinlamping) * [Add your name to this list](https://github.com/webdriverio/webdriverio/edit/master/website/docs/Support.md) ## Stack Overflow[​](#stack-overflow "Direct link to Stack Overflow") Stack Overflow is a popular forum to ask code-level questions or if you’re stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/webdriver-io) tagged with webdriver-io or [ask your own](https://stackoverflow.com/questions/ask?tags=webdriver-io)! ## Discussion Forums[​](#discussion-forums "Direct link to Discussion Forums") There are many online forums which are a great place for discussion about WebdriverIO features, problems and bugs, e.g.: * [GitHub Discussions](https://github.com/webdriverio/webdriverio/discussions) * [Discord Community Server](https://discord.webdriver.io) * [#webdriverio Channel on SeleniumHQ Slack](https://join.slack.com/t/seleniumhq/shared_invite/zt-vv33sc0w-VKKQop3WDV_lfrLXGGHvDw) ## News[​](#news "Direct link to News") For the latest news about WebdriverIO, [follow @webdriverio on 𝕏](https://x.com/webdriverio) and the official [WebdriverIO blog](/blog) on this website. --- # Team The WebdriverIO development is led by a dedicated team of developers and SDETs from various companies as well contributions from people around the world. ## Technical Steering Committee[​](#technical-steering-committee "Direct link to Technical Steering Committee") ![](https://avatars2.githubusercontent.com/u/4043890?s=460) #### Adam Bjerstedt[](https://github.com/abjerstedt) Senior Software Engineer - Android at [Target](https://www.target.com/). ![](https://avatars2.githubusercontent.com/u/731337?s=460) #### Christian Bromann[](https://github.com/christian-bromann)[](https://x.com/bromann) Staff Software Engineer at the Open Source Program Office [@saucelabs](https://saucelabs.com/). ![](https://avatars.githubusercontent.com/u/15839059?s=460) #### Erwin Heitzman[](https://github.com/erwinheitzman) Senior Test Automation Engineer at [deTesters](https://detesters.nl/). ![](https://avatars0.githubusercontent.com/u/706039?s=460) #### Kevin Lamping[](https://github.com/klamping)[](https://x.com/klamping) Senior Front End Engineer. ![](https://avatars0.githubusercontent.com/u/25589559?s=460) #### Mykola Grybyk[](https://github.com/mgrybyk) Senior Software Development Engineer in Test. ![](https://avatars3.githubusercontent.com/u/1300981?s=460) #### Will Brock[](https://github.com/WillBrock) Automation Engineering Manager at [Focus School Software](https://focusschoolsoftware.com/). ![](https://avatars2.githubusercontent.com/u/11979740?s=460) #### Wim Selles[](https://github.com/wswebcreation)[](https://x.com/wswebcreation) Senior Solutions Architect [@saucelabs](https://saucelabs.com/). ## Project Collaborators[​](#project-collaborators "Direct link to Project Collaborators") ![](https://avatars0.githubusercontent.com/u/14321495?s=460) #### Baruch Velez[](https://github.com/baruchvlz)[](https://x.com/baruchvelez) ![](https://avatars.githubusercontent.com/u/6514276?v=4) #### Boris Osipov[](https://github.com/BorisOsipov)[](https://x.com/bo_osipov) and [many many more](https://github.com/orgs/webdriverio/people). --- # Axe Core You can include accessibility tests within your WebdriverIO test suite using the open-source accessibility tools [from Deque called Axe](https://www.deque.com/axe/). The setup is very easy, all you need to do is to install the WebdriverIO Axe adapter via: * npm * Yarn * pnpm * Bun ``` npm install -g @axe-core/webdriverio ``` ``` yarn global add @axe-core/webdriverio ``` ``` pnpm add -g @axe-core/webdriverio ``` ``` bun add --global @axe-core/webdriverio ``` The Axe adapter can be used either in [standalone or testrunner](/docs/setuptypes.md) mode by simply importing and initializing it with the [browser object](/docs/api/browser.md), e.g.: ``` import { browser } from '@wdio/globals' import AxeBuilder from '@axe-core/webdriverio' describe('Accessibility Test', () => { it('should get the accessibility results from a page', async () => { const builder = new AxeBuilder({ client: browser }) await browser.url('https://testingbot.com') const result = await builder.analyze() console.log('Acessibility Results:', result) }) }) ``` You can find more documentation on the Axe WebdriverIO adapter [on GitHub](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/webdriverio#usage). --- # BrowserStack Accessibility Testing You can easily integrate accessibility tests in your WebdriverIO test suites using the [Automated tests feature of BrowserStack Accessibility Testing](https://www.browserstack.com/docs/accessibility/automated-tests?utm_source=webdriverio\&utm_medium=partnered\&utm_campaign=documentation). ## Advantages of Automated Tests in BrowserStack Accessibility Testing[​](#advantages-of-automated-tests-in-browserstack-accessibility-testing "Direct link to Advantages of Automated Tests in BrowserStack Accessibility Testing") To use Automated tests in BrowserStack Accessibility Testing, your tests should be running on BrowserStack Automate. The following are the advantages of Automated tests: * Seamlessly integrates into your pre-existing automation test suite. * No code changes are required in test cases. * Requires zero additional maintenance for accessibility testing. * Understand historical trends and gain test-case insights. ## Get Started with BrowserStack Accessibility Testing[​](#get-started-with-browserstack-accessibility-testing "Direct link to Get Started with BrowserStack Accessibility Testing") Follow these steps to integrate your WebdriverIO test suites with BrowserStack's Accessibility Testing: 1. Install `@wdio/browserstack-service` npm package. * npm * Yarn * pnpm * Bun ``` npm install --save-dev @wdio/browserstack-service ``` ``` yarn add --dev @wdio/browserstack-service ``` ``` pnpm add --save-dev @wdio/browserstack-service ``` ``` bun add --dev @wdio/browserstack-service ``` 2. Update `wdio.conf.js` config file. ``` exports.config = { //... user: '' || process.env.BROWSERSTACK_USERNAME, key: '' || process.env.BROWSERSTACK_ACCESS_KEY, commonCapabilities: { 'bstack:options': { projectName: "Your static project name goes here", buildName: "Your static build/job name goes here" } }, services: [ ['browserstack', { accessibility: true, // Optional configuration options accessibilityOptions: { 'wcagVersion': 'wcag21a', 'includeIssueType': { 'bestPractice': false, 'needsReview': true }, 'includeTagsInTestingScope': ['Specify tags of test cases to be included'], 'excludeTagsInTestingScope': ['Specify tags of test cases to be excluded'] }, }] ], //... }; ``` You can view detailed instructions [here](https://www.browserstack.com/docs/accessibility/automated-tests/get-started/webdriverio?utm_source=webdriverio\&utm_medium=partnered\&utm_campaign=documentation). --- # TestMu AI Accessibility Testing You can easily integrate accessibility tests in your WebdriverIO test suites using [TestMu AI Accessibility Testing](https://www.testmuai.com/support/docs/accessibility-automation-settings/). ## Advantages of TestMu AI Accessibility Testing[​](#advantages-of-testmu-ai-accessibility-testing "Direct link to Advantages of TestMu AI Accessibility Testing") TestMu AI Accessibility Testing helps you identify and fix accessibility issues in your web applications. The following are the key advantages: * Seamlessly integrates with your existing WebdriverIO test automation. * Automated accessibility scanning during test execution. * Comprehensive WCAG compliance reporting. * Detailed issue tracking with remediation guidance. * Support for multiple WCAG standards (WCAG 2.0, WCAG 2.1, WCAG 2.2). * Real-time accessibility insights in the TestMu AI dashboard. ## Get Started with TestMu AI Accessibility Testing[​](#get-started-with-testmu-ai-accessibility-testing "Direct link to Get Started with TestMu AI Accessibility Testing") Follow these steps to integrate your WebdriverIO test suites with TestMu AI's Accessibility Testing: 1. Install the TestMu AI WebdriverIO service package. * npm * Yarn * pnpm * Bun ``` npm install --save-dev @lambdatest/wdio-lambdatest-service ``` ``` yarn add --dev @lambdatest/wdio-lambdatest-service ``` ``` pnpm add --save-dev @lambdatest/wdio-lambdatest-service ``` ``` bun add --dev @lambdatest/wdio-lambdatest-service ``` 2. Update your `wdio.conf.js` configuration file. ``` exports.config = { //... user: process.env.LT_USERNAME || '', key: process.env.LT_ACCESS_KEY || '', capabilities: [{ browserName: 'chrome', 'LT:Options': { platform: 'Windows 10', version: 'latest', accessibility: true, // Enable accessibility testing accessibilityOptions: { wcagVersion: 'wcag21a', // WCAG version (wcag20, wcag21a, wcag21aa, wcag22aa) bestPractice: false, needsReview: true } } }], services: [ ['lambdatest', { tunnel: false }] ], //... }; ``` 3. Run your tests as usual. TestMu AI will automatically scan for accessibility issues during test execution. ``` npx wdio run wdio.conf.js ``` ## Configuration Options[​](#configuration-options "Direct link to Configuration Options") The `accessibilityOptions` object supports the following parameters: * **wcagVersion**: Specify the WCAG standard version to test against * `wcag20` - WCAG 2.0 Level A * `wcag21a` - WCAG 2.1 Level A * `wcag21aa` - WCAG 2.1 Level AA (default) * `wcag22aa` - WCAG 2.2 Level AA * **bestPractice**: Include best practice recommendations (default: `false`) * **needsReview**: Include issues that need manual review (default: `true`) ## Viewing Accessibility Reports[​](#viewing-accessibility-reports "Direct link to Viewing Accessibility Reports") After your tests complete, you can view detailed accessibility reports in the [TestMu AI Dashboard](https://automation.lambdatest.com/): 1. Navigate to your test execution 2. Click on the "Accessibility" tab 3. Review identified issues with severity levels 4. Get remediation guidance for each issue For more detailed information, visit the [TestMu AI Accessibility Automation documentation](https://www.testmuai.com/support/docs/accessibility-automation-settings/). --- # Allure Reporter > A WebdriverIO reporter plugin to create [Allure Test Reports](https://allurereport.org/docs/webdriverio/). ![Allure Reporter Example](/assets/images/allure-bb6c9b036b07594235a5aca5aff5ac43.png) ### New Features[​](#new-features "Direct link to New Features") * **Test Plan Support** - Execute only specific tests defined in a test plan file * **Enhanced SDK Integration** - Updated to use `allure-js-commons` v3.3.2 with improved performance * **Better Cucumber Support** - Improved handling of Cucumber scenarios and steps * **Enhanced Error Handling** - More robust error reporting and debugging capabilities ### Test Plan Feature[​](#test-plan-feature "Direct link to Test Plan Feature") The Test Plan feature allows you to execute only specific tests defined in a JSON file. This is particularly useful for: * Running subset of tests in CI/CD pipelines * Parallel test execution * Test prioritization #### Configuration[​](#configuration "Direct link to Configuration") Create a test plan file (`.allure/testplan.json` or `testplan.json`): ``` { "version": "1.0", "tests": [ { "id": "test-001", "selector": "test/index.test.ts#should generate testplan.json" } ] } ``` #### How Selectors Work[​](#how-selectors-work "Direct link to How Selectors Work") Test plan selectors work by matching against the test's `fulltitle`, which includes the file path and test name. The format is: ``` # ``` Examples: * `test/index.test.ts#should generate testplan.json` - matches specific test in specific file * `Login Tests` - matches any test with "Login Tests" in the title * `User Registration` - matches any test with "User Registration" in the title The selector matching is flexible and supports: * **Exact matches** - full test title * **Partial matches** - substring of test title * **File-specific matches** - include file path for precise targeting #### Testplan[​](#testplan "Direct link to Testplan") The test plan support can be enabled by providing ALLURE\_TESTPLAN\_PATH environment variable – the reporter automatically loads the test plan file and run tests which match the selectors. ``` ALLURE_TESTPLAN_PATH=/path/to/your/testplan.json ``` #### Usage Examples[​](#usage-examples "Direct link to Usage Examples") **Example 1: Running specific tests by file and test name** ``` { "version": "1.0", "tests": [ { "id": "login-001", "selector": "tests/auth.test.js#should login with valid credentials" }, { "id": "login-002", "selector": "tests/auth.test.js#should reject invalid credentials" } ] } ``` **Example 2: Running tests by partial title match** ``` { "version": "1.0", "tests": [ { "id": "smoke-001", "selector": "Login Tests" }, { "id": "smoke-002", "selector": "User Registration" } ] } ``` **Example 3: Running all tests in a specific file** ``` { "version": "1.0", "tests": [ { "id": "auth-suite", "selector": "tests/auth.test.js" } ] } ``` ## Installation[​](#installation "Direct link to Installation") The easiest way is to include `@wdio/allure-reporter` as a devDependency in your `package.json`. ``` { "devDependencies": { "@wdio/allure-reporter": "^7.0.0" } } ``` You can simply do it by: ``` npm install @wdio/allure-reporter --save-dev ``` ## Configuration[​](#configuration-1 "Direct link to Configuration") Configure the output directory in your wdio.conf.js file: ``` export const config = { // ... reporters: [['allure', { outputDir: 'allure-results', disableWebdriverStepsReporting: true, disableWebdriverScreenshotsReporting: true, addConsoleLogs: true, // Attach console logs to reports reportedEnvironmentVars: { 'NODE_VERSION': process.version, 'BROWSER': 'chrome' } }]], // ... } ``` ### Configuration Options[​](#configuration-options "Direct link to Configuration Options") * `outputDir` - defaults to `./allure-results`. After a test run is complete, you will find that this directory has been populated with an `.json` file for each spec, plus a number of `.txt` and `.png` files and other attachments. * `disableWebdriverStepsReporting` - optional parameter (`false` by default), in order to log only custom steps to the reporter. * `issueLinkTemplate` - optional parameter, in order to specify the issue link pattern. Reporter will replace `{}` placeholder with value specified in `addIssue(value)` call parameter. The same logic is applied if Cucumber is used and tag `issue` is set at any level, it will be converted to the link in the report. The parameter value example: ``` https://example.org/issue/{} ``` * `tmsLinkTemplate` - optional parameter, in order to specify TMS (Test Management System) link pattern. Reporter will replace `{}` placeholder with value specified in `addTestId(value)` call parameter. The same logic is applied if Cucumber is used and tag `testId` is set at any level, it will be converted to the link in the report. The parameter value example: ``` https://example.org/tms/{} ``` * `disableWebdriverScreenshotsReporting` - optional parameter (`false` by default), in order to not attach screenshots to the reporter. * `useCucumberStepReporter` - optional parameter (`false` by default), set it to true in order to change the report hierarchy when using cucumber. Try it for yourself and see how it looks. * `disableMochaHooks` - optional parameter (`false` by default), set it to true in order to not fetch the `before/after` stacktrace/screenshot/result hooks into the Allure Reporter. * `addConsoleLogs` - optional parameter (`false` by default), set to true in order to attach console logs from step to the reporter. * `reportedEnvironmentVars` (**type:** `Record`) - Set this option to display the environment variables in the report. Note that setting this, does not modify the actual environment variables. * `includeVersionInHistoryId` - optional parameter (`false` by default). Allure `historyId` is derived from the test title plus the browser or device family (`chrome`, `iphone 12`, …), not the worker `cid` and not the browser/OS version. That keeps trends stable when Chrome or a mobile OS updates between runs. Vendor aliases such as `Google Chrome` / `googlechrome` and `msedge` / `Microsoft Edge` are collapsed to the same family. Allure still records the full version on the test as a `browser`/`device` parameter. Set this to `true` only if you run the same test against multiple versions of the same browser or device (for example iOS 14 vs iOS 15 on an iPhone 12) and need separate history trends per version. ## Supported Allure API[​](#supported-allure-api "Direct link to Supported Allure API") ### Core API Functions[​](#core-api-functions "Direct link to Core API Functions") * `addLabel(name, value)` - assign a custom label to test * `addFeature(featureName)` – assign features to test * `addStory(storyName)` – assign user story to test * `addSeverity(value)` – assign severity to test, accepts one of these values: blocker, critical, normal, minor, trivial * `addTag(value)` – assign a tag label to test * `addEpic(value)` – assign an epic label to test * `addOwner(value)` – assign an owner label to test * `addSuite(value)` – assign a suite label to test * `addSubSuite(value)` – assign a sub suite label to test * `addParentSuite(value)` – assign a parent suite label to test * `addIssue(value)` – assign issue id to test * `addAllureId(value)` – assign allure test ops id label to test * `addTestId(value)` – assign TMS test id to test * \~\~`addEnvironment(name, value)` \~\~ – a deprecated function that no longer works. Use `reportedEnvironmentVars` instead ### Attachments and Content[​](#attachments-and-content "Direct link to Attachments and Content") * `addAttachment(name, content, [type])` – save attachment to test. * `name` (*String*) - attachment name. * `content` – attachment content. * `type` (*String*, optional) – attachment MIME-type, `text/plain` by default * `addArgument(name, value)` - add an additional argument to test * `addDescription(description, [type])` – add description to test. * `description` (*String*) - description of the test. * `type` (*String*, optional) – description type, `text` by default. Values \['text', 'html','markdown'] ### Steps API[​](#steps-api "Direct link to Steps API") * `addStep(title, [{content, name = 'attachment'}], [status])` - add step to test. * `title` (*String*) - name of the step. * `content` (*String*, optional) - step attachment * `name` (*String*, optional) - step attachment name, `attachment` by default. * `status` (*String*, optional) - step status, `passed` by default. Must be "failed", "passed" or "broken" * `startStep(title)` - start with a step * `title` (*String*) - name of the step. * `endStep(status)` - end with a step * `status` (*String*, optional) - step status, `passed` by default. Must be "failed", "passed" or "broken" * `step(name, body)` - starts step with content function inside. Allows to create steps with infinite hierarchy * `body` (*Function*) - the step body async function ### Usage[​](#usage "Direct link to Usage") Allure Api can be accessed using: CJS ``` const allureReporter = require('@wdio/allure-reporter').default ``` ESM ``` import allureReporter from '@wdio/allure-reporter' ``` Mocha example ``` describe('Suite', () => { it('Case', () => { allureReporter.addFeature('Feature') }) }) ``` #### Cucumber[​](#cucumber "Direct link to Cucumber") Basic Cucumber example: ``` Given('I include feature and story name', () => { allureReporter.addFeature('Feature_name'); allureReporter.addStory('Story_name'); }) ``` #### Custom steps[​](#custom-steps "Direct link to Custom steps") `step` method simplifies dealing with steps because each step present as an async function with any content inside. The first argument of the function is the current step, that has most of the allure API methods (such as `label`, `epic`, `attach` etc): ``` allureReporter.step('my step name', async (s1) => { s1.label('foo', 'bar') await s1.step('my child step name', async (s2) => { // you can add any combination of steps in the body function }) }) ``` ##### Cucumber Tags[​](#cucumber-tags "Direct link to Cucumber Tags") Cucumber tags with special names (`issue` and `testId`) are converted to the links (the corresponding link templates must be configured before): ``` @issue=BUG-1 @testId=TST-2 Feature: This is a feature with global tags that will be converted to Allure links @issue=BUG-3 @testId=TST-4 Scenario: This is a scenario with tags that will be converted to Allure links Given I do something ``` Cucumber tags with special names (`feature`) are mapped to Allure labels: ``` Feature: Test user role @feature=login Scenario: Login Given I test login ``` ## Displaying the report[​](#displaying-the-report "Direct link to Displaying the report") The results can be consumed by any of the [reporting tools](https://allurereport.org/) offered by Allure. For example: ### Command-line[​](#command-line "Direct link to Command-line") Install the [Allure command-line tool](https://www.npmjs.com/package/allure-commandline), and process the results directory: ``` allure generate [allure_output_dir] && allure open ``` This will generate a report (by default in `./allure-report`), and open it in your browser. ### Autogenerate Report[​](#autogenerate-report "Direct link to Autogenerate Report") You can also auto-generate the report by using the Allure command line tool programmatically. To do so install the package in your project by: ``` npm i allure-commandline ``` Then add or extend your `onComplete` hook or create a [custom service](/docs/customservices.md) for this: ``` // wdio.conf.js const allure = require('allure-commandline') export const config = { // ... onComplete: function() { const reportError = new Error('Could not generate Allure report') const generation = allure(['generate', 'allure-results', '--clean']) return new Promise((resolve, reject) => { const generationTimeout = setTimeout( () => reject(reportError), 5000) generation.on('exit', function(exitCode) { clearTimeout(generationTimeout) if (exitCode !== 0) { return reject(reportError) } console.log('Allure report successfully generated') resolve() }) }) } // ... } ``` ### Jenkins[​](#jenkins "Direct link to Jenkins") Install and configure the [Allure Jenkins plugin](https://allurereport.org/docs/integrations-jenkins/) ## Add Screenshots[​](#add-screenshots "Direct link to Add Screenshots") Screenshots can be attached to the report by using the `takeScreenshot` function from WebDriverIO in the `afterTest` hook for Mocha and Jasmine or `afterStep` hook for Cucumber. First set `disableWebdriverScreenshotsReporting: false` in reporter options, then add in afterStep hook: ### Mocha / Jasmine[​](#mocha--jasmine "Direct link to Mocha / Jasmine") wdio.conf.js ``` afterTest: async function(test, context, { error, result, duration, passed, retries }) { if (error) { await browser.takeScreenshot(); } } ``` ### Cucumber[​](#cucumber-1 "Direct link to Cucumber") wdio.conf.js ``` afterStep: async function (step, scenario, { error, duration, passed }, context) { if (error) { await browser.takeScreenshot(); } } ``` As shown in the example above, when this function is called, a screenshot image will be attached to the allure report. ### Compatibility[​](#compatibility "Direct link to Compatibility") * **Allure**: Compatible with Allure Framework 3.x ## Getting Help[​](#getting-help "Direct link to Getting Help") * Check the [Allure documentation](https://allurereport.org/docs/) * Report issues on [Webdriverio](https://github.com/webdriverio/webdriverio/issues) or [Allure3](https://github.com/allure-framework/allure3/) --- # Introduction Welcome to the WebdriverIO API docs. These pages contain reference materials for all implemented protocol bindings and convenience commands. Protocol commands, including [WebDriver](/docs/api/webdriver.md), [WebDriver Bidi](/docs/api/webdriverBidi.md) or mobile commands like [Appium](http://appium.io) are commands that are directly send to the underlying driver backend. Convenience commands provided by the [`browser`](/docs/api/browser.md), [`element`](/docs/api/element.md) or [`mock`](/docs/api/mock.md) object offer higher level interactivity. info These are the docs for the latest version (**>=8.x**) of WebdriverIO. If you are still using an older version, please visit the [old documentation websites](/versions)! ## Contribute[​](#contribute "Direct link to Contribute") If you feel like you have a good example for a command, don't hesitate to open a PR and submit it. Just click on the orange link on the bottom left with the label *“Edit this page”*. Make sure you understand the way we write these docs by checking the [Contributing](https://github.com/webdriverio/webdriverio/blob/main/CONTRIBUTING.md) section. --- # Appium ## getLogTypes[​](#getlogtypes "Direct link to getLogTypes") Get available log types.

Appium command. More details can be found in the [official protocol docs](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes). ### Usage[​](#usage "Direct link to Usage") ``` await driver.getLogTypes() ``` ### Returns[​](#returns "Direct link to Returns") * **\** **`logTypes`:** The list of available log types, example: browser, driver. *** ## getLogs[​](#getlogs "Direct link to getLogs") Get the log for a given log type. Log buffer is reset after each request.

Appium command. More details can be found in the [official protocol docs](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog). ### Usage[​](#usage-1 "Direct link to Usage") ``` await driver.getLogs(type) ``` ### Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ------------ | | `type` | `string` | the log type | ### Returns[​](#returns-1 "Direct link to Returns") * **\** **`logs`:** The list of log entries. *** ## getSession[​](#getsession "Direct link to getSession") Retrieve the capabilities of the current session.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#getsession). caution This protocol command is deprecated
Use `getAppiumSessionCapabilities` instead ### Usage[​](#usage-2 "Direct link to Usage") ``` await driver.getSession() ``` ### Returns[​](#returns-2 "Direct link to Returns") * **\** **`capabilities`:** An object describing the session's capabilities. *** ## getAppiumContext[​](#getappiumcontext "Direct link to getAppiumContext") Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/mjsonwp/#getcurrentcontext). ### Usage[​](#usage-3 "Direct link to Usage") ``` await driver.getAppiumContext() ``` ### Returns[​](#returns-3 "Direct link to Returns") * **\** **`context`:** a string representing the current context or null representing 'no context' *** ## switchAppiumContext[​](#switchappiumcontext "Direct link to switchAppiumContext") Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/mjsonwp/#setcontext). ### Usage[​](#usage-4 "Direct link to Usage") ``` await driver.switchAppiumContext(name) ``` ### Parameters[​](#parameters-1 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ------------------------------------------ | | `name` | `string` | a string representing an available context | *** ## getAppiumContexts[​](#getappiumcontexts "Direct link to getAppiumContexts") Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/mjsonwp/#getcontexts). ### Usage[​](#usage-5 "Direct link to Usage") ``` await driver.getAppiumContexts() ``` ### Returns[​](#returns-4 "Direct link to Returns") * **\** **`contexts`:** an array of strings representing available contexts, e.g. 'WEBVIEW', or 'NATIVE' *** ## getAppiumCommands[​](#getappiumcommands "Direct link to getAppiumCommands") Retrieve the endpoints and BiDi commands supported in the current session.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#listcommands). ### Usage[​](#usage-6 "Direct link to Usage") ``` await driver.getAppiumCommands() ``` ### Returns[​](#returns-5 "Direct link to Returns") * **\** **`commands`:** Supported endpoints and BiDi commands, each grouped into common, driver-specific, and plugin-specific endpoints/commands. *** ## getAppiumExtensions[​](#getappiumextensions "Direct link to getAppiumExtensions") Retrieve the extension commands supported in the current session.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#listextensions). ### Usage[​](#usage-7 "Direct link to Usage") ``` await driver.getAppiumExtensions() ``` ### Returns[​](#returns-6 "Direct link to Returns") * **\** **`commands`:** Supported extension commands, grouped into driver-specific and plugin-specific commands. *** ## getAppiumSessionCapabilities[​](#getappiumsessioncapabilities "Direct link to getAppiumSessionCapabilities") Retrieve the capabilities of the current session.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#getappiumsessioncapabilities). ### Usage[​](#usage-8 "Direct link to Usage") ``` await driver.getAppiumSessionCapabilities() ``` ### Returns[​](#returns-7 "Direct link to Returns") * **\** **`capabilities`:** An object describing the session's capabilities. *** ## appiumShake[​](#appiumshake "Direct link to appiumShake") Perform a shake action on the device. This is the raw Appium protocol endpoint. Prefer the `shake` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/interactions/shake/). caution This protocol command is deprecated
Use the `shake` mobile command (`driver.shake()`) instead ### Usage[​](#usage-9 "Direct link to Usage") ``` await driver.appiumShake() ``` ### Support[​](#support "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl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gzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) *** ## appiumLock[​](#appiumlock "Direct link to appiumLock") Lock the device. This is the raw Appium protocol endpoint. Prefer the `lock` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/interactions/lock/). caution This protocol command is deprecated
Use the `lock` mobile command (`driver.lock()`) instead ### Usage[​](#usage-10 "Direct link to Usage") ``` await driver.appiumLock(seconds) ``` ### Parameters[​](#parameters-2 "Direct link to Parameters") | Name | Type | Details | | ------------------------- | -------- | -------------------------------------- | | `seconds`
*optional* | `number` | how long to lock the screen (iOS only) | ### Support[​](#support-1 "Direct link to Support") ![Support for UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItL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MTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## appiumUnlock[​](#appiumunlock "Direct link to appiumUnlock") Unlock the device. This is the raw Appium protocol endpoint. Prefer the `unlock` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/interactions/unlock/). caution This protocol command is deprecated
Use the `unlock` mobile command (`driver.unlock()`) instead ### Usage[​](#usage-11 "Direct link to Usage") ``` await driver.appiumUnlock() ``` ### Support[​](#support-2 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## appiumIsLocked[​](#appiumislocked "Direct link to appiumIsLocked") Check whether the device is locked or not. This is the raw Appium protocol endpoint. Prefer the `isLocked` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/interactions/is-locked/). caution This protocol command is deprecated
Use the `isLocked` mobile command (`driver.isLocked()`) instead ### Usage[​](#usage-12 "Direct link to Usage") ``` await driver.appiumIsLocked() ``` ### Returns[​](#returns-8 "Direct link to Returns") * **\** **`isLocked`:** True if the device is locked, false if not ### Support[​](#support-3 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## startRecordingScreen[​](#startrecordingscreen "Direct link to startRecordingScreen") Start recording the screen.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/recording-screen/start-recording-screen/). ### Usage[​](#usage-13 "Direct link to Usage") ``` await driver.startRecordingScreen(options) ``` ### Parameters[​](#parameters-3 "Direct link to Parameters") | Name | Type | Details | | ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `options`
*optional* | `object` | command parameters that can contain keys like: remotePath, username, password, method, forceRestart, timeLimit, videoType, videoQuality, videoFps, bitRate, videoSize, bugReport (see more description in Appium docs) | ### Support[​](#support-4 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4b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g1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## stopRecordingScreen[​](#stoprecordingscreen "Direct link to stopRecordingScreen") Stop recording screen.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/recording-screen/stop-recording-screen/). ### Usage[​](#usage-14 "Direct link to Usage") ``` await driver.stopRecordingScreen(remotePath, username, password, method) ``` ### Parameters[​](#parameters-4 "Direct link to Parameters") | Name | Type | Details | | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `remotePath`
*optional* | `string` | The path to the remote location, where the resulting video should be uploaded. The following protocols are supported http/https, ftp. This option only has an effect if there is screen recording process in progreess and forceRestart parameter is not set to true. Null or empty string value (the default setting) means the content of resulting file should be encoded as Base64. | | `username`
*optional* | `string` | The name of the user for the remote authentication. | | `password`
*optional* | `string` | The password for the remote authentication. | | `method`
*optional* | `string` | The http multipart upload method name. The 'PUT' one is used by default. | ### Returns[​](#returns-9 "Direct link to Returns") * **\** **`response`:** Base64 encoded string. If remote\_path is set, the response is empty string ### Support[​](#support-5 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## appiumGetPerformanceDataTypes[​](#appiumgetperformancedatatypes "Direct link to appiumGetPerformanceDataTypes") Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery. This is the raw Appium protocol endpoint. Prefer the `getPerformanceDataTypes` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/performance-data/performance-data-types/). caution This protocol command is deprecated
Use the `getPerformanceDataTypes` mobile command (`driver.getPerformanceDataTypes()`) instead ### Usage[​](#usage-15 "Direct link to Usage") ``` await driver.appiumGetPerformanceDataTypes() ``` ### Returns[​](#returns-10 "Direct link to Returns") * **\** **`performanceTypes`:** The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo) ### Support[​](#support-6 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGetPerformanceData[​](#appiumgetperformancedata "Direct link to appiumGetPerformanceData") Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery. This is the raw Appium protocol endpoint. Prefer the `getPerformanceData` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/performance-data/get-performance-data/). caution This protocol command is deprecated
Use the `getPerformanceData` mobile command (`driver.getPerformanceData()`) instead ### Usage[​](#usage-16 "Direct link to Usage") ``` await driver.appiumGetPerformanceData(packageName, dataType, dataReadTimeout) ``` ### Parameters[​](#parameters-5 "Direct link to Parameters") | Name | Type | Details | | --------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | | `packageName` | `string` | the package name of the application | | `dataType` | `string` | the type of system state which wants to read. It should be one of the supported performance data types | | `dataReadTimeout`
*optional* | `number` | the number of attempts to read | ### Returns[​](#returns-11 "Direct link to Returns") * **\** **`performanceData`:** The information type of the system state which is supported to read as like cpu, memory, network traffic, and battery ### Support[​](#support-7 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumPressKeyCode[​](#appiumpresskeycode "Direct link to appiumPressKeyCode") Press a particular key on the device. This is the raw Appium protocol endpoint. Prefer the `pressKeyCode` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/keys/press-keycode/). caution This protocol command is deprecated
Use the `pressKeyCode` mobile command (`driver.pressKeyCode()`) instead ### Usage[​](#usage-17 "Direct link to Usage") ``` await driver.appiumPressKeyCode(keycode, metastate, flags) ``` ### Parameters[​](#parameters-6 "Direct link to Parameters") | Name | Type | Details | | --------------------------- | -------- | ------------------------------------ | | `keycode` | `number` | keycode to press | | `metastate`
*optional* | `number` | meta state to press the keycode with | | `flags`
*optional* | `number` | flags for the keypress | ### Support[​](#support-8 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumLongPressKeyCode[​](#appiumlongpresskeycode "Direct link to appiumLongPressKeyCode") Press and hold a particular key code on the device. This is the raw Appium protocol endpoint. Prefer the `longPressKeyCode` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/keys/long-press-keycode/). caution This protocol command is deprecated
Use the `longPressKeyCode` mobile command (`driver.longPressKeyCode()`) instead ### Usage[​](#usage-18 "Direct link to Usage") ``` await driver.appiumLongPressKeyCode(keycode, metastate, flags) ``` ### Parameters[​](#parameters-7 "Direct link to Parameters") | Name | Type | Details | | --------------------------- | -------- | ------------------------------ | | `keycode` | `number` | keycode to press on the device | | `metastate`
*optional* | `number` | metastate for the keypress | | `flags`
*optional* | `number` | flags for the keypress | ### Support[​](#support-9 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumSendKeyEvent[​](#appiumsendkeyevent "Direct link to appiumSendKeyEvent") Send a key code to the device. This is the raw Appium protocol endpoint. Prefer the `pressKeyCode` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints). caution This protocol command is deprecated
Use the `pressKeyCode` mobile command (`driver.pressKeyCode()`) instead ### Usage[​](#usage-19 "Direct link to Usage") ``` await driver.appiumSendKeyEvent(keycode, metastate) ``` ### Parameters[​](#parameters-8 "Direct link to Parameters") | Name | Type | Details | | --------------------------- | -------- | ------------------------------------ | | `keycode` | `string` | keycode to press | | `metastate`
*optional* | `string` | meta state to press the keycode with | ### Support[​](#support-10 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## rotateDevice[​](#rotatedevice "Direct link to rotateDevice") Rotate the device in three dimensions.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/mjsonwp/#setrotation). ### Usage[​](#usage-20 "Direct link to Usage") ``` await driver.rotateDevice(x, y, z) ``` ### Parameters[​](#parameters-9 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | ---------------------------------------------------- | | `x` | `number` | x offset to use for the center of the rotate gesture | | `y` | `number` | y offset to use for the center of the rotate gesture | | `z` | `number` | z offset to use for the center of the rotate gesture | ### Support[​](#support-11 "Direct link to Support") ![Support for UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiB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E2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## appiumGetCurrentActivity[​](#appiumgetcurrentactivity "Direct link to appiumGetCurrentActivity") Get the name of the current Android activity. This is the raw Appium protocol endpoint. Prefer the `getCurrentActivity` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/activity/current-activity/). caution This protocol command is deprecated
Use the `getCurrentActivity` mobile command (`driver.getCurrentActivity()`) instead ### Usage[​](#usage-21 "Direct link to Usage") ``` await driver.appiumGetCurrentActivity() ``` ### Returns[​](#returns-12 "Direct link to Returns") * **\** **`activity`:** Name of the current activity ### Support[​](#support-12 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGetCurrentPackage[​](#appiumgetcurrentpackage "Direct link to appiumGetCurrentPackage") Get the name of the current Android package. This is the raw Appium protocol endpoint. Prefer the `getCurrentPackage` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/activity/current-package/). caution This protocol command is deprecated
Use the `getCurrentPackage` mobile command (`driver.getCurrentPackage()`) instead ### Usage[​](#usage-22 "Direct link to Usage") ``` await driver.appiumGetCurrentPackage() ``` ### Returns[​](#returns-13 "Direct link to Returns") * **\** **`package`:** Name of the current package ### Support[​](#support-13 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## installApp[​](#installapp "Direct link to installApp") Install the given app onto the device.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#installapp). ### Usage[​](#usage-23 "Direct link to Usage") ``` await driver.installApp(appPath, options) ``` ### Parameters[​](#parameters-10 "Direct link to Parameters") | Name | Type | Details | | ------------------------- | -------- | ------------------------------------ | | `appPath` | `string` | Path to application .apk file | | `options`
*optional* | `object` | Driver-specific installation options | ### Support[​](#support-14 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## activateApp[​](#activateapp "Direct link to activateApp") Activate the given app on the device

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#activateapp). ### Usage[​](#usage-24 "Direct link to Usage") ``` await driver.activateApp(appId, bundleId, options) ``` ### Parameters[​](#parameters-11 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | ------------------------------------- | | `appId`
*optional* | `string` | App package ID (required for Android) | | `bundleId`
*optional* | `string` | Bundle ID (required for iOS) | | `options`
*optional* | `object` | Driver-specific launch options | ### Support[​](#support-15 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## removeApp[​](#removeapp "Direct link to removeApp") Remove an app from the device.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#removeapp). ### Usage[​](#usage-25 "Direct link to Usage") ``` await driver.removeApp(appId, bundleId, options) ``` ### Parameters[​](#parameters-12 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | ------------------------------------- | | `appId`
*optional* | `string` | App package ID (required for Android) | | `bundleId`
*optional* | `string` | Bundle ID (required for iOS) | | `options`
*optional* | `object` | Driver-specific uninstall options | ### Returns[​](#returns-14 "Direct link to Returns") * **\** **`didRemovalSucceed`:** Return true if uninstall was successful, false if not ### Support[​](#support-16 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## terminateApp[​](#terminateapp "Direct link to terminateApp") Terminate the given app on the device

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#terminateapp). ### Usage[​](#usage-26 "Direct link to Usage") ``` await driver.terminateApp(appId, bundleId, options) ``` ### Parameters[​](#parameters-13 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | ------------------------------------- | | `appId`
*optional* | `string` | App package ID (required for Android) | | `bundleId`
*optional* | `string` | Bundle ID (required for iOS) | | `options`
*optional* | `object` | Driver-specific termination options | ### Support[​](#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40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## isAppInstalled[​](#isappinstalled "Direct link to isAppInstalled") Check whether the specified app is installed on the device.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#isappinstalled). ### Usage[​](#usage-27 "Direct link to Usage") ``` await driver.isAppInstalled(appId, bundleId) ``` ### Parameters[​](#parameters-14 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | ------------------------------------- | | `appId`
*optional* | `string` | App package ID (required for Android) | | `bundleId`
*optional* | `string` | Bundle ID (required for iOS) | ### Returns[​](#returns-15 "Direct link to Returns") * **\** **`isAppInstalled`:** Return true if installed, false if not ### Support[​](#support-18 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvc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sMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## queryAppState[​](#queryappstate "Direct link to queryAppState") Get the given app status on the device

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#queryappstate). ### Usage[​](#usage-28 "Direct link to Usage") ``` await driver.queryAppState(appId, bundleId) ``` ### Parameters[​](#parameters-15 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | ------------------------------------- | | `appId`
*optional* | `string` | App package ID (required for Android) | | `bundleId`
*optional* | `string` | Bundle ID (required for iOS) | ### Returns[​](#returns-16 "Direct link to Returns") * **\** **`appStatus`:** 0 is not installed. 1 is not running. 2 is running in background suspended. 3 is running in background. 4 is running in foreground ### Support[​](#support-19 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS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Ljk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## hideKeyboard[​](#hidekeyboard "Direct link to hideKeyboard") Hide soft keyboard.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#hidekeyboard). ### Usage[​](#usage-29 "Direct link to Usage") ``` await driver.hideKeyboard(strategy, key, keyCode, keyName) ``` ### Parameters[​](#parameters-16 "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `strategy`
*optional* | `string` | hide keyboard strategy (UIAutomation only), available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default' | | `key`
*optional* | `string` | key value if strategy is 'pressKey' | | `keyCode`
*optional* | `string` | key code if strategy is 'pressKey' | | `keyName`
*optional* | `string` | key name if strategy is 'pressKey' | ### Support[​](#support-20 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9X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4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## isKeyboardShown[​](#iskeyboardshown "Direct link to isKeyboardShown") Whether or not the soft keyboard is shown.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#iskeyboardshown). ### Usage[​](#usage-30 "Direct link to Usage") ``` await driver.isKeyboardShown() ``` ### Returns[​](#returns-17 "Direct link to Returns") * **\** **`isKeyboardShown`:** True if the keyboard is shown ### Support[​](#support-21 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94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OS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## pushFile[​](#pushfile "Direct link to pushFile") Place a file onto the device in a particular place.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#pushfile). ### Usage[​](#usage-31 "Direct link to Usage") ``` await driver.pushFile(path, data) ``` ### Parameters[​](#parameters-17 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | --------------------------- | | `path` | `string` | path to install the data to | | `data` | `string` | contents of file in base64 | ### Support[​](#support-22 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## pullFile[​](#pullfile "Direct link to pullFile") Retrieve a file from the device's file system.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#pullfile). ### Usage[​](#usage-32 "Direct link to Usage") ``` await driver.pullFile(path) ``` ### Parameters[​](#parameters-18 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ------------------------------------ | | `path` | `string` | path on the device to pull file from | ### Returns[​](#returns-18 "Direct link to Returns") * **\** **`response`:** Contents of file in base64 ### Support[​](#support-23 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## pullFolder[​](#pullfolder "Direct link to pullFolder") Retrieve a folder from the device's file system.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#pullfolder). ### Usage[​](#usage-33 "Direct link to Usage") ``` await driver.pullFolder(path) ``` ### Parameters[​](#parameters-19 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | -------------------------------------- | | `path` | `string` | path to an entire folder on the device | ### Returns[​](#returns-19 "Direct link to Returns") * **\** **`response`:** Zip file of the folder contents in base64 ### Support[​](#support-24 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy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NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## appiumToggleAirplaneMode[​](#appiumtoggleairplanemode "Direct link to appiumToggleAirplaneMode") Toggle airplane mode on device. This is the raw Appium protocol endpoint. Prefer the `toggleAirplaneMode` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/toggle-airplane-mode/). caution This protocol command is deprecated
Use the `toggleAirplaneMode` mobile command (`driver.toggleAirplaneMode()`) instead ### Usage[​](#usage-34 "Direct link to Usage") ``` await driver.appiumToggleAirplaneMode() ``` ### Support[​](#support-25 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumToggleData[​](#appiumtoggledata "Direct link to appiumToggleData") Switch the state of data service. This is the raw Appium protocol endpoint. Prefer the `toggleData` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/toggle-data/). caution This protocol command is deprecated
Use the `toggleData` mobile command (`driver.toggleData()`) instead ### Usage[​](#usage-35 "Direct link to Usage") ``` await driver.appiumToggleData() ``` ### Support[​](#support-26 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumToggleWiFi[​](#appiumtogglewifi "Direct link to appiumToggleWiFi") Switch the state of the wifi service. This is the raw Appium protocol endpoint. Prefer the `toggleWiFi` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/toggle-wifi/). caution This protocol command is deprecated
Use the `toggleWiFi` mobile command (`driver.toggleWiFi()`) instead ### Usage[​](#usage-36 "Direct link to Usage") ``` await driver.appiumToggleWiFi() ``` ### Support[​](#support-27 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumToggleLocationServices[​](#appiumtogglelocationservices "Direct link to appiumToggleLocationServices") Switch the state of the location service. This is the raw Appium protocol endpoint. Prefer the `toggleLocationServices` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/toggle-location-services/). caution This protocol command is deprecated
Use the `toggleLocationServices` mobile command (`driver.toggleLocationServices()`) instead ### Usage[​](#usage-37 "Direct link to Usage") ``` await driver.appiumToggleLocationServices() ``` ### Support[​](#support-28 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumToggleNetworkSpeed[​](#appiumtogglenetworkspeed "Direct link to appiumToggleNetworkSpeed") Set network speed (Emulator only). This is the raw Appium protocol endpoint. Prefer the `toggleNetworkSpeed` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/network-speed/). caution This protocol command is deprecated
Use the `toggleNetworkSpeed` mobile command (`driver.toggleNetworkSpeed()`) instead ### Usage[​](#usage-38 "Direct link to Usage") ``` await driver.appiumToggleNetworkSpeed(netspeed) ``` ### Parameters[​](#parameters-20 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ------------------------------------------------------------------------------------ | | `netspeed` | `string` | Network type - 'full','gsm', 'edge', 'hscsd', 'gprs', 'umts', 'hsdpa', 'lte', 'evdo' | ### Support[​](#support-29 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumOpenNotifications[​](#appiumopennotifications "Direct link to appiumOpenNotifications") Open Android notifications. This is the raw Appium protocol endpoint. Prefer the `openNotifications` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/system/open-notifications/). caution This protocol command is deprecated
Use the `openNotifications` mobile command (`driver.openNotifications()`) instead ### Usage[​](#usage-39 "Direct link to Usage") ``` await driver.appiumOpenNotifications() ``` ### Support[​](#support-30 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumStartActivity[​](#appiumstartactivity "Direct link to appiumStartActivity") Start an Android activity by providing package name and activity name. This is the raw Appium protocol endpoint. Prefer the `startActivity` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/activity/start-activity/). caution This protocol command is deprecated
Use the `startActivity` mobile command (`driver.startActivity()`) instead ### Usage[​](#usage-40 "Direct link to Usage") ``` await driver.appiumStartActivity(appPackage, appActivity, appWaitPackage, appWaitActivity, intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset) ``` ### Parameters[​](#parameters-21 "Direct link to Parameters") | Name | Type | Details | | ----------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------- | | `appPackage` | `string` | name of app | | `appActivity` | `string` | name of activity | | `appWaitPackage`
*optional* | `string` | name of app to wait for | | `appWaitActivity`
*optional* | `string` | name of activity to wait for | | `intentAction=android.intent.action.MAIN`
*optional* | `string` | intent action which will be used to start activity | | `intentCategory=android.intent.category.LAUNCHER`
*optional* | `string` | intent category which will be used to start activity | | `intentFlags=0x10200000`
*optional* | `string` | flags that will be used to start activity | | `optionalIntentArguments`
*optional* | `string` | additional intent arguments that will be used to start activity | | `dontStopAppOnReset`
*optional* | `string` | doesn’t stop the process of the app under test, before starting the app using adb | ### Support[​](#support-31 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGetSystemBars[​](#appiumgetsystembars "Direct link to appiumGetSystemBars") Retrieve visibility and bounds information of the status and navigation bars. This is the raw Appium protocol endpoint. Prefer the `getSystemBars` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/system/system-bars/). caution This protocol command is deprecated
Use the `getSystemBars` mobile command (`driver.getSystemBars()`) instead ### Usage[​](#usage-41 "Direct link to Usage") ``` await driver.appiumGetSystemBars() ``` ### Returns[​](#returns-20 "Direct link to Returns") * **\** **`systemBars`:** Information about visibility and bounds of status and navigation bar ### Support[​](#support-32 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## getDeviceTime[​](#getdevicetime "Direct link to getDeviceTime") Get the time on the device.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/system/system-time/). ### Usage[​](#usage-42 "Direct link to Usage") ``` await driver.getDeviceTime() ``` ### Returns[​](#returns-21 "Direct link to Returns") * **\** **`time`:** Time on the device ### Support[​](#support-33 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## appiumGetDisplayDensity[​](#appiumgetdisplaydensity "Direct link to appiumGetDisplayDensity") Get display density from device. This is the raw Appium protocol endpoint. Prefer the `getDisplayDensity` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints). caution This protocol command is deprecated
Use the `getDisplayDensity` mobile command (`driver.getDisplayDensity()`) instead ### Usage[​](#usage-43 "Direct link to Usage") ``` await driver.appiumGetDisplayDensity() ``` ### Returns[​](#returns-22 "Direct link to Returns") * **<\*>** ### Support[​](#support-34 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumTouchId[​](#appiumtouchid "Direct link to appiumTouchId") Simulate a [touch id](https://support.apple.com/en-ca/ht201371) event (iOS Simulator only). To enable this feature, the `allowTouchIdEnroll` desired capability must be set to true and the Simulator must be [enrolled](https://support.apple.com/en-ca/ht201371). When you set allowTouchIdEnroll to true, it will set the Simulator to be enrolled by default. The enrollment state can be [toggled](https://appium.github.io/appium.io/docs/en/commands/device/simulator/toggle-touch-id-enrollment/index.html). This call will only work if Appium process or its parent application (e.g. Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/simulator/touch-id/). caution This protocol command is deprecated
Use the `touchId` mobile command (`driver.touchId()`) instead ### Usage[​](#usage-44 "Direct link to Usage") ``` await driver.appiumTouchId(match) ``` ### Parameters[​](#parameters-22 "Direct link to Parameters") | Name | Type | Details | | ------- | --------- | --------------------------------------------------------------------- | | `match` | `boolean` | are we simulating a successful touch (true) or a failed touch (false) | ### Support[​](#support-35 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cud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2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+) *** ## appiumToggleEnrollTouchId[​](#appiumtoggleenrolltouchid "Direct link to appiumToggleEnrollTouchId") Toggle the simulator being [enrolled](https://support.apple.com/en-ca/ht201371) to accept touchId (iOS Simulator only). To enable this feature, the `allowTouchIdEnroll` desired capability must be set to true. When `allowTouchIdEnroll` is set to true the Simulator will be enrolled by default, and the 'Toggle Touch ID Enrollment' changes the enrollment state. This call will only work if the Appium process or its parent application (e.g., Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/simulator/toggle-touch-id-enrollment/). caution This protocol command is deprecated
Use the `toggleEnrollTouchId` mobile command (`driver.toggleEnrollTouchId()`) instead ### Usage[​](#usage-45 "Direct link to Usage") ``` await driver.appiumToggleEnrollTouchId(enabled) ``` ### Parameters[​](#parameters-23 "Direct link to Parameters") | Name | Type | Details | | ------------------------------ | --------- | ------------------------------------------------------ | | `enabled=true`
*optional* | `boolean` | equals to true if TouchID enrollment should be enabled | ### Support[​](#support-36 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS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Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+) *** ## appiumLaunchApp[​](#appiumlaunchapp "Direct link to appiumLaunchApp") Launch an app on device. This is the raw Appium protocol endpoint. Prefer the `launchApp` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/app/launch-app/). caution This protocol command is deprecated
Use the `launchApp` mobile command (`driver.launchApp()`) instead ### Usage[​](#usage-46 "Direct link to Usage") ``` await driver.appiumLaunchApp() ``` ### Support[​](#support-37 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yN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**iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## appiumCloseApp[​](#appiumcloseapp "Direct link to appiumCloseApp") Close an app on device. This is the raw Appium protocol endpoint. Prefer the `closeApp` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/app/close-app/). caution This protocol command is deprecated
Use the `closeApp` mobile command (`driver.closeApp()`) instead ### Usage[​](#usage-47 "Direct link to Usage") ``` await driver.appiumCloseApp() ``` ### Support[​](#support-38 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## appiumBackground[​](#appiumbackground "Direct link to appiumBackground") Send the currently running app for this session to the background. This is the raw Appium protocol endpoint. Prefer the `background` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/app/background-app/). caution This protocol command is deprecated
Use the `background` mobile command (`driver.background()`) instead ### Usage[​](#usage-48 "Direct link to Usage") ``` await driver.appiumBackground(seconds) ``` ### Parameters[​](#parameters-24 "Direct link to Parameters") | Name | Type | Details | | -------------- | -------------- | -------------------------------------------------------------------------- | | `seconds=null` | `number, null` | Timeout after which to restore the app. A value of -1 disables the timeout | ### Support[​](#support-39 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## endCoverage[​](#endcoverage "Direct link to endCoverage") Get test coverage data.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/app/end-test-coverage/). caution This protocol command is deprecated
Use `driver.execute('mobile: shell', { ... })` instead ### Usage[​](#usage-49 "Direct link to Usage") ``` await driver.endCoverage(intent, path) ``` ### Parameters[​](#parameters-25 "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | ------------------- | | `intent` | `string` | intent to broadcast | | `path` | `string` | path to .ec file | ### Support[​](#support-40 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGetStrings[​](#appiumgetstrings "Direct link to appiumGetStrings") Get app strings. This is the raw Appium protocol endpoint. Prefer the `getStrings` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/app/get-app-strings/). caution This protocol command is deprecated
Use the `getStrings` mobile command (`driver.getStrings()`) instead ### Usage[​](#usage-50 "Direct link to Usage") ``` await driver.appiumGetStrings(language, stringFile) ``` ### Parameters[​](#parameters-26 "Direct link to Parameters") | Name | Type | Details | | ---------------------------- | -------- | ----------------------- | | `language`
*optional* | `string` | language code | | `stringFile`
*optional* | `string` | path to the string file | ### Returns[​](#returns-23 "Direct link to Returns") * **\** **`appStrings`:** all defined Strings from an app for the specified language and strings filename ### Support[​](#support-41 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d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ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## setValueImmediate[​](#setvalueimmediate "Direct link to setValueImmediate") Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints). caution This protocol command is deprecated
Use `driver.addValue(...)` or `driver.setValue(...)` instead ### Usage[​](#usage-51 "Direct link to Usage") ``` await driver.setValueImmediate(elementId, text) ``` ### Parameters[​](#parameters-27 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------------------------------------------------------- | | `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) | | `text` | `string` | text to set to an element | ### Support[​](#support-42 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## replaceValue[​](#replacevalue "Direct link to replaceValue") Replace the value to element directly.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints). caution This protocol command is deprecated
Use `driver.addValue(...)` or `driver.setValue(...)` instead ### Usage[​](#usage-52 "Direct link to Usage") ``` await driver.replaceValue(elementId, value) ``` ### Parameters[​](#parameters-28 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------------------------------------------------------- | | `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) | | `value` | `string` | value to replace on element | ### Support[​](#support-43 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) *** ## getSettings[​](#getsettings "Direct link to getSettings") Retrieve the current session settings.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#getsettings). ### Usage[​](#usage-53 "Direct link to Usage") ``` await driver.getSettings() ``` ### Returns[​](#returns-24 "Direct link to Returns") * **\** **`settings`:** JSON hash of all the currently specified settings, see Settings API ### Support[​](#support-44 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## updateSettings[​](#updatesettings "Direct link to updateSettings") Update the session settings.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#updatesettings). ### Usage[​](#usage-54 "Direct link to Usage") ``` await driver.updateSettings(settings) ``` ### Parameters[​](#parameters-29 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ---------------------------------------- | | `settings` | `object` | key/value object with settings to update | ### Support[​](#support-45 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Android:** UiAutomator (4.2+) * **Windows:** Windows (10+) *** ## receiveAsyncResponse[​](#receiveasyncresponse "Direct link to receiveAsyncResponse") Callback url for asynchronous execution of JavaScript.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints). caution This protocol command is deprecated
Use `driver.executeAsyncScript(...)` instead ### Usage[​](#usage-55 "Direct link to Usage") ``` await driver.receiveAsyncResponse(response) ``` ### Parameters[​](#parameters-30 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ----------------------------- | | `response` | `object` | response to receive on device | ### Support[​](#support-46 "Direct link to Support") ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bG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1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) *** ## appiumGsmCall[​](#appiumgsmcall "Direct link to appiumGsmCall") Make GSM call (Emulator only). This is the raw Appium protocol endpoint. Prefer the `gsmCall` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/gsm-call/). caution This protocol command is deprecated
Use the `gsmCall` mobile command (`driver.gsmCall()`) instead ### Usage[​](#usage-56 "Direct link to Usage") ``` await driver.appiumGsmCall(phoneNumber, action) ``` ### Parameters[​](#parameters-31 "Direct link to Parameters") | Name | Type | Details | | ------------- | -------- | ----------------------------------------------- | | `phoneNumber` | `string` | the phone number to call to | | `action` | `string` | The action - 'call', 'accept', 'cancel', 'hold' | ### Support[​](#support-47 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGsmSignal[​](#appiumgsmsignal "Direct link to appiumGsmSignal") Set GSM signal strength (Emulator only). This is the raw Appium protocol endpoint. Prefer the `gsmSignal` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/gsm-signal/). caution This protocol command is deprecated
Use the `gsmSignal` mobile command (`driver.gsmSignal()`) instead ### Usage[​](#usage-57 "Direct link to Usage") ``` await driver.appiumGsmSignal(signalStrength, signalStrengh) ``` ### Parameters[​](#parameters-32 "Direct link to Parameters") | Name | Type | Details | | ------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `signalStrength` | `string` | signal strength in the range \[0, 4] | | `signalStrengh`
*optional* | `string` | signal strength in the range \[0, 4]. Please also set this parameter with the same value if you use Appium v1.11.0 or lower (see ). | ### Support[​](#support-48 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumPowerCapacity[​](#appiumpowercapacity "Direct link to appiumPowerCapacity") Set the battery percentage (Emulator only). This is the raw Appium protocol endpoint. Prefer the `powerCapacity` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/emulator/power_capacity/). caution This protocol command is deprecated
Use the `powerCapacity` mobile command (`driver.powerCapacity()`) instead ### Usage[​](#usage-58 "Direct link to Usage") ``` await driver.appiumPowerCapacity(percent) ``` ### Parameters[​](#parameters-33 "Direct link to Parameters") | Name | Type | Details | | --------- | -------- | ----------------------------------- | | `percent` | `number` | percentage value in range \[0, 100] | ### Support[​](#support-49 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumPowerAC[​](#appiumpowerac "Direct link to appiumPowerAC") Set the state of the battery charger to connected or not (Emulator only). This is the raw Appium protocol endpoint. Prefer the `powerAC` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/emulator/power_ac/). caution This protocol command is deprecated
Use the `powerAC` mobile command (`driver.powerAC()`) instead ### Usage[​](#usage-59 "Direct link to Usage") ``` await driver.appiumPowerAC(state) ``` ### Parameters[​](#parameters-34 "Direct link to Parameters") | Name | Type | Details | | ------- | -------- | ------------------------ | | `state` | `string` | set the state. on or off | ### Support[​](#support-50 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumGsmVoice[​](#appiumgsmvoice "Direct link to appiumGsmVoice") Set GSM voice state (Emulator only). This is the raw Appium protocol endpoint. Prefer the `gsmVoice` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/gsm-voice/). caution This protocol command is deprecated
Use the `gsmVoice` mobile command (`driver.gsmVoice()`) instead ### Usage[​](#usage-60 "Direct link to Usage") ``` await driver.appiumGsmVoice(state) ``` ### Parameters[​](#parameters-35 "Direct link to Parameters") | Name | Type | Details | | ------- | -------- | ------------------------------------------------------------------------------------------ | | `state` | `string` | state of GSM voice - 'unregistered', 'home', 'roaming', 'searching', 'denied', 'off', 'on' | ### Support[​](#support-51 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumSendSms[​](#appiumsendsms "Direct link to appiumSendSms") Simulate an SMS message (Emulator only). This is the raw Appium protocol endpoint. Prefer the `sendSms` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/network/send-sms/). caution This protocol command is deprecated
Use the `sendSms` mobile command (`driver.sendSms()`) instead ### Usage[​](#usage-61 "Direct link to Usage") ``` await driver.appiumSendSms(phoneNumber, message) ``` ### Parameters[​](#parameters-36 "Direct link to Parameters") | Name | Type | Details | | ------------- | -------- | ------------------------------------ | | `phoneNumber` | `string` | the phone number to send the SMS too | | `message` | `string` | the SMS message | ### Support[​](#support-52 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumFingerPrint[​](#appiumfingerprint "Direct link to appiumFingerPrint") Authenticate users by using their finger print scans on supported emulators. This is the raw Appium protocol endpoint. Prefer the `fingerPrint` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/authentication/finger-print/). caution This protocol command is deprecated
Use the `fingerPrint` mobile command (`driver.fingerPrint()`) instead ### Usage[​](#usage-62 "Direct link to Usage") ``` await driver.appiumFingerPrint(fingerprintId) ``` ### Parameters[​](#parameters-37 "Direct link to Parameters") | Name | Type | Details | | --------------- | -------- | -------------------------------------------------------------- | | `fingerprintId` | `number` | finger prints stored in Android Keystore system (from 1 to 10) | ### Support[​](#support-53 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## appiumSetClipboard[​](#appiumsetclipboard "Direct link to appiumSetClipboard") Set the content of the system clipboard. This is the raw Appium protocol endpoint. Prefer the `setClipboard` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/clipboard/set-clipboard/). caution This protocol command is deprecated
Use the `setClipboard` mobile command (`driver.setClipboard()`) instead ### Usage[​](#usage-63 "Direct link to Usage") ``` await driver.appiumSetClipboard(content, contentType, label) ``` ### Parameters[​](#parameters-38 "Direct link to Parameters") | Name | Type | Details | | ----------------------------- | -------- | -------------------------------------------------------------------------------------- | | `content` | `string` | The actual base64 encoded clipboard content | | `contentType`
*optional* | `string` | The type of the content to get. Plaintext, Image, URL. Android supports only plaintext | | `label`
*optional* | `string` | Clipboard data label for Android | ### Returns[​](#returns-25 "Direct link to Returns") * **\** **`response`:** Response from Appium server ### Support[​](#support-54 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+Cjxzdm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LjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## appiumGetClipboard[​](#appiumgetclipboard "Direct link to appiumGetClipboard") Get the content of the system clipboard. This is the raw Appium protocol endpoint. Prefer the `getClipboard` mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/device/clipboard/get-clipboard/). caution This protocol command is deprecated
Use the `getClipboard` mobile command (`driver.getClipboard()`) instead ### Usage[​](#usage-64 "Direct link to Usage") ``` await driver.appiumGetClipboard(contentType) ``` ### Parameters[​](#parameters-39 "Direct link to Parameters") | Name | Type | Details | | ----------------------------- | -------- | -------------------------------------------------------------------------------------- | | `contentType`
*optional* | `string` | The type of the content to get. Plaintext, Image, URL. Android supports only plaintext | ### Returns[​](#returns-26 "Direct link to Returns") * **\** **`response`:** Clipboard content as base64-encoded string or an empty string if the clipboard is empty ### Support[​](#support-55 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4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0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **iOS:** XCUITest (9.3+) * **Android:** UiAutomator (4.2+) *** ## touchPerform[​](#touchperform "Direct link to touchPerform") This functionality is only available from within a native context. 'Touch Perform' works similarly to the other singular touch interactions, except that this allows you to chain together more than one touch action as one command. This is useful because Appium commands are sent over the network and there's latency between commands. This latency can make certain touch interactions impossible because some interactions need to be performed in one sequence. Vertical, for example, requires pressing down, moving to a different y coordinate, and then releasing. For it to work, there can't be a delay between the interactions.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/interactions/touch/touch-perform/). caution This protocol command is deprecated
Use `driver.performActions(...)` instead ### Usage[​](#usage-65 "Direct link to Usage") ``` await driver.touchPerform(actions) ``` ### Parameters[​](#parameters-40 "Direct link to Parameters") | Name | Type | Details | | --------- | ---------- | ---------------------------------------------------------------------- | | `actions` | `object[]` | The type of action to perform (e.g. moveTo, release, press, tap, wait) | ### Example[​](#example "Direct link to Example") ``` // do a horizontal swipe by percentage const startPercentage = 10; const endPercentage = 90; const anchorPercentage = 50; const { width, height } = driver.getWindowSize(); const anchor = height * anchorPercentage / 100; const startPoint = width * startPercentage / 100; const endPoint = width * endPercentage / 100; driver.touchPerform([ { action: 'press', options: { x: startPoint, y: anchor, }, }, { action: 'wait', options: { ms: 100, }, }, { action: 'moveTo', options: { x: endPoint, y: anchor, }, }, { action: 'release', options: {}, }, ]); ``` ### Support[​](#support-56 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4N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ExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) ![Support for Windows (10+)](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHBhdGggZD0ibTAgMTIuNDAyIDM1LjY4Ny00Ljg2MDIuMDE1NiAzNC40MjMtMzUuNjcuMjAzMTN6bTM1LjY3IDMzLjUyOS4wMjc3IDM0LjQ1My0zNS42Ny00LjkwNDEtLjAwMi0yOS43OHptNC4zMjYxLTM5LjAyNSA0Ny4zMTgtNi45MDZ2NDEuNTI3bC00Ny4zMTguMzc1NjV6bTQ3LjMyOSAzOS4zNDktLjAxMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Windows:** Windows (10+) *** ## multiTouchPerform[​](#multitouchperform "Direct link to multiTouchPerform") This functionality is only available from within a native context. Perform a multi touch action sequence.

Appium command. More details can be found in the [official protocol docs](https://appium.github.io/appium.io/docs/en/commands/interactions/touch/multi-touch-perform/). caution This protocol command is deprecated
Use `driver.performActions(...)` instead ### Usage[​](#usage-66 "Direct link to Usage") ``` await driver.multiTouchPerform(actions) ``` ### Parameters[​](#parameters-41 "Direct link to Parameters") | Name | Type | Details | | --------- | ---------- | ---------------------------------------------------------------------- | | `actions` | `object[]` | The type of action to perform (e.g. moveTo, release, press, tap, wait) | ### Support[​](#support-57 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ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xMTEgNDEuMzQtNDcuMzE4LTYuNjc4NC0uMDY2My0zNC43Mzl6IiBmaWxsPSIjMDBhZGVmIi8+PC9zdmc+) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+), UIAutomation (8.0 to 9.3) * **Windows:** Windows (10+) *** ## executeDriverScript[​](#executedriverscript "Direct link to executeDriverScript") Execute a script in a child process. This approach helps minimize potential latency associated with each command. ***Using this command in Appium 2 or later requires installing the [`execute-driver`](https://github.com/appium/appium/tree/master/packages/execute-driver-plugin) plugin.***

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/plugins/#executedriverscript). ### Usage[​](#usage-67 "Direct link to Usage") ``` await driver.executeDriverScript(script, type, timeout) ``` ### Parameters[​](#parameters-42 "Direct link to Parameters") | Name | Type | Details | | ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `script` | `string` | The script to execute. It has access to a 'driver' object which represents a WebdriverIO session attached to the current server. | | `type`
*optional* | `string` | The language/framework used in the script. Currently, only 'webdriverio' is supported and is the default. | | `timeout`
*optional* | `number` | The number of milliseconds the script should be allowed to run before being killed by the Appium server. Defaults to the equivalent of 1 hour. | ### Returns[​](#returns-27 "Direct link to Returns") * **\** **`result`:** An object containing two fields: 'result', which is the return value of the script itself, and 'logs', which contains 3 inner fields, 'log', 'warn', and 'error', which hold an array of strings logged by console.log, console.warn, and console.error in the script's execution. *** ## getEvents[​](#getevents "Direct link to getEvents") Get events logged in the current session.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#getlogevents). ### Usage[​](#usage-68 "Direct link to Usage") ``` await driver.getEvents(type) ``` ### Parameters[​](#parameters-43 "Direct link to Parameters") | Name | Type | Details | | ---------------------- | ------------------ | ----------------------------------------------------- | | `type`
*optional* | `string, string[]` | One or more event types to filter the returned events | ### Returns[​](#returns-28 "Direct link to Returns") * **\** **`result`:** A JSON hash of events like `{'commands' => [{'cmd' => 123455, ....}], 'startTime' => 1572954894127, }`. ### Support[​](#support-58 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## logEvent[​](#logevent "Direct link to logEvent") Log a custom event.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/appium/#logcustomevent). ### Usage[​](#usage-69 "Direct link to Usage") ``` await driver.logEvent(vendor, event) ``` ### Parameters[​](#parameters-44 "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | ------------------------------------------------------- | | `vendor` | `string` | Name of the namespace (vendor) used to prefix the event | | `event` | `string` | Name of the event | ### Support[​](#support-59 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLC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zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## compareImages[​](#compareimages "Direct link to compareImages") Compare two images using the specified mode of comparison. ***Using this command in Appium 2 or later requires installing the [`images`](https://github.com/appium/appium/tree/master/packages/images-plugin) plugin.***

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/plugins/#compareimages). ### Usage[​](#usage-70 "Direct link to Usage") ``` await driver.compareImages(mode, firstImage, secondImage, options) ``` ### Parameters[​](#parameters-45 "Direct link to Parameters") | Name | Type | Details | | ----------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ | | `mode` | `string` | One of possible comparison modes: 'matchFeatures', 'getSimilarity', 'matchTemplate'. | | `firstImage` | `string` | Base64-encoded image file. | | `secondImage` | `string` | Base64-encoded image file. | | `options=[object Object]`
*optional* | `object` | The supported values of this property depend on the `mode` value. See Appium documentation for more details. | ### Returns[​](#returns-29 "Direct link to Returns") * **\** **`result`:** The content of the resulting dictionary depends on the `mode` and `options` values. See Appium documentation for more details. *** ## implicitWait[​](#implicitwait "Direct link to implicitWait") Set the amount of time the driver should wait when searching for elements. When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs first. When searching for multiple elements, the driver should poll the page until at least one element is found or the timeout expires, at which point it should return an empty list. If this command is never sent, the driver should default to an implicit wait of 0ms.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.setTimeouts(...)` instead ### Usage[​](#usage-71 "Direct link to Usage") ``` await driver.implicitWait(ms) ``` ### Parameters[​](#parameters-46 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | ----------------------------------------------------------- | | `ms` | `number` | The amount of time, in milliseconds, to wait on an element. | ### Support[​](#support-60 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## getLocationInView[​](#getlocationinview "Direct link to getLocationInView") Determine an element's location on the screen once it has been scrolled into view.

**Note:** This is considered an internal command and should only be used to determine an element's location for correctly generating native events.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.getElementRect(...)` or `element.getLocation()` instead ### Usage[​](#usage-72 "Direct link to Usage") ``` await driver.getLocationInView(elementId) ``` ### Parameters[​](#parameters-47 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ----------------------------------------- | | `elementId` | `String` | ID of the element to route the command to | ### Returns[​](#returns-30 "Direct link to Returns") * **\** **`location`:** The X and Y coordinates for the element on the page. ### Support[​](#support-61 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## sendKeys[​](#sendkeys "Direct link to sendKeys") Send a sequence of key strokes to the active element

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with `keyUp` and `keyDown` actions instead ### Usage[​](#usage-73 "Direct link to Usage") ``` await driver.sendKeys(value) ``` ### Parameters[​](#parameters-48 "Direct link to Parameters") | Name | Type | Details | | ------- | ---------- | -------------------------------------------------------- | | `value` | `string[]` | The sequence of keys to type. An array must be provided. | ### Support[​](#support-62 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## availableIMEEngines[​](#availableimeengines "Direct link to availableIMEEngines") List all available IME engines on the device. To use an engine, it has to be present in this list.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#availableimeengines). ### Usage[​](#usage-74 "Direct link to Usage") ``` await driver.availableIMEEngines() ``` ### Returns[​](#returns-31 "Direct link to Returns") * **\** **`engines`:** A list of available engines ### Support[​](#support-63 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## getActiveIMEEngine[​](#getactiveimeengine "Direct link to getActiveIMEEngine") Get the name of the active IME engine. The name string is platform specific.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#getactiveimeengine). ### Usage[​](#usage-75 "Direct link to Usage") ``` await driver.getActiveIMEEngine() ``` ### Returns[​](#returns-32 "Direct link to Returns") * **\** **`engine`:** The name of the active IME engine ### Support[​](#support-64 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## isIMEActivated[​](#isimeactivated "Direct link to isIMEActivated") Indicates whether IME input is active at the moment

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#isimeactivated). ### Usage[​](#usage-76 "Direct link to Usage") ``` await driver.isIMEActivated() ``` ### Returns[​](#returns-33 "Direct link to Returns") * **\** **`isActive`:** true if IME input is available and currently active, false otherwise ### Support[​](#support-65 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## deactivateIMEEngine[​](#deactivateimeengine "Direct link to deactivateIMEEngine") De-activates the currently-active IME engine.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#deactivateimeengine). ### Usage[​](#usage-77 "Direct link to Usage") ``` await driver.deactivateIMEEngine() ``` ### Support[​](#support-66 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## activateIMEEngine[​](#activateimeengine "Direct link to activateIMEEngine") Activates an IME engine.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#activateimeengine). ### Usage[​](#usage-78 "Direct link to Usage") ``` await driver.activateIMEEngine(engine) ``` ### Parameters[​](#parameters-49 "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | ------------------------------ | | `engine` | `string` | name of the engine to activate | ### Support[​](#support-67 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## asyncScriptTimeout[​](#asyncscripttimeout "Direct link to asyncScriptTimeout") Set the amount of time, in milliseconds, that asynchronous scripts executed by `/session/:sessionId/execute_async` are permitted to run before they are aborted and a `Timeout` error is returned to the client.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.setTimeouts(...)` instead ### Usage[​](#usage-79 "Direct link to Usage") ``` await driver.asyncScriptTimeout(ms) ``` ### Parameters[​](#parameters-50 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | ------------------------------------------------------------------------------------ | | `ms` | `number` | The amount of time, in milliseconds, that time-limited commands are permitted to run | ### Support[​](#support-68 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+) *** ## submit[​](#submit "Direct link to submit") Submit a form element.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Please explicitly find and click the submit element ### Usage[​](#usage-80 "Direct link to Usage") ``` await driver.submit(elementId) ``` ### Parameters[​](#parameters-51 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | -------------------------------------- | | `elementId` | `String` | ID of the form element to be submitted | ### Support[​](#support-69 "Direct link to Support") ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **iOS:** XCUITest (9.3+) *** ## getElementSize[​](#getelementsize "Direct link to getElementSize") Determine an element's size in pixels. The size will be returned as a JSON object with `width` and `height` properties.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.getElementRect(...)` or `element.getSize()` instead ### Usage[​](#usage-81 "Direct link to Usage") ``` await driver.getElementSize(elementId) ``` ### Parameters[​](#parameters-52 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ----------------------------------------- | | `elementId` | `String` | ID of the element to route the command to | ### Returns[​](#returns-34 "Direct link to Returns") * **\** **`size`:** The width and height of the element, in pixels. ### Support[​](#support-70 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl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gzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## getElementLocation[​](#getelementlocation "Direct link to getElementLocation") Determine an element's location on the page. The point `(0, 0)` refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with `x` and `y` properties.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.getElementRect(...)` or `element.getLocation()` instead ### Usage[​](#usage-82 "Direct link to Usage") ``` await driver.getElementLocation(elementId) ``` ### Parameters[​](#parameters-53 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ----------------------------------------- | | `elementId` | `String` | ID of the element to route the command to | ### Returns[​](#returns-35 "Direct link to Returns") * **\** **`location`:** The X and Y coordinates for the element on the page. ### Support[​](#support-71 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cm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wxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## touchClick[​](#touchclick "Direct link to touchClick") Single tap on the touch enabled device.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with `pointerDown` and `pointerUp` actions instead ### Usage[​](#usage-83 "Direct link to Usage") ``` await driver.touchClick(element) ``` ### Parameters[​](#parameters-54 "Direct link to Parameters") | Name | Type | Details | | --------- | -------- | ----------------------------------- | | `element` | `string` | ID of the element to single tap on. | ### Support[​](#support-72 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoa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guNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## touchDown[​](#touchdown "Direct link to touchDown") Finger down on the screen.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with a `pointerDown` action instead ### Usage[​](#usage-84 "Direct link to Usage") ``` await driver.touchDown(x, y) ``` ### Parameters[​](#parameters-55 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | -------------------------- | | `x` | `number` | x coordinate on the screen | | `y` | `number` | y coordinate on the screen | ### Support[​](#support-73 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## touchUp[​](#touchup "Direct link to touchUp") Finger up on the screen.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with a `pointerUp` action instead ### Usage[​](#usage-85 "Direct link to Usage") ``` await driver.touchUp(x, y) ``` ### Parameters[​](#parameters-56 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | -------------------------- | | `x` | `number` | x coordinate on the screen | | `y` | `number` | y coordinate on the screen | ### Support[​](#support-74 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## touchMove[​](#touchmove "Direct link to touchMove") Finger move on the screen.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with a `pointerMove` action instead ### Usage[​](#usage-86 "Direct link to Usage") ``` await driver.touchMove(x, y) ``` ### Parameters[​](#parameters-57 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | -------------------------- | | `x` | `number` | x coordinate on the screen | | `y` | `number` | y coordinate on the screen | ### Support[​](#support-75 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## touchLongClick[​](#touchlongclick "Direct link to touchLongClick") Long press on the touch screen using finger motion events.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with `pointerDown`, `pause` and `pointerUp` actions instead ### Usage[​](#usage-87 "Direct link to Usage") ``` await driver.touchLongClick(element) ``` ### Parameters[​](#parameters-58 "Direct link to Parameters") | Name | Type | Details | | --------- | -------- | ---------------------------------- | | `element` | `string` | ID of the element to long press on | ### Support[​](#support-76 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## touchFlick[​](#touchflick "Direct link to touchFlick") Flick on the touch screen using finger motion events. This flick command starts at a particular screen location.

Appium command. More details can be found in the [official protocol docs](https://github.com/appium/appium/blob/master/packages/base-driver/docs/mjsonwp/protocol-methods.md#webdriver-endpoints). caution This protocol command is deprecated
Use `driver.performActions(...)` with `pointerDown`, `pointerMove` and `pointerUp` actions instead ### Usage[​](#usage-88 "Direct link to Usage") ``` await driver.touchFlick(xoffset, yoffset, element, speed, xspeed, yspeed) ``` ### Parameters[​](#parameters-59 "Direct link to Parameters") | Name | Type | Details | | ------------------------- | -------- | ---------------------------------------- | | `xoffset`
*optional* | `number` | the x offset in pixels to flick by | | `yoffset`
*optional* | `number` | the y offset in pixels to flick by | | `element`
*optional* | `string` | ID of the element where the flick starts | | `speed`
*optional* | `number` | the speed in pixels per seconds | | `xspeed`
*optional* | `number` | the x speed in pixels per second | | `yspeed`
*optional* | `number` | the y speed in pixels per second | ### Support[​](#support-77 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) * **Android:** UiAutomator (4.2+) *** ## getOrientation[​](#getorientation "Direct link to getOrientation") Get the current device orientation.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#getorientation). ### Usage[​](#usage-89 "Direct link to Usage") ``` await driver.getOrientation() ``` ### Returns[​](#returns-36 "Direct link to Returns") * **\** **`orientation`:** The current orientation corresponding to a value defined in ScreenOrientation: `LANDSCAPE|PORTRAIT`. ### Support[​](#support-78 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PS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set the device orientation

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#setorientation). ### Usage[​](#usage-90 "Direct link to Usage") ``` await driver.setOrientation(orientation) ``` ### Parameters[​](#parameters-60 "Direct link to Parameters") | Name | Type | Details | | ------------- | -------- | ---------------------------------------------------------------------------------- | | `orientation` | `string` | the new browser orientation as defined in ScreenOrientation: `LANDSCAPE\|PORTRAIT` | ### Support[​](#support-79 "Direct link to Support") ![Support for UiAutomator (4.2+)](/assets/images/android-d941e94d5839760141de31c8446b67ce.svg) ![Support for XCUITest (9.3+)](data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgd2lkdGg9IjQ5Ni4yNTVweCIgaGVpZ2h0PSI2MDguNzI4cHgiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ5Ni4yNTUgNjA4LjcyODsiCgkgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIHN0eWxlPSJmaWxsOiM5OTk5OTk7IiBkPSJNMjczLjgxLDUyLjk3M0MzMTMuODA2LDAuMjU3LDM2OS40MSwwLDM2OS40MSwwczguMjcxLDQ5LjU2Mi0zMS40NjMsOTcuMzA2CgljLTQyLjQyNiw1MC45OC05MC42NDksNDIuNjM4LTkwLjY0OSw0Mi42MzhTMjM4LjI0Myw5OS44NSwyNzMuODEsNTIuOTczeiIvPgo8cGF0aCBzdHlsZT0iZmlsbDojOTk5OTk5OyIgZD0iTTI1Mi4zODUsMTc0LjY2MmMyMC41NzYsMCw1OC43NjQtMjguMjg0LDEwOC40NzEtMjguMjg0Yzg1LjU2MiwwLDExOS4yMjIsNjAuODgzLDExOS4yMjIsNjAuODgzCglzLTY1LjgzMywzMy42NTktNjUuODMzLDExNS4zMzFjMCw5Mi4xMzMsODIuMDEsMTIzLjg4NSw4Mi4wMSwxMjMuODg1cy01Ny4zMjgsMTYxLjM1Ny0xMzQuNzYyLDE2MS4zNTcKCWMtMzUuNTY1LDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2N2MtMzguMTg4LDAtNzYuMDg0LDI0Ljg2MS0xMDAuNzY2LDI0Ljg2MUM4OS4zMyw2MDguNzMsMCw0NTUuNjY2LDAsMzMyLjYyOAoJYzAtMTIxLjA1Miw3NS42MTItMTg0LjU1NCwxNDYuNTMzLTE4NC41NTRDMTkyLjYzOCwxNDguMDc0LDIyOC40MTYsMTc0LjY2MiwyNTIuMzg1LDE3NC42NjJ6Ii8+Cjwvc3ZnPgo=) * **Android:** UiAutomator (4.2+) * **iOS:** XCUITest (9.3+) *** ## getGeoLocation[​](#getgeolocation "Direct link to getGeoLocation") Get the current geo location.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#getgeolocation). ### Usage[​](#usage-91 "Direct link to Usage") ``` await driver.getGeoLocation() ``` ### Returns[​](#returns-37 "Direct link to Returns") * **\** **`location`:** The current geo location. *** ## setGeoLocation[​](#setgeolocation "Direct link to setGeoLocation") Set the current geo location.

Appium command. More details can be found in the [official protocol docs](https://appium.io/docs/en/latest/reference/api/jsonwp/#setgeolocation). ### Usage[​](#usage-92 "Direct link to Usage") ``` await driver.setGeoLocation(location) ``` ### Parameters[​](#parameters-61 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ---------------------------------------------------------------------------- | | `location` | `object` | the new location (`{latitude: number, longitude: number, altitude: number}`) | --- # The Browser Object **Extends:** [EventEmitter](https://nodejs.org/api/events.html#class-eventemitter) The browser object is the session instance you use to control the browser or mobile device with. If you use the WDIO test runner, you can access the WebDriver instance through the global `browser` or `driver` object or import it using [`@wdio/globals`](/docs/api/globals.md). If you use WebdriverIO in standalone mode the browser object is returned by the [`remote`](/docs/api/modules.md#remoteoptions-modifier) method. The session is initialized by the test runner. The same goes for ending the session. This is also done by the test runner process. ## Properties[​](#properties "Direct link to Properties") A browser object has the following properties: | Name | Type | Details | | ----------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `capabilities` | `Object` | Assigned capabilities from the remote server.
**Example:**``` { acceptInsecureCerts: false, browserName: 'chrome', browserVersion: '105.0.5195.125', chrome: { chromedriverVersion: '105.0.5195.52', userDataDir: '/var/folders/3_/pzc_f56j15vbd9z3r0j050sh0000gn/T/.com.google.Chrome.76HD3S' }, 'goog:chromeOptions': { debuggerAddress: 'localhost:64679' }, networkConnectionEnabled: false, pageLoadStrategy: 'normal', platformName: 'mac os x', proxy: {}, setWindowRect: true, strictFileInteractability: false, timeouts: { implicit: 0, pageLoad: 300000, script: 30000 }, unhandledPromptBehavior: 'dismiss and notify', 'webauthn:extension:credBlob': true, 'webauthn:extension:largeBlob': true, 'webauthn:virtualAuthenticators': true } ``` | | `requestedCapabilities` | `Object` | Capabilities requested from the remote server.
**Example:**``` { browserName: 'chrome' } ``` | | `sessionId` | `String` | Session id assigned from the remote server. | | `options` | `Object` | WebdriverIO [options](/docs/configuration.md) depending on how the browser object was created. See more [setup types](/docs/setuptypes.md). | | `commandList` | `String[]` | A list of commands registered to the browser instance | | `isW3C` | `Boolean` | Indicates if this is a W3C session | | `isChrome` | `Boolean` | Indicates if this Chrome instance | | `isFirefox` | `Boolean` | Indicates if this Firefox instance | | `isBidi` | `Boolean` | Indicates if this session uses Bidi | | `isSauce` | `Boolean` | Indicates if this session is Running on Sauce Labs | | `isMacApp` | `Boolean` | Indicates if this session is Running for a native Mac App | | `isWindowsApp` | `Boolean` | Indicates if this session is Running for a native Windows App | | `isMobile` | `Boolean` | Indicates a mobile session. See more under [Mobile Flags](#mobile-flags). | | `isIOS` | `Boolean` | Indicates an iOS session. See more under [Mobile Flags](#mobile-flags). | | `isAndroid` | `Boolean` | Indicates an Android session. See more under [Mobile Flags](#mobile-flags). | | `isNativeContext` | `Boolean` | Indicates if the mobile is in the `NATIVE_APP` context. See more under [Mobile Flags](#mobile-flags). | | `mobileContext` | `string` | The will provide the **current** context the driver is in, for example `NATIVE_APP`, `WEBVIEW_` for Android or `WEBVIEW_` for iOS. It will save an extra WebDriver to `driver.getContext()`. See more under [Mobile Flags](#mobile-flags). | ## Methods[​](#methods "Direct link to Methods") Based on the automation backend used for your session, WebdriverIO identifies which [Protocol Commands](/docs/api/protocols.md) will be attached to the [browser object](/docs/api/browser.md). For example if you run an automated session in Chrome, you will have access to Chromium specific commands like [`elementHover`](/docs/api/chromium.md#elementhover) but not any of the [Appium commands](/docs/api/appium.md). Furthermore WebdriverIO provides a set of convenient methods that are recommended to use, to interact with the [browser](/docs/api/browser.md) or [elements](/docs/api/element.md) on the page. In addition to that the following commands are available: | Name | Parameters | Details | | -------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addCommand` | - `commandName` (Type: `String`)
- `fn` (Type: `Function`)
- `attachToElement` (Type: `boolean`) | Allows to define custom commands that can be called from the browser object for composition purposes. Read more in the [Custom Command](/docs/customcommands.md) guide. | | `overwriteCommand` | - `commandName` (Type: `String`)
- `fn` (Type: `Function`)
- `attachToElement` (Type: `boolean`) | Allows to overwrite any browser command with custom functionality. Use carefully as it can confuse framework users. Read more in the [Custom Command](/docs/customcommands.md#overwriting-native-commands) guide. | | `addLocatorStrategy` | - `strategyName` (Type: `String`)
- `fn` (Type: `Function`) | Allows to define a custom selector strategy, read more in the [Selectors](/docs/selectors.md#custom-selector-strategies) guide. | ## Remarks[​](#remarks "Direct link to Remarks") ### Mobile Flags[​](#mobile-flags "Direct link to Mobile Flags") If you need to modify your test based on whether or not your session runs on a mobile device, you can access the mobile flags to check. For example, given this config: ``` // wdio.conf.js export const config = { // ... capabilities: \\{ platformName: 'iOS', app: 'net.company.SafariLauncher', udid: '123123123123abc', deviceName: 'iPhone', // ... } // ... } ``` You can access these flags in your test like so: ``` // Note: `driver` is the equivalent to the `browser` object but semantically more correct // you can choose which global variable you want to use console.log(driver.isMobile) // outputs: true console.log(driver.isIOS) // outputs: true console.log(driver.isAndroid) // outputs: false ``` This can be useful if, for example, you want to define selectors in your [page objects](/docs/pageobjects.md) based on the device type, like this: ``` // mypageobject.page.js import Page from './page' class LoginPage extends Page { // ... get username() { const selectorAndroid = 'new UiSelector().text("Cancel").className("android.widget.Button")' const selectorIOS = 'UIATarget.localTarget().frontMostApp().mainWindow().buttons()[0]' const selectorType = driver.isAndroid ? 'android' : 'ios' const selector = driver.isAndroid ? selectorAndroid : selectorIOS return $(`${selectorType}=${selector}`) } // ... } ``` You can also use these flags to run only certain tests for certain device types: ``` // mytest.e2e.js describe('my test', () => { // ... // only run test with Android devices if (driver.isAndroid) { it('tests something only for Android', () => { // ... }) } // ... }) ``` ### Events[​](#events "Direct link to Events") The browser object is an EventEmitter and a couple of events are emitted for your use cases. Here is a list of events. Keep in mind that this is not the full list of available events yet. Feel free to contribute to update the document by adding descriptions of more events here. #### `command`[​](#command "Direct link to command") This event is emitted whenever WebdriverIO sends a WebDriver Classic command. It contains the following information: * `command`: the command name, e.g. `navigateTo` * `method`: the HTTP method used to send the command request, e.g. `POST` * `endpoint`: the command endpoint, e.g. `/session/fc8dbda381a8bea36a225bd5fd0c069b/url` * `body`: the command payload, e.g. `{ url: 'https://webdriver.io' }` #### `result`[​](#result "Direct link to result") This event is emitted whenever WebdriverIO receives a result of a WebDriver Classic command. It contains the same information as the `command` event with the addition of the following information: * `result`: the command result #### `bidiCommand`[​](#bidicommand "Direct link to bidicommand") This event is emitted whenever WebdriverIO sends a WebDriver Bidi command to the browser driver. It contains information about: * `method`: WebDriver Bidi command method * `params`: associated command parameter (see [API](/docs/api/webdriverBidi.md)) #### `bidiResult`[​](#bidiresult "Direct link to bidiresult") In case of a successful command execution, the event payload will be: * `type`: `success` * `id`: the command id * `result`: the command result (see [API](/docs/api/webdriverBidi.md)) In case of a command error, the event payload will be: * `type`: `error` * `id`: the command id * `error`: the error code, e.g. `invalid argument` * `message`: details about the error * `stacktrace`: a stack trace #### `request.start`[​](#requeststart "Direct link to requeststart") This event is fired before a WebDriver request is sent to the driver. It contains information about the request and its payload. ``` browser.on('request.start', (ev: RequestInit) => { // ... }) ``` #### `request.end`[​](#requestend "Direct link to requestend") This event is fired once the request to the driver received a response. The event object either contains the response body as result or an error if the WebDriver command failed. ``` browser.on('request.end', (ev: { result: unknown, error?: Error }) => { // ... }) ``` #### `request.retry`[​](#requestretry "Direct link to requestretry") The retry event can notify you when WebdriverIO attempts to retry running the command, e.g. due to a network issue. It contains information about the error that caused the retry and the amount of retries already done. ``` browser.on('request.retry', (ev: { error: Error, retryCount: number }) => { // ... }) ``` #### `request.performance`[​](#requestperformance "Direct link to requestperformance") This is an event to measure WebDriver level operations. Whenever WebdriverIO sends a request to the WebDriver backend, this event will be emitted with some useful information: * `durationMillisecond`: Time duration of the request in millisecond. * `error`: Error object if the request failed. * `request`: Request object. You can find url, method, headers, etc. * `retryCount`: If it's `0`, the request was the first attempt. It will increase when WebDriverIO retries under the hood. * `success`: Boolean to represent the request was succeeded or not. If it's `false`, `error` property will be provided as well. An example event: ``` Object { "durationMillisecond": 0.01770925521850586, "error": [Error: Timeout], "request": Object { ... }, "retryCount": 0, "success": false, }, ``` ### Custom Commands[​](#custom-commands "Direct link to Custom Commands") You can set custom commands on the browser scope to abstract away workflows that are commonly used. Check out our guide on [Custom Commands](/docs/customcommands.md#adding-custom-commands) for more information. --- # $ The `$` command is a short and handy way in order to fetch a single element on the page. You can also pass in an object as selector where the object contains a property `element-6066-11e4-a52e-4f735466cecf` with the value of a reference to an element. The command will then transform the reference to an extended WebdriverIO element. Note: chaining `$` and `$$` commands only make sense when you use multiple selector strategies. You will otherwise make unnecessary requests that slow down the test (e.g. `$('body').$('div')` will trigger two request whereas `$('body div')` does literally the same with just one request) **Note:** only use these element objects if you are certain they still exist on the page, e.g. using the `isExisting` command. WebdriverIO is unable to refetch them given that there are no selector information available. Using the wdio testrunner this command is a global variable, see [Globals](https://webdriver.io/docs/api/globals) for more information. Using WebdriverIO within a [standalone](https://webdriver.io/docs/setuptypes#standalone-mode) script it will be located on the browser object instead (e.g. `browser.$$`). You can chain `$` or `$$` together without wrapping individual commands into `await` in order to walk down the DOM tree, e.g.: ``` const imageSrc = await $$('div')[1].nextElement().$$('img')[2].getAttribute('src') ``` info For more information on how to select specific elements, check out the [Selectors](/docs/selectors.md) guide. ## Usage[​](#usage "Direct link to Usage") ``` await browser.$(selector) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | --------------------------- | ------------------------------------------------------------------- | | `selector` | `String, Function, Matcher` | selector, JS Function, or Matcher object to fetch a certain element | ## Examples[​](#examples "Direct link to Examples") example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46) $.js ``` it('should use Androids DataMatcher or ViewMatcher selector', async () => { const menuItem = await $({ "name": "hasEntry", "args": ["title", "ViewTitle"], "class": "androidx.test.espresso.matcher.ViewMatchers" }); await menuItem.click(); const menuItem = await $({ "name": "hasEntry", "args": ["title", "ViewTitle"] }); await menuItem.click(); }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # $$ The `$$` command is a short and handy way in order to fetch multiple elements on the page. It returns a `ChainablePromiseArray` containing a set of WebdriverIO elements. Using the wdio testrunner this command is a global variable, see [Globals](https://webdriver.io/docs/api/globals) for more information. Using WebdriverIO within a [standalone](https://webdriver.io/docs/setuptypes#standalone-mode) script it will be located on the browser object instead (e.g. `browser.$$`). You can chain `$` or `$$` together without wrapping individual commands into `await` in order to walk down the DOM tree, e.g.: ``` const imageSrc = await $$('div')[1].nextElement().$$('img')[2].getAttribute('src') ``` It is also possible to use async iterators to loop over the result of the query, e.g.: ``` // print all image sources for await (const img of $$('img')) { console.log(await img.getAttribute('src')) } ``` ### Iterating over elements[​](#iterating-over-elements "Direct link to Iterating over elements") The result of `$$` also provides asynchronous versions of the `Array` iteration methods `forEach`, `map`, `find`, `findIndex`, `some`, `every`, `filter` and `reduce`. They accept `async` callbacks and can be called on `$$` directly: ``` const texts = await $$('h3').map((h3) => h3.getText()) ``` Every method except `reduce` also has a `*Series` variant (`forEachSeries`, `mapSeries`, and so on). The base method runs all callbacks **concurrently**, while the `*Series` variant runs **one callback at a time**, in list order. `reduce` always runs one callback at a time. Use a `*Series` variant when the order of your interactions with the page matters. The concurrent `find` and `findIndex` resolve with the first match to finish, which is not necessarily the earliest match in the list, and the concurrent `find`, `findIndex`, `some` and `every` keep running the remaining callbacks after the result is known. Use the `*Series` variant to get the earliest match and stop there. info For more information on how to select specific elements, check out the [Selectors](/docs/selectors.md) guide. ## Usage[​](#usage "Direct link to Usage") ``` await browser.$$(selector) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | ------------------ | -------------------------------------------------- | | `selector` | `String, Function` | selector or JS Function to fetch multiple elements | ## Examples[​](#examples "Direct link to Examples") example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39) ## Returns[​](#returns "Direct link to Returns") * **\** --- # action The action command is a low-level interface for providing virtualized device input actions to the web browser. For simple key presses, use [`browser.keys()`](https://webdriver.io/docs/api/browser/keys) instead. To perform multiple action chains at once, such as holding `Control` while clicking, use [`browser.actions()`](https://webdriver.io/docs/api/browser/actions). In addition to high level commands such like `scrollIntoView`, `doubleClick`, the Actions API provides granular control over exactly what designated input devices can do. WebdriverIO provides an interface for 3 kinds of input sources: * a key input for keyboard devices * a pointer input for a mouse, pen or touch devices * and wheel inputs for scroll wheel devices Every chain of action commands has to be completed calling `perform` in order to trigger the set of actions. This causes actions [to be released](https://w3c.github.io/webdriver/#release-actions) and events to be fired. You can skip this by passing in `true` (e.g. `browser.actions(...).perform(true)`). info Support for this command and specific actions can differ based on the environment. Progress on the development can be followed on [wpt.fyi](https://wpt.fyi/results/webdriver/tests/perform_actions?label=experimental\&label=master\&aligned). For mobile you might want to use Appium specific gesture commands on [iOS](https://appium.github.io/appium-xcuitest-driver/latest/guides/gestures/) and [Android](https://github.com/appium/appium-uiautomator2-driver#mobile-gesture-commands). ### Key input source[​](#key-input-source "Direct link to Key input source") A key input source is an input source that is associated with a keyboard-type device. It can be triggered by using the `key` type parameters. e.g.: ``` browser.action('key') ``` It returns a `KeyAction` object that supports the following actions: * `down(value: string)`: generates a key down action * `up(value: string)`: generates a key up action * `pause(ms: number)`: indicate that an input source does nothing during a particular tick #### Special Characters[​](#special-characters "Direct link to Special Characters") If you like to use special characters like e.g. `Control`, `Page Up` or `Shift`, make sure to import the [`Key`](/docs/api/modules.md#key) object from the `webdriverio` package like so: ``` import { Key } from 'webdriverio' ``` The `Key` object provides constants for all special keys including `Key.Ctrl` (cross-platform), `Key.Enter`, `Key.Tab`, `Key.ArrowLeft`, arrow keys, function keys, and more. See the [Key API docs](/docs/api/modules.md#key) for a complete list. ### Pointer input source[​](#pointer-input-source "Direct link to Pointer input source") A pointer input source is an input source that is associated with a pointer-type input device. The type can be specified when invoking the `action` command, e.g.: ``` browser.action('pointer', { parameters: { pointerType: 'mouse' } // "mouse" is default value, also possible: "pen" or "touch" }) ``` It returns a `PointerAction` object that supports the following actions: * `down (button: 'left' | 'middle' | 'right')`: creates an action to press a single key * `down (params: PointerActionParams)`: creates an action to press a single key with detailed parameters * `move (x: number, y: number)`: Creates an action for moving the pointer `x` and `y` pixels from the viewport * `move (params: PointerActionMoveParams)`: Creates an action for moving the pointer `x` and `y` pixels from the specified `origin`. The `origin` may be defined as the pointers current position (e.g. "pointer"), the viewport (e.g. "viewport") or the center of a specific element. * `up (button: 'left' | 'middle' | 'right')`: creates an action to release a single key * `up (params: PointerActionUpParams)`: creates an action to release a single key with detailed parameters * `cancel()`: An action that cancels this pointer's current input. * `pause(ms: number)`: indicate that an input source does nothing during a particular tick You can find detailed information on the [`PointerActionParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L20-L35), [`PointerActionMoveParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L20-L42) and [`PointerActionUpParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L13-L19) parameter types in the project type definition. ### Wheel input source[​](#wheel-input-source "Direct link to Wheel input source") A wheel input source is an input source that is associated with a wheel-type input device. ``` browser.action('wheel') ``` It returns a `WheelAction` object that supports the following actions: * `scroll (params: ScrollParams)`: scrolls a page to given coordinates or origin * `pause(ms: number)`: indicate that an input source does nothing during a particular tick You can find detailed information on the [`ScrollParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/wheel.ts#L4-L29) parameter type in the project type definition. ## Usage[​](#usage "Direct link to Usage") ``` browser.action() ``` ## Examples[​](#examples "Direct link to Examples") pointer-action.js ``` it('drag and drop using pointer action command', async () => { const origin = await $('#source') const targetOrigin = await $('#target') return browser.action('pointer') .move({ duration: 0, origin, x: 0, y: 0 }) .down({ button: 0 }) // left button .pause(10) .move({ duration: 0, origin: targetOrigin }) .up({ button: 0 }) .perform() }); ``` key-action.js ``` import { Key } from 'webdriverio' it('should emit key events using key action commands', async () => { const elem = await $('input') await elem.click() // make element active await browser.action('key') .down('f') .down('o') .down('o') .up('f') .up('o') .up('o') .perform() console.log(await elem.getValue()) // returns "foo" // copy value out of input element await browser.action('key') .down(Key.Ctrl).down('c') .pause(10) .up(Key.Ctrl).up('c') .perform() }) ``` wheel-action.js ``` it('should scroll using wheel action commands', async () => { console.log(await browser.execute(() => window.scrollY)) // returns 0 await browser.action('wheel').scroll({ deltaX: 0, deltaY: 500, duration: 200 }).perform() console.log(await browser.execute(() => window.scrollY)) // returns 500 }) ``` --- # actions Allows to run multiple action interactions at once, e.g. to simulate a pinch zoom or hold a modifier key while clicking. Build each action chain with [`browser.action()`](/docs/api/browser/action.md), then pass the chains to this command. ## Usage[​](#usage "Direct link to Usage") ``` await browser.actions() ``` ## Example[​](#example "Direct link to Example") action.js ``` it('run multiple actions at once for a pinch zoom', async () => { await browser.actions([ browser.action('pointer') .move(500, 500) .down() .move(250, 250) .up(), browser.action('pointer') .move(500, 500) .down() .move(750, 750) .up() ]) }); ``` --- # addCommand The browser method `addCommand` helps you to write your own set of commands. info You can find more information on adding custom commands in the [custom command](/docs/customcommands.md#adding-custom-commands) guide. ## Usage[​](#usage "Direct link to Usage") ``` browser.addCommand(name, callback, { attachToElement, disableElementImplicitWait }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------- | | `name` | `string` | name of the custom command | | `callback` | `Function` | function to be called | | `options`
*optional* | `Boolean, Object` | **DEPRECATED when Boolean (elementScope)**. Options object with the following properties: | | `options.attachToElement`
*optional* | `Boolean` | extend the Element object instead of the Browser object | | `options.disableElementImplicitWait`
*optional* | `Boolean` | disable implicit wait for element commands | ## Example[​](#example "Direct link to Example") execute.js ``` // Basic usage with browser scope await browser.addCommand('getUrlAndTitle', async function (customParam) { // `this` refers to the `browser` scope return { url: await this.getUrl(), title: await this.getTitle(), customParam: customParam } }) // Element scope using options object (RECOMMENDED) await browser.addCommand('waitAndClick', async function () { // `this` refers to the `element` scope await this.waitForClickable() await this.click() }, { attachToElement: true }) // Advanced usage with options await browser.addCommand('fastClick', async function () { // `this` refers to the `element` scope await this.click() }, { attachToElement: true, disableElementImplicitWait: true // Skip implicit wait for faster execution }) //usage it('should use my add command', async () => { await browser.url('https://webdriver.io') const result = await browser.getUrlAndTitle('foobar') assert.strictEqual(result.url, 'https://webdriver.io') assert.strictEqual(result.title, 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO') assert.strictEqual(result.customParam, 'foobar') // Using element commands const element = await $('button') await element.waitAndClick() await element.fastClick() }) ``` --- # addInitScript Adds a script which would be evaluated in one of the following scenarios: * Whenever the page is navigated. * Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the newly attached frame. The script is evaluated after the document was created but before any of its scripts were run. In order to remove the initialization script from the page again, call the function that got returned by this function. This is useful to amend the JavaScript environment, e.g. to seed Math.random. ## Usage[​](#usage "Direct link to Usage") ``` await browser.addInitScript(script, args) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------- | ------------------------- | ------------------------------------------------ | | `script` | `Function` | function to be injected as initialization script | | `args` | `number, string, boolean` | parameters for the script | ## Examples[​](#examples "Direct link to Examples") addInitScript.js ``` const script = await browser.addInitScript((seed) => { Math.random = () => seed }, 42) await browser.url('https://webdriver.io') console.log(await browser.execute(() => Math.random())) // returns 42 await reset() await browser.url('https://webdriver.io') console.log(await browser.execute(() => Math.random())) // returns a random number hermore you can also use the `emit` function to send data back to the Node.js environment. is useful if you want to observe certain events in the browser environment, e.g.: ``` addInitScriptWithEmit.js ``` const script = await browser.addInitScript((emit) => { const observer = new MutationObserver((mutations) => { for (const mutation of mutations) { emit(mutation.target.nodeName) } }) observer.observe(document, { childList: true, subtree: true }) }) script.on('data', (data) => { console.log(data) // prints: BODY, DIV, P, ... }) ``` --- # call You can use `call` to execute any async action within your test spec. It accepts promises and stops the execution until the promise has been resolved. info With WebdriverIO deprecating synchronous usage (see [RFC](https://github.com/webdriverio/webdriverio/discussions/6702)) this command is not very useful anymore. ## Usage[​](#usage "Direct link to Usage") ``` await browser.call(callback) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | ---------- | --------------------- | | `callback` | `Function` | function to be called | ## Example[​](#example "Direct link to Example") call.js ``` it('some testing here', async () => { await browser.url('http://google.com') // make an asynchronous call using any 3rd party library supporting promises // e.g. call to backend or db to inject fixture data await browser.call(() => { return somePromiseLibrary.someMethod().then(() => { // ... }) }) // example for async call to 3rd party library that doesn't support promises const result = await browser.call(() => { return new Promise((resolve, reject) => { someOtherNodeLibrary.someMethod(param1, (err, res) => { if (err) { return reject(err) } resolve(res) }) }) }) }); ``` --- # custom$ The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`. Read more on custom selector stratgies in the [Selector docs](/docs/selectors.md#custom-selector-strategies). ## Usage[​](#usage "Direct link to Usage") ``` await browser.custom$(strategyName, strategyArguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------- | -------- | ------- | | `strategyName` | `string` | | | `strategyArguments` | `*` | | ## Examples[​](#examples "Direct link to Examples") customStrategy.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L2-L11) example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/example.html#L8-L12) customStrategy.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L16-L19) example.js ``` it('should fetch the project title', async () => { await browser.url('https://webdriver.io') browser.addLocatorStrategy('myStrat', (selector) => { return document.querySelectorAll(selector) }) const projectTitle = await browser.custom$('myStrat', '.projectTitle') console.log(await projectTitle.getText()) // WEBDRIVER I/O }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # custom$$ The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`. Read more on custom selector strategies in the [Selector docs](/docs/selectors.md#custom-selector-strategies). ## Usage[​](#usage "Direct link to Usage") ``` await browser.custom$$(strategyName, strategyArguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------- | -------- | ------- | | `strategyName` | `string` | | | `strategyArguments` | `*` | | ## Example[​](#example "Direct link to Example") example.js ``` it('should get all the plugin wrapper buttons', async () => { await browser.url('https://webdriver.io') await browser.addLocatorStrategy('myStrategy', (selector) => { return document.querySelectorAll(selector) }) const pluginWrapper = await browser.custom$$('myStrategy', '.pluginWrapper') console.log(await pluginWrapper.length) // 4 }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # debug This command helps you to debug your integration tests. It stops the running browser and gives you time to jump into it and check the state of your application (e.g. using dev tools). Your terminal transforms into a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) interface that will allow you to try out certain commands, find elements and test actions on them. [![WebdriverIO REPL](https://webdriver.io/img/repl.gif)](https://webdriver.io/img/repl.gif) If you run the WDIO testrunner make sure you increase the timeout property of the test framework you are using (e.g. Mocha or Jasmine) in order to prevent test termination due to a test timeout. Also avoid executing the command with multiple capabilities running at the same time. ## Usage[​](#usage "Direct link to Usage") ``` await browser.debug() ``` ## Example[​](#example "Direct link to Example") debug.js ``` it('should demonstrate the debug command', async () => { await $('#input').setValue('FOO') await browser.debug() // jumping into the browser and change value of #input to 'BAR' const value = await $('#input').getValue() console.log(value) // outputs: "BAR" }) ``` --- # deleteCookies Delete cookies visible to the current page. By providing a cookie name it just removes the single cookie or more when multiple names are passed. ## Usage[​](#usage "Direct link to Usage") ``` await browser.deleteCookies(filter) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------- | ----------------------- | ------------------------------------------------------------------------------------------- | | `filter` | `StorageCookieFilter[]` | Use the filter property to identify and delete specific cookies based on matching criteria. | ## Examples[​](#examples "Direct link to Examples") example.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/deleteCookies/example.js#L9-L29) example.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/deleteCookies/example.js#L31-L35) --- # downloadFile Download a file from the remote computer running Selenium node to local file system by using the [`downloadFile`](https://webdriver.io/docs/api/selenium#downloadFile) command. info Note that this command is only supported if you use a [Selenium Grid](https://www.selenium.dev/documentation/en/grid/) with Chrome, Edge or Firefox and have the `se:downloadsEnabled` flag set in the capabilities. ## Usage[​](#usage "Direct link to Usage") ``` await browser.downloadFile(fileName, targetDirectory) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ----------------- | -------- | --------------------------------- | | `fileName` | `string` | remote path to file | | `targetDirectory` | `string` | target location on local computer | --- # emulate WebdriverIO allows you to emulate Web APIs using the `emulate` command. These Web APIs can then behave exactly as you specify it. The following scopes are supported: * `geolocation`: Emulate the geolocation API * `userAgent`: Emulate the user agent * `colorScheme`: Emulate the color scheme * `onLine`: Emulate the online status * `device`: Emulate a specific mobile or desktop device * `clock`: Emulate the system clock The `emulate` command returns a function that can be called to reset the emulation. This is useful when you want to reset the emulation after a test or a suite of tests. Read more on this in the [Emulation](/docs/emulation.md) guidelines. info Except for the `clock` scope it is not possible to change the emulated value without reloading the page. info This feature requires WebDriver Bidi support for the browser. While recent versions of Chrome, Edge and Firefox have such support, Safari **does not**. For updates follow [wpt.fyi](https://wpt.fyi/results/webdriver/tests/bidi/script/add_preload_script/add_preload_script.py?label=experimental\&label=master\&aligned). Furthermore if you use a cloud vendor for spawning browsers, make sure your vendor also supports WebDriver Bidi. The `EmulationOptions` object can have the following properties based on the scope: | Scope | Options | | ------------- | ----------------------------------------- | | `geolocation` | `{ latitude: number, longitude: number }` | | `userAgent` | `string` | | `colorScheme` | `'light' \| 'dark'` | | `onLine` | `boolean` | | `clock` | `FakeTimerInstallOpts` | ## Usage[​](#usage "Direct link to Usage") ``` await browser.emulate(scope, options) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ | | `scope` | `string` | feature of the browser you like to emulate, can be either `clock`, `geolocation`, `userAgent`, `colorScheme` or `onLine` | | `options` | `EmulationOptions` | emulation option for specific scope | ## Examples[​](#examples "Direct link to Examples") example.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/9bff2baf8a0678c6886f8591d9fc8dea201895d3/emulate/example.js#L4-L18) example.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/9bff2baf8a0678c6886f8591d9fc8dea201895d3/emulate/example.js#L20-L36) ## Returns[​](#returns "Direct link to Returns") * **\** **`returns`:** a function to reset the emulation --- # execute Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client. The script argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects. ## Usage[​](#usage "Direct link to Usage") ``` await browser.execute(script, arguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------- | ------------------ | ---------------------- | | `script` | `String, Function` | The script to execute. | | `arguments`
*optional* | `*` | script arguments | ## Example[​](#example "Direct link to Example") execute.js ``` it('should inject javascript on the page', async () => { const result = await browser.execute((a, b, c, d) => { // browser context - you may not access client or console return a + b + c + d }, 1, 2, 3, 4) // node.js context - client and console are available console.log(result) // outputs: 10 }); ``` ## Returns[​](#returns "Direct link to Returns") * **<\*>** **`return`:** The script result. --- # executeAsync warning The `executeAsync` command is deprecated and will be removed in a future version. Please use the `execute` command instead as it provides better support for error handling via `async`/`await`. Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client. Asynchronous script commands may not span page loads. If an unload event is fired while waiting for a script result, an error should be returned to the client. The script argument defines the script to execute in the form of a function body. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished. Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects. caution Please use `execute` instead ## Usage[​](#usage "Direct link to Usage") ``` await browser.executeAsync(script, arguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------- | ------------------ | ---------------------- | | `script` | `String, Function` | The script to execute. | | `arguments`
*optional* | `*` | script arguments | ## Examples[​](#examples "Direct link to Examples") executeAsync.js ``` it('should execute async JavaScript on the page', async () => { await browser.setTimeout({ script: 5000 }) const result = await browser.executeAsync(function(a, b, c, d, done) { // browser context - you may not access client or console setTimeout(() => { done(a + b + c + d) }, 3000); }, 1, 2, 3, 4) // node.js context - client and console are available console.log(result) // outputs: 10 }); ``` executeAsync.ts ``` // explicitly type the return value of the script to ensure type safety const result: number = await browser.executeAsync(function(a, b, c, d, done) { // browser context - you may not access client or console setTimeout(() => { done(a + b + c + d) }, 3000); }, 1, 2, 3, 4) ``` ## Returns[​](#returns "Direct link to Returns") * **<\*>** **`return`:** The script result. --- # getCookies Retrieve a [cookie](https://w3c.github.io/webdriver/webdriver-spec.html#cookies) visible to the current page. You can query a specific cookie by providing the cookie name or retrieve all. ## Usage[​](#usage "Direct link to Usage") ``` await browser.getCookies(filter, sourceOrigin) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `filter` | `remote.StorageCookieFilter` | an object that allows to filter for cookies with specific attributes | | `sourceOrigin` | `string, null` | an optional source origin to fetch cookies for, if not provided it will default to the current page's origin, if explicitly set to null it will fetch cookies without a partition (only supported in BiDi) | ## Example[​](#example "Direct link to Example") getCookies.js ``` it('should return a cookie for me', async () => { await browser.setCookies([ {name: 'test', value: '123'}, {name: 'test2', value: '456'} ]) const testCookie = await browser.getCookies(['test']) console.log(testCookie); // outputs: [{ name: 'test', value: '123' }] const allCookies = await browser.getCookies() console.log(allCookies); // outputs: // [ // { name: 'test', value: '123' }, // { name: 'test2', value: '456' } // ] // filter cookies by domain const stagingCookies = await browser.getCookies({ domain: 'staging.myapplication.com' }) }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** requested cookies --- # getPuppeteer Get the [Puppeteer Browser instance](https://pptr.dev/#?product=Puppeteer\&version=v5.1.0\&show=api-class-browser) to run commands with Puppeteer. Note that all Puppeteer commands are asynchronous by default so in order to interchange between sync and async execution make sure to wrap your Puppeteer calls within a `browser.call` commands as shown in the example. info Note that using Puppeteer requires support for Chrome DevTools protocol and e.g. can not be used when running automated tests in the cloud. Chrome DevTools protocol is not installed by default, use `npm install puppeteer-core` to install it. Find out more in the [Automation Protocols](/docs/automationProtocols.md) section. info Note: Puppeteer is currently **not** supported when running [component tests](/docs/component-testing.md). ## Usage[​](#usage "Direct link to Usage") ``` await browser.getPuppeteer() ``` ## Example[​](#example "Direct link to Example") getPuppeteer.test.js ``` it('should allow me to use Puppeteer', async () => { // WebDriver command await browser.url('https://webdriver.io') const puppeteerBrowser = await browser.getPuppeteer() // switch to Puppeteer const metrics = await browser.call(async () => { const pages = await puppeteerBrowser.pages() pages[0].setGeolocation({ latitude: 59.95, longitude: 30.31667 }) return pages[0].metrics() }) console.log(metrics.LayoutCount) // returns LayoutCount value }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** initiated puppeteer instance connected to the browser --- # getWindowSize Returns browser window size. ## Usage[​](#usage "Direct link to Usage") ``` await browser.getWindowSize() ``` ## Example[​](#example "Direct link to Example") getWindowSize.js ``` it('should return browser window size', async () => { const windowSize = await browser.getWindowSize(); console.log(windowSize); // outputs `{ width: 1280, height: 767 }` }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** `{ x, y, width, height }` for W3C or `{ width, height }` for non W3C browser --- # keys Send a sequence of key strokes to the "active" element. You can make an input element active by just clicking on it. To use special characters like "ArrowLeft", "Enter", or "Backspace", import the `Key` object from the WebdriverIO package: ``` import { Key } from 'webdriverio' ``` The `Key` object provides constants for all special keys including: * Navigation: `Key.ArrowLeft`, `Key.ArrowUp`, `Key.ArrowRight`, `Key.ArrowDown`, `Key.PageUp`, `Key.PageDown`, `Key.Home`, `Key.End` * Editing: `Key.Enter`, `Key.Tab`, `Key.Backspace`, `Key.Delete`, `Key.Insert` * Modifiers: `Key.Ctrl` (cross-platform), `Key.Shift`, `Key.Alt`, `Key.Control`, `Key.Command` * Function keys: `Key.F1` through `Key.F12` * Numpad: `Key.Numpad0` through `Key.Numpad9`, `Key.Multiply`, `Key.Add`, `Key.Subtract`, `Key.Divide` * And more: `Key.Escape`, `Key.Space`, `Key.Clear`, `Key.Pause`, etc. See the [Key API docs](/docs/api/modules.md#key) for a complete list. Modifier keys like `Control`, `Shift`, `Alt` and `Command` will stay pressed throughout the sequence and will be released at the end. To combine keyboard input with pointer actions, build separate input-source chains with [`browser.action()`](https://webdriver.io/docs/api/browser/action) and submit them together with [`browser.actions()`](https://webdriver.io/docs/api/browser/actions). Cross-Platform Modifier The `Key.Ctrl` constant provides a convenient way to use the "control" modifier across different operating systems. On macOS, it maps to the `Command` key, while on Windows and Linux it maps to the `Control` key. This is useful for keyboard shortcuts like select-all (`[Key.Ctrl, 'a']`), copy, or paste. ## Usage[​](#usage "Direct link to Usage") ``` await browser.keys(value) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------- | ------------------ | ------------------------------------------------------------------ | | `value` | `String, String[]` | The sequence of keys to type. An array or string must be provided. | ## Example[​](#example "Direct link to Example") keys.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/355434bdef13d29608d6d5fbfbeaa034c8a2aa74/keys/keys.js#L1-L17) --- # mock Mock the response of a request. You can define a mock based on a matching [URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) and corresponding header and status code. Calling the mock method returns a stub object that you can use to modify the response of the web resource. With the stub object you can then either return a custom response or have the request fail. There are 3 ways to modify the response: * return a custom JSON object (for stubbing API request) * replace web resource with a local file (serve a modified JavaScript file) or * redirect resource to a different url info Note that using the `mock` command requires support for WebDriver Bidi. That is usually the case when running tests locally in a Chromium based browser or on Firefox as well as if you use a Selenium Grid v4 or higher. If you run tests in the cloud, make sure that your cloud provider supports WebDriver Bidi. info The `URLPattern` is an experimental technology and not yet supported in some environments, e.g. Node.js. We recommend to import [a polyfill](https://www.npmjs.com/package/urlpattern-polyfill) until the feature is more widely supported. ## Usage[​](#usage "Direct link to Usage") ``` await browser.mock(url, { method, requestHeaders, responseHeaders, postData, statusCode }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ----------------------------------------------- | -------------------- | -------------------------------------------- | | `url` | `String, URLPattern` | url to mock | | `filterOptions`
*optional* | `MockFilterOptions` | filter mock resource by additional options | | `filterOptions.method`
*optional* | `String, Function` | filter resource by HTTP method | | `filterOptions.requestHeaders`
*optional* | `Object, Function` | filter resource by specific request headers | | `filterOptions.responseHeaders`
*optional* | `Object, Function` | filter resource by specific response headers | | `filterOptions.postData`
*optional* | `String, Function` | filter resource by request postData | | `filterOptions.statusCode`
*optional* | `Number, Function` | filter resource by response statusCode | ## Example[​](#example "Direct link to Example") mock.js ``` it('should mock network resources', async () => { // via static string const userListMock = await browser.mock('**' + '/users/list') // you can also specifying the mock even more by filtering resources // by request or response headers, status code, postData, e.g. mock only responses with specific // header set and statusCode const strictMock = await browser.mock('*', { // mock all json responses statusCode: 200, requestHeaders: { 'Content-Type': 'application/json' }, responseHeaders: { 'Cache-Control': 'no-cache' }, postData: 'foobar' }) // comparator function const apiV1Mock = await browser.mock('**' + '/api/v1', { statusCode: (statusCode) => statusCode >= 200 && statusCode <= 203, requestHeaders: (headers) => headers['Authorization'] && headers['Authorization'].startsWith('Bearer '), responseHeaders: (headers) => headers['Impersonation'], postData: (data) => typeof data === 'string' && data.includes('foo') }) }) it('should modify API responses', async () => { // filter by method const todoMock = await browser.mock('**' + '/todos', { method: 'get' }) // mock an endpoint with a fixed fixture todoMock.respond([{ title: 'Injected Todo', order: null, completed: false, url: "http://todo-backend-express-knex.herokuapp.com/916" }]) // respond with different status code or header todoMock.respond([{ title: 'Injected Todo', order: null, completed: false, url: "http://todo-backend-express-knex.herokuapp.com/916" }], { statusCode: 404, headers: { 'x-custom-header': 'foobar' } }) }) it('should modify text assets', async () => { const scriptMock = await browser.mock('**' + '/script.min.js') scriptMock.respond('./tests/fixtures/script.js') }) it('should redirect web resources', async () => { const headerMock = await browser.mock('**' + '/header.png') headerMock.respond('https://media.giphy.com/media/F9hQLAVhWnL56/giphy.gif') const pageMock = await browser.mock('https://google.com/') pageMock.respond('https://webdriver.io') await browser.url('https://google.com') console.log(await browser.getTitle()) // returns "WebdriverIO · Next-gen browser and mobile automation test framework for Node.js" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** a mock object to modify the response --- # mockClearAll Resets all information stored in all registered mocks of the session. ## Usage[​](#usage "Direct link to Usage") ``` await browser.mockClearAll() ``` ## Example[​](#example "Direct link to Example") mockClearAll.js ``` it('should clear all mocks', async () => { const docMock = await browser.mock('**', { headers: { 'Content-Type': 'text/html' } }) const jsMock = await browser.mock('**', { headers: { 'Content-Type': 'application/javascript' } }) await browser.url('https://guinea-pig.webdriver.io/') console.log(docMock.calls.length, jsMock.calls.length) // returns "1 4" await browser.url('https://guinea-pig.webdriver.io/') console.log(docMock.calls.length, jsMock.calls.length) // returns "2 4" (JavaScript comes from cache) await browser.mockClearAll() console.log(docMock.calls.length, jsMock.calls.length) // returns "0 0" }) ``` --- # mockRestoreAll Restores all mock information and behavior stored in all registered mocks of the session. ## Usage[​](#usage "Direct link to Usage") ``` await browser.mockRestoreAll() ``` ## Example[​](#example "Direct link to Example") mockRestoreAll.js ``` it('should restore all mocks', async () => { const googleMock = await browser.mock('https://google.com/') googleMock.respond('https://webdriver.io') const wdioMock = await browser.mock('https://webdriver.io') wdioMock.respond('http://json.org') await browser.url('https://google.com/') console.log(await browser.getTitle()) // JSON await browser.mockRestoreAll() await browser.url('https://google.com/') console.log(await browser.getTitle()) // Google }) ``` --- # newWindow Open new window or tab in browser (defaults to a new window if not specified). This command is the equivalent function to `window.open()`. This command does not work in mobile environments. **Note:** When calling this command you automatically switch to the new window or tab. ## Usage[​](#usage "Direct link to Usage") ``` await browser.newWindow(url, { type, windowName, windowFeatures }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------------------------- | ------------------ | ----------------------------------------------------------------- | | `url` | `string` | website URL to open | | `options`
*optional* | `NewWindowOptions` | newWindow command options | | `options.type`
*optional* | `string` | type of new window: 'tab' or 'window' | | `options.windowName`
*optional* | `String` | name of the new window | | `options.windowFeatures`
*optional* | `String` | features of opened window (e.g. size, position, scrollbars, etc.) | ## Examples[​](#examples "Direct link to Examples") newWindowSync.js ``` it('should open a new window', async () => { await browser.url('https://google.com') console.log(await browser.getTitle()) // outputs: "Google" const result = await browser.newWindow('https://webdriver.io', { windowName: 'WebdriverIO window', windowFeature: 'width=420,height=230,resizable,scrollbars=yes,status=1', }) console.log(await browser.getTitle()) // outputs: "WebdriverIO · Next-gen browser and mobile automation test framework for Node.js" console.log(result.type) // outputs: "window" const handles = await browser.getWindowHandles() await browser.switchToWindow(handles[1]) await browser.closeWindow() await browser.switchToWindow(handles[0]) console.log(await browser.getTitle()) // outputs: "Google" }); ``` newTabSync.js ``` it('should open a new tab', async () => { await browser.url('https://google.com') console.log(await browser.getTitle()) // outputs: "Google" await browser.newWindow('https://webdriver.io', { type:'tab', windowName: 'WebdriverIO window', windowFeature: 'width=420,height=230,resizable,scrollbars=yes,status=1', }) console.log(await browser.getTitle()) // outputs: "WebdriverIO · Next-gen browser and mobile automation test framework for Node.js" console.log(result.type) // outputs: "tab" const handles = await browser.getWindowHandles() await browser.switchToWindow(handles[1]) await browser.closeWindow() await browser.switchToWindow(handles[0]) console.log(await browser.getTitle()) // outputs: "Google" }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** An object containing the window handle and the type of new window `{handle: string, type: string}` handle - The ID of the window handle of the new tab or window, type - The type of the new window, either 'tab' or 'window' ## Throws[​](#throws "Direct link to Throws") * **Error**: If `url` is invalid, if the command is used on mobile, or `type` is not 'tab' or 'window'. --- # overwriteCommand The browser method `overwriteCommand` helps you to overwrite the browser's and element's native commands like `pause` and `click`. info You can view more information on this in the [custom command](/docs/customcommands.md#overwriting-native-commands) section. ## Usage[​](#usage "Direct link to Usage") ``` browser.overwriteCommand(name, callback, elementScope) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------ | ---------- | ------------------------------------------------------- | | `name` | `string` | name of the original command | | `callback` | `Function` | pass original function | | `elementScope`
*optional* | `Boolean` | extend the Element object instead of the Browser object | ## Example[​](#example "Direct link to Example") execute.js ``` // print milliseconds before pause and return its value. await browser.overwriteCommand('pause', function (origPauseFunction, ms) { console.log(`Sleeping for ${ms}`) origPauseFunction(ms) return ms }) // usage it('should use my overwrite command', async () => { await browser.url('https://webdriver.io') await browser.pause(1000) // outputs "Sleeping for 1000" }) ``` --- # pause Pauses execution for a specific amount of time. It is recommended to not use this command to wait for an element to show up. In order to avoid flaky test results it is better to use commands like [`waitForExist`](/docs/api/element/waitForExist.md) or other waitFor\* commands. ## Usage[​](#usage "Direct link to Usage") ``` await browser.pause(milliseconds) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------------- | -------- | ---------- | | `milliseconds` | `number` | time in ms | ## Example[​](#example "Direct link to Example") pause.js ``` it('should pause the execution', async () => { const starttime = new Date().getTime() await browser.pause(3000) const endtime = new Date().getTime() console.log(endtime - starttime) // outputs: 3000 }); ``` --- # react$ The `react$` command is a useful command to query React Components by their actual name and filter them by props and state. info The command only works with applications using React v16.x. Read more about React selectors in the [Selectors](/docs/selectors.md#react-selectors) guide. ## Usage[​](#usage "Direct link to Usage") ``` await browser.react$(selector, { props, state }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------- | --------------------------------------------- | -------------------------------------- | | `selector` | `string` | of React component | | `options`
*optional* | `ReactSelectorOptions` | React selector options | | `options.props`
*optional* | `Object` | React props the element should contain | | `options.state`
*optional* | `Array, number, string, object, boolean` | React state the element should be in | ## Example[​](#example "Direct link to Example") pause.js ``` it('should calculate 7 * 6', async () => { await browser.url('https://ahfarmer.github.io/calculator/'); const appWrapper = await $('div#root') await browser.react$('t', { props: { name: '7' } }).click() await browser.react$('t', { props: { name: 'x' } }).click() await browser.react$('t', { props: { name: '6' } }).click() await browser.react$('t', { props: { name: '=' } }).click() console.log(await $('.component-display').getText()); // prints "42" }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # react$$ The `react$$` command is a useful command to query multiple React Components by their actual name and filter them by props and state. info The command only works with applications using React v16.x. Read more about React selectors in the [Selectors](/docs/selectors.md#react-selectors) guide. ## Usage[​](#usage "Direct link to Usage") ``` await browser.react$$(selector, { props, state }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------- | --------------------------------------------- | -------------------------------------- | | `selector` | `string` | of React component | | `options`
*optional* | `ReactSelectorOptions` | React selector options | | `options.props`
*optional* | `Object` | React props the element should contain | | `options.state`
*optional* | `Array, number, string, object, boolean` | React state the element should be in | ## Example[​](#example "Direct link to Example") pause.js ``` it('should calculate 7 * 6', async () => { await browser.url('https://ahfarmer.github.io/calculator/'); const orangeButtons = await browser.react$$('t', { props: { orange: true } }) console.log(await orangeButtons.map((btn) => btn.getText())); // prints "[ '÷', 'x', '-', '+', '=' ]" }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # reloadSession Creates a new Selenium session with your current capabilities. This is useful if you test highly stateful application where you need to clean the browser session between the tests in your spec file to avoid creating hundreds of single test files with WDIO. Be careful though, this command affects your test time tremendously since spawning new Selenium sessions is very time consuming especially when using cloud services. Connection parameters such as hostname, port, protocol, etc. can be added along side browserName when you want to connect to a different remote service. This is useful in a situation, for example, where you start a test in native app and need to verify data in web app. If you start from remote service, you can pass in 0.0.0.0 for hostname if you want to switch to local drivers. ## Usage[​](#usage "Direct link to Usage") ``` await browser.reloadSession(newCapabilities) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------------- | -------------------------- | ----------------------------------------- | | `newCapabilities`
*optional* | `WebdriverIO.Capabilities` | new capabilities to create a session with | ## Example[​](#example "Direct link to Example") reloadSync.js ``` it('should reload my session with current capabilities', async () => { console.log(browser.sessionId) // outputs: e042b3f3cd5a479da4e171825e96e655 await browser.reloadSession() console.log(browser.sessionId) // outputs: 9a0d9bf9d4864160aa982c50cf18a573 }) it('should reload my session with new capabilities', async () => { console.log(browser.capabilities.browserName) // outputs: chrome await browser.reloadSession({ browserName: 'firefox' }) console.log(browser.capabilities.browserName) // outputs: firefox }) it('should reload my session with new remote', async () => { console.log(browser.capabilities.browserName) // outputs: chrome await browser.reloadSession({ protocol: 'https', host: '0.0.0.1', port: 4444, path: '/wd/hub', browserName: 'firefox' }) console.log(browser.capabilities.browserName) // outputs: firefox }) ``` --- # restore This command restores specific or all emulated behaviors that were set using the `emulate` command. ## Usage[​](#usage "Direct link to Usage") ``` await browser.restore() ``` ## Example[​](#example "Direct link to Example") restore.js ``` before(async () => { await browser.emulate('geolocation', { latitude: 52.52, longitude: 13.405 }) await browser.emulate('userAgent', 'foobar') await browser.emulate('colorScheme', 'dark') await browser.emulate('onLine', false) }) it('should restore all emulated behavior', async () => { await browser.url('https://webdriver.io') // test within an emulated environment... }) after(async () => { // restore all emulated behavior await browser.restore() // or only restore specific emulated behavior // await browser.restore(['geolocation', 'userAgent']) }) ``` --- # savePDF Prints the page of the current browsing context to a PDF file on your OS. ## Usage[​](#usage "Direct link to Usage") ``` await browser.savePDF(filepath, { orientation, scale, background, width, height, top, bottom, left, right, shrinkToFit, pageRanges }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- | | `filepath` | `String` | path to the generated pdf (`.pdf` suffix is required) relative to the execution directory | | `options`
*optional* | `PDFPrintOptions` | Print PDF Options | | `options.orientation`
*optional* | `String` | Orientation of PDF page | | `options.scale`
*optional* | `number` | Scale of PDF page | | `options.background`
*optional* | `boolean` | Include background of PDF page | | `options.width`
*optional* | `number` | Width of PDF page | | `options.height`
*optional* | `number` | Height of PDF page | | `options.top`
*optional* | `number` | Top padding of PDF page | | `options.bottom`
*optional* | `number` | Bottom padding of PDF page | | `options.left`
*optional* | `number` | Left padding of PDF page | | `options.right`
*optional* | `number` | Right padding of PDF page | | `options.shrinkToFit`
*optional* | `boolean` | Shrink page to fit page | | `options.pageRanges`
*optional* | `Array` | Range of pages to include in PDF | ## Example[​](#example "Direct link to Example") savePDF.js ``` it('should save a PDF screenshot of the browser view', function () { await browser.savePDF('./some/path/screenshot.pdf'); }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** screenshot buffer --- # saveRecordingScreen Save a video started by [`startRecordingScreen`](/docs/api/appium.md#startrecordingscreen) command to file. info This command is only supported for mobile sessions running on [Appium](https://appium.github.io/appium.io/docs/en/commands/device/recording-screen/start-recording-screen/). ## Usage[​](#usage "Direct link to Usage") ``` await browser.saveRecordingScreen(filepath) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ----------------------------------------------------------------------- | | `filepath` | `String` | full or relative to the execution directory path to the generated video | ## Example[​](#example "Direct link to Example") saveRecordingScreen.js ``` it('should save a video', async () => { await browser.startRecordingScreen(); await $('~BUTTON').click(); await browser.saveRecordingScreen('./some/path/video.mp4'); }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** video buffer --- # saveScreenshot Save a screenshot of the current browsing context to a PNG file on your OS. Be aware that some browser drivers take screenshots of the whole document (e.g. Geckodriver with Firefox) and others only of the current viewport (e.g. Chromedriver with Chrome). ## Usage[​](#usage "Direct link to Usage") ``` await browser.saveScreenshot(filepath, { fullPage, format, quality, clip }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------------------------- | --------- | ------------------------------------------------------------------------------------------- | | `filepath` | `String` | path to the generated image (`.png` suffix is required) relative to the execution directory | | `options` | `Object` | screenshot options | | `options.fullPage=false`
*optional* | `Boolean` | whether to take a screenshot of the full page or just the current viewport | | `options.format='png'`
*optional* | `String` | the format of the screenshot (either `png` or `jpeg`) | | `options.quality=100`
*optional* | `Number` | the quality of the screenshot in case of JPEG format in range 0-100 percent | | `options.clip`
*optional* | `Object` | clipping a rectangle of the screenshot | ## Examples[​](#examples "Direct link to Examples") saveScreenshot.js ``` it('should save a screenshot of the browser viewport', async () => { await browser.saveScreenshot('./some/path/screenshot.png'); }); it('should save a screenshot of the full page', async () => { await browser.saveScreenshot('./some/path/screenshot.png', { fullPage: true }); }); it('should save a screenshot of a specific rectangle', async () => { await browser.saveScreenshot('./some/path/screenshot.png', { clip: { x: 0, y: 0, width: 100, height: 100 } }); }); it('should save a screenshot of the full page in JPEG format', async () => { await browser.saveScreenshot('./some/path/screenshot.jpeg', { fullPage: true, format: 'jpeg' }); }); it('should save a screenshot of the full page in JPEG format with quality 50', async () => { await browser.saveScreenshot('./some/path/screenshot.jpeg', { fullPage: true, format: 'jpeg', quality: 50 }); }); running from a hook, make sure to explicitly define the hook as async: ``` wdio.conf.js ``` afterTest: async function(test) { await browser.saveScreenshot('./some/path/screenshot.png'); } ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** screenshot buffer --- # scroll Scroll within the browser viewport. Note that `x` and `y` coordinates are relative to the current scroll positon, therefore `browser.scroll(0, 0)` is a non operation. ## Usage[​](#usage "Direct link to Usage") ``` await browser.scroll(x, y) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------- | -------- | ----------------------------------------- | | `x=0`
*optional* | `number` | horizontal scroll position (default: `0`) | | `y=0`
*optional* | `number` | vertical scroll position (default: `0`) | ## Example[​](#example "Direct link to Example") scroll.js ``` it('should demonstrate the scroll command', async () => { await browser.url('https://webdriver.io') console.log(await browser.execute(() => window.scrollY)) // returns 0 await browser.scroll(0, 200) console.log(await browser.execute(() => window.scrollY)) // returns 200 }); ``` --- # setCookies Sets one or more [cookies](https://w3c.github.io/webdriver/#cookies) for the current page. Make sure you are on the page that should receive the cookie. You can't set a cookie for an arbitrary page without being on that page. ## Usage[​](#usage "Direct link to Usage") ``` await browser.setCookies({ name, value, path, domain, secure, httpOnly, expiry, sameSite }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | `cookie` | `Array, WebDriverCookie` | cookie object or object array. | | `cookie.name`
*optional* | `String` | The name of the cookie. | | `cookie.value`
*optional* | `String` | The cookie value. | | `cookie.path`
*optional* | `String` | The cookie path. Defaults to "/" if omitted when adding a cookie. | | `cookie.domain`
*optional* | `String` | The domain the cookie is visible to. Defaults to the current browsing context’s active document’s URL domain if omitted when adding a cookie. | | `cookie.secure`
*optional* | `Boolean` | Whether the cookie is a secure cookie. Defaults to false if omitted when adding a cookie. | | `cookie.httpOnly`
*optional* | `Boolean` | Whether the cookie is an HTTP only cookie. Defaults to false if omitted when adding a cookie. | | `cookie.expiry`
*optional* | `Number` | When the cookie expires, specified in seconds since Unix Epoch. Must not be set if omitted when adding a cookie. | | `cookie.sameSite`
*optional* | `String` | Whether the cookie applies to a SameSite policy. Defaults to None if omitted when adding a cookie. Can be set to either "Lax" or "Strict". | ## Example[​](#example "Direct link to Example") setCookies.js ``` it('should set a cookie for the page', async () => { await browser.url('/') // set a single cookie await browser.setCookies({ name: 'test1', value: 'one' // The below options are optional // path: '/foo', // The cookie path. Defaults to "/" // domain: '.example.com', // The domain the cookie is visible to. Defaults to the current browsing context’s active document’s URL domain // secure: true, // Whether the cookie is a secure cookie. Defaults to false // httpOnly: true, // Whether the cookie is an HTTP only cookie. Defaults to false // expiry: 1551393875 // When the cookie expires, specified in seconds since Unix Epoch }) // set multiple cookies await browser.setCookies([ {name: 'test2', value: 'two'}, {name: 'test3', value: 'three'} ]) const cookies = await browser.getCookies() console.log(cookies); // outputs: // [ // {name: 'test1', value: 'one', domain: 'www.example.com'}, // {name: 'test2', value: 'two', domain: 'www.example.com'}, // {name: 'test3', value: 'three', domain: 'www.example.com'} // ] }); ``` --- # setTimeout Sets the timeouts associated with the current session, timeout durations control such behaviour as timeouts on script injection, document navigation, and element retrieval. For more information and examples, see [timeouts guide](https://webdriver.io/docs/timeouts#selenium-timeouts). info It is not recommended to set `implicit` timeouts as they impact WebdriverIO's behavior and can cause errors in certain commands, e.g. `waitForExist` with reverse flag. ## Usage[​](#usage "Direct link to Usage") ``` await browser.setTimeout({ implicit, pageLoad, script }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ----------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `timeouts` | `Timeouts` | Object containing session timeout values | | `timeouts.implicit`
*optional* | `Number` | Time in milliseconds to retry the element location strategy when finding an element. | | `timeouts.pageLoad`
*optional* | `Number` | Time in milliseconds to wait for the document to finish loading. | | `timeouts.script`
*optional* | `Number` | Scripts injected with [`execute`](https://webdriver.io/docs/api/browser/execute) or [`executeAsync`](https://webdriver.io/docs/api/browser/executeAsync) will run until they hit the script timeout duration, which is also given in milliseconds. | ## Example[​](#example "Direct link to Example") setTimeout.js ``` it('should change timeout duration for session with long code duration', async () => { await browser.setTimeout({ 'pageLoad': 10000, 'script': 60000 }); // Execute code which takes a long time await browser.executeAsync((done) => { console.log('Wake me up before you go!'); setTimeout(done, 59000); }); }); ``` --- # setViewport Resizes the browser viewport within the browser. As oppose to `setWindowSize`, this command changes the viewport size, not the window size. ## Usage[​](#usage "Direct link to Usage") ``` await browser.setViewport({ width, height, devicePixelRatio }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------------------------- | -------------------- | --------------------------- | | `options` | `SetViewportOptions` | command arguments | | `options.width` | `number` | viewport width in pixels | | `options.height` | `number` | viewport height in pixels | | `options.devicePixelRatio` | `number` | pixel ratio of the viewport | ## Returns[​](#returns "Direct link to Returns") * **<`Promise`>** --- # setWindowSize Resizes browser window outer size according to provided width and height. Based on your operating system some browser windows might now allow you so have a smaller width than `500px`. If you want to mimic the viewport of e.g. an iPhone you should consider using the `setViewport` command. ## Usage[​](#usage "Direct link to Usage") ``` await browser.setWindowSize(width, height) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | ------------------------------------------ | | `width` | `number` | browser will be resized to provided width | | `height` | `number` | browser will be resized to provided height | ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** Null for *NO*W3C browser and Object `{x, y, width, height}` for W3C browser --- # switchFrame Switches the active context to a frame, e.g. an iframe on the page. There are multiple ways you can query a frame on the page: * If given a string it switches to the frame with a matching context id, url or url that contains that string ``` // switch to a frame that has a specific url or contains a string in the url await browser.url('https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe') // Note: this frame is located in a nested iframe, however you only need to provide // the frame url of your desired frame await browser.switchFrame('https://www.w3schools.com') // check the title of the page console.log(await browser.execute(() => [document.title, document.URL])) // outputs: [ 'W3Schools Online Web Tutorials', 'https://www.w3schools.com/' ] ``` * If you have the context id of the frame you can use it directly ``` // switch to a frame that has a certain context id await browser.switchFrame('A5734774C41F8C91D483BDD4022B2EF3') ``` * If given a WebdriverIO element that references an `iframe` element it will switch to that frame ``` // switch to a frame element queried from current context await browser.switchFrame($('iframe')) ``` * If given a function it will loop through all iframes on the page and call the function within the context object. The function should return a boolean indicating if the frame should be selected. The function will be executed within the browser and allows access to all Web APIs, e.g.: ``` // switch to first frame that contains an element with id "#frameContent" await browser.switchFrame(() => Boolean(document.querySelector('#frameContent'))) // switch to first frame that contains "webdriver" in the URL await browser.switchFrame(() => document.URL.includes('webdriver')) ``` * If given `null` it will switch to the top level frame ``` // first switch into a frame await browser.switchFrame($('iframe')) // do more automation within that frame, then ... // switch to the top level frame await browser.switchFrame(null) ``` Once you switched to a frame, all further commands will be executed in the context of that frame, including navigating to different pages. ## Usage[​](#usage "Direct link to Usage") ``` await browser.switchFrame(context) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------- | -------------------------- | ------- | | `context` | `string, object, function` | | ## Returns[​](#returns "Direct link to Returns") * **<`Promise`>** **`returns`:** the current active context id --- # switchWindow Switch focus to a particular tab / window. ## Usage[​](#usage "Direct link to Usage") ``` await browser.switchWindow(matcher) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------- | ---------------- | ------------------------------------------------------------------------------------------------------------- | | `matcher` | `String, RegExp` | String or regular expression that matches either the page title or URL, the window name, or the window handle | ## Example[​](#example "Direct link to Example") switchWindow\.js ``` it('should switch to another window', async () => { // open url await browser.url('https://google.com') // get window handle const handle = await browser.getWindowHandle() // create new window await browser.newWindow('https://webdriver.io') // switch back via url match await browser.switchWindow('google.com') // switch back via title match await browser.switchWindow('Next-gen browser and mobile automation test framework for Node.js') // switch back via window handle await browser.switchWindow(handle) }); ``` --- # throttle caution use `browser.throttleNetwork` instead ## Usage[​](#usage "Direct link to Usage") ``` await browser.throttle() ``` --- # throttleCPU Throttles the CPU to emulate a slower processor. info Note that using the `throttleCPU` command requires support for Chrome DevTools protocol and e.g. can not be used when running automated tests in the cloud. Chrome DevTools protocol is not installed by default, use `npm install puppeteer-core` to install it. Find out more in the [Automation Protocols](/docs/automationProtocols.md) section. ## Usage[​](#usage "Direct link to Usage") ``` await browser.throttleCPU(factor) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | --------------------------------------------------------- | | `factor` | `number` | slowdown factor (1 is no throttle, 2 is 2x slowdown, etc) | ## Example[​](#example "Direct link to Example") throttleCPU.js ``` it('should throttle the CPU', async () => { await browser.throttleCPU(2) // 2x slowdown }); ``` --- # throttleNetwork Throttle the network capabilities of the browser. This can help to emulate certain scenarios where a user loses their internet connection and your app needs to address that. There are many presets available with default configurations for ease of use. They are `offline`, `GPRS`, `Regular2G`, `Good2G`, `Regular3G`, `Good3G`, `Regular4G`, `DSL`, `WiFi`, `online`. You can see the values for these presets [in the source code](https://github.com/webdriverio/webdriverio/blob/6824e4eb118a8d20685f12f4bc42f13fd56f8a25/packages/webdriverio/src/commands/browser/throttleNetwork.js#L29). info Service workers initiate requests through their own network stack. This command applies the throttling conditions to every service worker that is registered at the time of the call. If your app registers a service worker afterwards, call `throttleNetwork` again to cover it. Note that using the `throttleNetwork` command requires support for Chrome DevTools protocol and e.g. can not be used when running automated tests in the cloud. Chrome DevTools protocol is not installed by default, use `npm install puppeteer-core` to install it. Find out more in the [Automation Protocols](/docs/automationProtocols.md) section. ## Usage[​](#usage "Direct link to Usage") ``` await browser.throttleNetwork({ offline, latency, downloadThroughput, uploadThroughput }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------- | ----------------- | ------------------------------------------------------------------------------------ | | `params` | `ThrottleOptions` | parameters for throttling | | `params.offline` | `boolean` | True to emulate internet disconnection. | | `params.latency` | `number` | Minimum latency from request sent to response headers received (ms). | | `params.downloadThroughput` | `number` | Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. | | `params.uploadThroughput` | `number` | Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. | ## Example[​](#example "Direct link to Example") throttleNetwork.js ``` it('should throttle the network', async () => { // via static string preset await browser.throttleNetwork('Regular3G') // via custom values await browser.throttleNetwork({ offline: false, downloadThroughput: 200 * 1024 / 8, uploadThroughput: 200 * 1024 / 8, latency: 20 }) }); ``` --- # touchAction Deprecation Warning The `touchAction` command is **deprecated** and will be removed in a future version. We recommend to use the [`action`](/docs/api/browser/action.md) command instead with pointer type `touch`, e.g.: ``` await browser.action('pointer', { parameters: { pointerType: 'touch' } }) ``` The Touch Action API provides the basis of all gestures that can be automated in Appium. It is currently only available to native apps and can not be used to interact with webapps. 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. The basic actions that can be used are: * press (pass element or (`x`, `y`) or both) * longPress (pass element or (`x`, `y`) or both) * tap (pass element or (`x`, `y`) or both) * moveTo (pass absolute `x`, `y` coordinates) * wait (pass `ms` (as milliseconds)) * release (no arguments) ## Usage[​](#usage "Direct link to Usage") ``` await browser.touchAction(action) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------- | -------------- | ----------------- | | `action` | `TouchActions` | action to execute | ## Example[​](#example "Direct link to Example") touchAction.js ``` it('should do a touch gesture', async () => { const screen = await $('//UITextbox'); // simple touch action on element await browser.touchAction({ action: 'tap', element: screen }); // simple touch action x y variables // tap location is 30px right and 20px down relative from the viewport await browser.touchAction({ action: 'tap', x: 30, y:20 }) // simple touch action x y variables // tap location is 30px right and 20px down relative from the center of the element await browser.touchAction({ action: 'tap', x: 30, y:20, element: screen }) // multi action on an element // drag&drop from position 200x200 down 100px on the screen await browser.touchAction([ { action: 'press', x: 200, y: 200 }, { action: 'moveTo', x: 200, y: 300 }, 'release' ]) }); ``` --- # uploadFile Uploads a file to the Selenium Standalone server or other browser driver (e.g. Chromedriver or EdgeDriver) by using the [`file`](https://webdriver.io/docs/api/selenium#file) command. *Note:* that this command is only supported if you use a Selenium Hub, Chromedriver or EdgeDriver directly. **Note:** this command uses an un-official protocol feature that is currently only supported in Chrome and when running a [Selenium Grid](https://www.selenium.dev/documentation/en/grid/). ## Usage[​](#usage "Direct link to Usage") ``` await browser.uploadFile(localPath) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------ | | `localPath` | `string` | local path to file | ## Example[​](#example "Direct link to Example") uploadFile.js ``` import path from 'node:path' it('should upload a file', async () => { await browser.url('https://the-internet.herokuapp.com/upload') const filePath = '/path/to/some/file.png' const remoteFilePath = await browser.uploadFile(filePath) await $('#file-upload').setValue(remoteFilePath) await $('#file-submit').click() }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** remote URL --- # url The `url` command loads an URL in the browser. If a baseUrl is specified in the config, it will be prepended to the url parameter using node's url.resolve() method. Calling `browser.url('...')` with the same url as last time will trigger a page reload. However, if the url contains a hash, the browser will not trigger a new navigation and the user has to [refresh](/docs/api/webdriver.md#refresh) the page to trigger one. The command returns an `WebdriverIO.Request` object that contains information about the request and response data of the page load: ``` interface WebdriverIO.Request { id?: string url: string timestamp: number navigation?: string redirectChain?: string[], headers: Record cookies?: NetworkCookie[] \/** * Error message if request failed *\/ error?: string response?: { fromCache: boolean headers: Record mimeType: string status: number }, /** * List of all requests that were made due to the main request. * Note: the list may be incomplete and does not contain request that were * made after the command has finished. * * The property will be undefined if the request is not a document request * that was initiated by the browser. *\/ children?: Request[] } ``` The command supports the following options: note These features unfortunately won't be available to you if your remote environment doesn't support WebDriver Bidi. You can check if Bidi is support in your session by looking into the `browser.isBidi` property. ### wait[​](#wait "Direct link to wait") The desired state the requested resource should be in before finishing the command. It supports the following states: * `none`: no wait after the page request is made and the response is received * `interactive`: wait until the page is interactive * `complete`: wait until the DOM tree of the page is fully loaded * `networkIdle`: wait until there are no pending network requests ### headers[​](#headers "Direct link to headers") Headers to be sent with the request. **Default:** `{}` ### auth[​](#auth "Direct link to auth") Basic authentication credentials. Note: this will overwrite the existing `Authorization` header if provided in the `headers` option. ### timeout[​](#timeout "Direct link to timeout") If set to a number, the command will wait for the specified amount of milliseconds for the page to load all responses before returning. Note: for this to have an impact, it requires the `wait` option to be set to `networkIdle`. **Default:** `5000` ## Usage[​](#usage "Direct link to Usage") ``` await browser.url(url, { wait, timeout, onBeforeLoad, auth, headers }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------------------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `url`
*optional* | `string` | the URL to navigate to | | `options`
*optional* | `UrlOptions` | navigation options | | `options.wait`
*optional* | `'none', 'interactive', 'networkIdle', 'complete'` | The desired state the requested resource should be in before finishing the command. Default: 'complete' | | `options.timeout`
*optional* | `number` | If set to a number, the command will wait for the specified amount of milliseconds for the page to load
all responses before returning. Default: 5000 | | `options.onBeforeLoad`
*optional* | `Function` | A function that is being called before your page has loaded all of its resources. It allows you to easily
mock the environment, e.g. overwrite Web APIs that your application uses. | | `options.auth`
*optional* | `{user: string, pass: string}` | basic authentication credentials | | `options.headers`
*optional* | `Record` | headers to be sent with the request | ## Examples[​](#examples "Direct link to Examples") url.js ``` // navigate to a new URL const request = await browser.url('https://webdriver.io'); // log url console.log(request.url); // outputs: "https://webdriver.io" console.log(request.response?.status); // outputs: 200 console.log(request.response?.headers); // outputs: { 'content-type': 'text/html; charset=UTF-8' } ``` baseUrlResolutions.js ``` // With a base URL of http://example.com/site, the following url parameters resolve as such: // When providing a scheme: // https://webdriver.io await browser.url('https://webdriver.io'); // When not starting with a slash, the URL resolves relative to the baseUrl // http://example.com/site/relative await browser.url('relative'); // When starting with a slash, the URL resolves relative to the root path of the baseUrl // http://example.com/rootRelative await browser.url('/rootRelative'); ``` basicAuth.js ``` // navigate to a URL with basic authentication await browser.url('https://the-internet.herokuapp.com/basic_auth', { auth: { user pass } }); await expect($('p=Congratulations! You must have the proper credentials.').toBeDisplayed(); ``` onBeforeLoad.js ``` // navigate to a URL and mock the battery API await browser.url('https://pazguille.github.io/demo-battery-api/', { onBeforeLoad (win) { // mock "navigator.battery" property // returning mock charge object win.navigator.getBattery = () => Promise.resolve({ level: 0.5, charging: false, chargingTime: Infinity, dischargingTime: 3600, // seconds }) } }) // now we can assert actual text - we are charged at 50% await expect($('.battery-percentage')).toHaveText('50%') // and has enough juice for 1 hour await expect($('.battery-remaining')).toHaveText('01:00) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`returns`:** a request object of the page load with information about the request and response data --- # waitUntil This wait command is your universal weapon if you want to wait on something. It expects a condition and waits until that condition is fulfilled with a truthy value to be returned. A common example is to wait until a certain element contains a certain text (see example). ## Usage[​](#usage "Direct link to Usage") ``` await browser.waitUntil(condition, { timeout, timeoutMsg, interval }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `condition` | `Function` | condition to wait on until returning a truthy value | | `options`
*optional* | `WaitUntilOptions` | command options | | `options.timeout`
*optional* | `Number` | time in ms (default set based on [`waitforTimeout`](/docs/configuration.md#waitfortimeout) config value) | | `options.timeoutMsg`
*optional* | `String, Function` | error message to throw when waitUntil times out. A function is evaluated only after the timeout, so the message can include state from that moment. | | `options.interval`
*optional* | `Number` | interval between condition checks (default set based on [`waitforInterval`](/docs/configuration.md#waitforinterval) config value) | ## Examples[​](#examples "Direct link to Examples") index.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/0bfb2b8d212b627a2659b10f4449184b657e1d59/waitUntil/index.html#L3-L8) waitUntilExample.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/0c9252b0a4f7e18a34cece74e5798c1fe464c120/waitUntil/waitUntilExample.js#L16-L24) ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** true if condition is fulfilled --- # Chromium ## isAlertOpen[​](#isalertopen "Direct link to isAlertOpen") Whether a simple dialog is currently open.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/alert_commands.cc#L42-L49). ### Usage[​](#usage "Direct link to Usage") ``` await browser.isAlertOpen() ``` ### Example[​](#example "Direct link to Example") ``` console.log(browser.isAlertOpen()); // outputs: false browser.execute('window.alert()'); console.log(browser.isAlertOpen()); // outputs: true ``` ### Returns[​](#returns "Direct link to Returns") * **\** **`isAlertOpen`:** `true` or `false` based on whether simple dialog is present or not. *** ## isAutoReporting[​](#isautoreporting "Direct link to isAutoReporting") Whether it should automatically raises errors on browser logs.

Non official and undocumented Chromium command. More about this command can be found [here](https://codereview.chromium.org/101203012). ### Usage[​](#usage-1 "Direct link to Usage") ``` await browser.isAutoReporting() ``` ### Returns[​](#returns-1 "Direct link to Returns") * **\** **`isAutoReporting`:** `true` or `false` based on whether auto reporting is enabled. *** ## setAutoReporting[​](#setautoreporting "Direct link to setAutoReporting") Toggle whether to return response with unknown error with first browser error (e.g. failed to load resource due to 403/404 response) for all subsequent commands (once enabled).

Non official and undocumented Chromium command. More about this command can be found [here](https://codereview.chromium.org/101203012). ### Usage[​](#usage-2 "Direct link to Usage") ``` await browser.setAutoReporting(enabled) ``` ### Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------- | --------- | ----------------------------------------------------------------------------------------------------- | | `enabled` | `boolean` | `true` if auto reporting should be enabled, use `false` to disable previously enabled auto reporting. | ### Examples[​](#examples "Direct link to Examples") ``` // Enable auto reporting first thing after session was initiated with empty browser logs console.log(browser.setAutoReporting(true)); // outputs: null // Upon requesting an non-existing resource it will abort execution due to thrown unknown error browser.url('https://webdriver.io/img/404-does-not-exist.png'); ``` ``` // During the session do some operations which populate the browser logs browser.url('https://webdriver.io/img/404-does-not-exist.png'); browser.url('https://webdriver.io/403/no-access'); // Enable auto reporting which throws an unknown error for first browser log (404 response) browser.setAutoReporting(true); ``` ### Returns[​](#returns-2 "Direct link to Returns") * **\** **`firstBrowserError`:** In case first browser error already occured prior to executing this command it will throw unknown error as response, which is an object with 'message' key describing first browser error. Otherwise it returns `null` on success. *** ## isLoading[​](#isloading "Direct link to isLoading") Determines load status for active window handle.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L783-L802). ### Usage[​](#usage-3 "Direct link to Usage") ``` await browser.isLoading() ``` ### Example[​](#example-1 "Direct link to Example") ``` console.log(browser.isLoading()); // outputs: false browser.newWindow('https://webdriver.io'); console.log(browser.isLoading()); // outputs: true ``` ### Returns[​](#returns-3 "Direct link to Returns") * **\** **`isLoading`:** `true` or `false` based on whether active window handle is loading or not. *** ## takeHeapSnapshot[​](#takeheapsnapshot "Direct link to takeHeapSnapshot") Takes a heap snapshot of the current execution context.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/chrome/web_view.h#L198-L202). ### Usage[​](#usage-4 "Direct link to Usage") ``` await browser.takeHeapSnapshot() ``` ### Returns[​](#returns-4 "Direct link to Returns") * **\** **`heapSnapshot`:** A JSON representation of the heap snapshot. Which can be inspected by loading as file into Chrome DevTools. *** ## getNetworkConnection[​](#getnetworkconnection "Direct link to getNetworkConnection") Get the connection type for network emulation. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes). ### Usage[​](#usage-5 "Direct link to Usage") ``` await browser.getNetworkConnection() ``` ### Example[​](#example-2 "Direct link to Example") ``` const browser = remote({ capabilities: { browserName: 'chrome', 'goog:chromeOptions': { // Network emulation requires device mode, which is only enabled when mobile emulation is on mobileEmulation: { deviceName: 'iPad' }, }, } }); console.log(browser.getNetworkConnection()); // outputs: 6 (Both Wi-Fi and data) ``` ### Returns[​](#returns-5 "Direct link to Returns") * **\** **`connectionType`:** A bitmask to represent the network connection type. Airplane Mode (`1`), Wi-Fi only (`2`), Wi-Fi and data (`6`), 4G (`8`), 3G (`10`), 2G (`20`). By default [Wi-Fi and data are enabled](https://github.com/bayandin/chromedriver/blob/v2.45/chrome/chrome_desktop_impl.cc#L36-L37). *** ## setNetworkConnection[​](#setnetworkconnection "Direct link to setNetworkConnection") Change connection type for network connection. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes). ### Usage[​](#usage-6 "Direct link to Usage") ``` await browser.setNetworkConnection(parameters) ``` ### Parameters[​](#parameters-1 "Direct link to Parameters") | Name | Type | Details | | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `parameters` | `object` | Object containing ConnectionType, set bitmask as value for `type` key in object. Airplane Mode (`1`), Wi-Fi only (`2`), Wi-Fi and data (`6`), 4G (`8`), 3G (`10`), 2G (`20`). | ### Example[​](#example-3 "Direct link to Example") ``` const browser = remote({ capabilities: { browserName: 'chrome', 'goog:chromeOptions': { // Network emulation requires device mode, which is only enabled when mobile emulation is on mobileEmulation: { deviceName: 'iPad' }, }, } }); console.log(browser.setNetworkConnection({ type: 1 })); // outputs: 1 (Airplane Mode) ``` ### Returns[​](#returns-6 "Direct link to Returns") * **\** **`connectionType`:** A bitmask to represent the network connection type. Value should match specified `type` in object, however device might not be capable of the network connection type requested. *** ## getNetworkConditions[​](#getnetworkconditions "Direct link to getNetworkConditions") Get current network conditions used for emulation.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L839-L859). ### Usage[​](#usage-7 "Direct link to Usage") ``` await browser.getNetworkConditions() ``` ### Returns[​](#returns-7 "Direct link to Returns") * **\** **`networkConditions`:** Object containing network conditions for `offline`, `latency`, `download_throughput` and `upload_throughput`. Network conditions must be set before it can be retrieved. *** ## setNetworkConditions[​](#setnetworkconditions "Direct link to setNetworkConditions") Set network conditions used for emulation by throttling connection.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1663-L1722). ### Usage[​](#usage-8 "Direct link to Usage") ``` await browser.setNetworkConditions(network_conditions, network_name) ``` ### Parameters[​](#parameters-2 "Direct link to Parameters") | Name | Type | Details | | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `network_conditions` | `object` | Object containing network conditions which are `latency`, `throughput` (or `download_throughput`/`upload_throughput`) and `offline` (optional). | | `network_name`
*optional* | `string` | Name of [network throttling preset](https://github.com/bayandin/chromedriver/blob/v2.45/chrome/network_list.cc#L12-L25). `GPRS`, `Regular 2G`, `Good 2G`, `Regular 3G`, `Good 3G`, `Regular 4G`, `DSL`, `WiFi` or `No throttling` to disable. When preset is specified values passed in first argument are not respected. | ### Examples[​](#examples-1 "Direct link to Examples") ``` // Use different download (25kb/s) and upload (50kb/s) throughput values for throttling with a latency of 1000ms browser.setNetworkConditions({ latency: 1000, download_throughput: 25600, upload_throughput: 51200 }); ``` ``` // Force disconnected from network by setting 'offline' to true browser.setNetworkConditions({ latency: 0, throughput: 0, offline: true }); ``` ``` // When preset name (e.g. 'DSL') is specified it does not respect values in object (e.g. 'offline') browser.setNetworkConditions({ latency: 0, throughput: 0, offline: true }, 'DSL'); ``` ``` // Best practice for specifying network throttling preset is to use an empty object browser.setNetworkConditions({}, 'Good 3G'); ``` *** ## deleteNetworkConditions[​](#deletenetworkconditions "Direct link to deleteNetworkConditions") Disable any network throttling which might have been set. Equivalent of setting the `No throttling` preset.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1724-L1745). ### Usage[​](#usage-9 "Direct link to Usage") ``` await browser.deleteNetworkConditions() ``` *** ## sendCommand[​](#sendcommand "Direct link to sendCommand") Send a command to the DevTools debugger.
For a list of available commands and their parameters refer to the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1290-L1304). ### Usage[​](#usage-10 "Direct link to Usage") ``` await browser.sendCommand(cmd, params) ``` ### Parameters[​](#parameters-3 "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------- | | `cmd` | `string` | Name of the command (e.g. [`Browser.close`](https://chromedevtools.github.io/devtools-protocol/1-3/Browser#method-close)). | | `params` | `object` | Parameters to the command. In case no parameters for command, specify an empty object. | *** ## sendCommandAndGetResult[​](#sendcommandandgetresult "Direct link to sendCommandAndGetResult") Send a command to the DevTools debugger and wait for the result.
For a list of available commands and their parameters refer to the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1306-L1320). ### Usage[​](#usage-11 "Direct link to Usage") ``` await browser.sendCommandAndGetResult(cmd, params) ``` ### Parameters[​](#parameters-4 "Direct link to Parameters") | Name | Type | Details | | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cmd` | `string` | Name of the command which returns a result (e.g. [`Network.getAllCookies`](https://chromedevtools.github.io/devtools-protocol/1-3/Network#method-getAllCookies)). | | `params` | `object` | Parameters to the command. In case no parameters for command, specify an empty object. | ### Returns[​](#returns-8 "Direct link to Returns") * **<\*>** **`result`:** Either the return value of your command, or the error which was the reason for your command's failure. *** ## file[​](#file "Direct link to file") Upload a file to remote machine on which the browser is running.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L1037-L1065). ### Usage[​](#usage-12 "Direct link to Usage") ``` await browser.file(file) ``` ### Parameters[​](#parameters-5 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `file` | `string` | Base64-encoded zip archive containing **single** file which to upload. In case base64-encoded data does not represent a zip archive or archive contains more than one file it will throw an unknown error. | ### Returns[​](#returns-9 "Direct link to Returns") * **\** **`path`:** Absolute path of uploaded file on remote machine. *** ## launchChromeApp[​](#launchchromeapp "Direct link to launchChromeApp") Launches a Chrome app by specified id.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L521-L539). ### Usage[​](#usage-13 "Direct link to Usage") ``` await browser.launchChromeApp(id) ``` ### Parameters[​](#parameters-6 "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | ---------------------------------------------------------------------- | | `id` | `string` | Extension id of app to be launched, as defined in chrome://extensions. | ### Example[​](#example-4 "Direct link to Example") ``` import fs from 'fs' const browser = remote({ capabilities: { browserName: 'chrome', 'goog:chromeOptions': { // Install upon starting browser in order to launch it extensions: [ // Entry should be a base64-encoded packed Chrome app (.crx) fs.readFileSync('/absolute/path/app.crx').toString('base64') ] } } }); browser.launchChromeApp('aohghmighlieiainnegkcijnfilokake')); // Google Docs (https://chrome.google.com/webstore/detail/docs/aohghmighlieiainnegkcijnfilokake) ``` *** ## getElementValue[​](#getelementvalue "Direct link to getElementValue") Retrieves the value of a given form control element.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L431-L443). ### Usage[​](#usage-14 "Direct link to Usage") ``` await browser.getElementValue(elementId) ``` ### Parameters[​](#parameters-7 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------------------- | | `elementId` | `String` | id of element to get value from | ### Returns[​](#returns-10 "Direct link to Returns") * **\** **`value`:** Current value of the element. In case specified element is not a form control element, it will return `null`. *** ## elementHover[​](#elementhover "Direct link to elementHover") Enable hover state for an element, which is reset upon next interaction.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L126-L146). ### Usage[​](#usage-15 "Direct link to Usage") ``` await browser.elementHover(elementId) ``` ### Parameters[​](#parameters-8 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------------------ | | `elementId` | `String` | id of element to hover over to | *** ## touchPinch[​](#touchpinch "Direct link to touchPinch") Trigger a pinch zoom effect.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L813-L827). ### Usage[​](#usage-16 "Direct link to Usage") ``` await browser.touchPinch(x, y, scale) ``` ### Parameters[​](#parameters-9 "Direct link to Parameters") | Name | Type | Details | | ------- | -------- | ---------------------- | | `x` | `number` | x position to pinch on | | `y` | `number` | y position to pinch on | | `scale` | `number` | pinch zoom scale | *** ## freeze[​](#freeze "Direct link to freeze") Freeze the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L625-L633). ### Usage[​](#usage-17 "Direct link to Usage") ``` await browser.freeze() ``` *** ## resume[​](#resume "Direct link to resume") Resume the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L635-L645). ### Usage[​](#usage-18 "Direct link to Usage") ``` await browser.resume() ``` *** ## getCastSinks[​](#getcastsinks "Direct link to getCastSinks") Returns the list of cast sinks (Cast devices) available to the Chrome media router.

Non official and undocumented Chromium command. More about this command can be found [here](https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#748). ### Usage[​](#usage-19 "Direct link to Usage") ``` await browser.getCastSinks() ``` ### Returns[​](#returns-11 "Direct link to Returns") * **\** **`sinks`:** List of available sinks. *** ## selectCastSink[​](#selectcastsink "Direct link to selectCastSink") Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).

Non official and undocumented Chromium command. More about this command can be found [here](https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#737). ### Usage[​](#usage-20 "Direct link to Usage") ``` await browser.selectCastSink(sinkName) ``` ### Parameters[​](#parameters-10 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ------------------------------ | | `sinkName` | `string` | The name of the target device. | *** ## startCastTabMirroring[​](#startcasttabmirroring "Direct link to startCastTabMirroring") Initiates tab mirroring for the current browser tab on the specified device.

Non official and undocumented Chromium command. More about this command can be found [here](https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#741). ### Usage[​](#usage-21 "Direct link to Usage") ``` await browser.startCastTabMirroring(sinkName) ``` ### Parameters[​](#parameters-11 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ------------------------------ | | `sinkName` | `string` | The name of the target device. | *** ## getCastIssueMessage[​](#getcastissuemessage "Direct link to getCastIssueMessage") Returns error message if there is any issue in a Cast session.

Non official and undocumented Chromium command. More about this command can be found [here](https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#751). ### Usage[​](#usage-22 "Direct link to Usage") ``` await browser.getCastIssueMessage() ``` ### Returns[​](#returns-12 "Direct link to Returns") * **\** **`message`:** Error message, if any. *** ## stopCasting[​](#stopcasting "Direct link to stopCasting") Stops casting from media router to the specified device, if connected.

Non official and undocumented Chromium command. More about this command can be found [here](https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#744). ### Usage[​](#usage-23 "Direct link to Usage") ``` await browser.stopCasting(sinkName) ``` ### Parameters[​](#parameters-12 "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ------------------------------ | | `sinkName` | `string` | The name of the target device. | *** ## shutdown[​](#shutdown "Direct link to shutdown") Shutdown ChromeDriver process and consequently terminating all active sessions.

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L489-L498). ### Usage[​](#usage-24 "Direct link to Usage") ``` await browser.shutdown() ``` *** ## takeElementScreenshot[​](#takeelementscreenshot "Direct link to takeElementScreenshot") The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.

Non official and undocumented Chromium command. More about this command can be found [here](https://w3c.github.io/webdriver/#dfn-take-element-screenshot). ### Usage[​](#usage-25 "Direct link to Usage") ``` await browser.takeElementScreenshot(elementId) ``` ### Parameters[​](#parameters-13 "Direct link to Parameters") | Name | Type | Details | | ----------- | -------- | ------------------------------------------------------------------- | | `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) | ### Returns[​](#returns-13 "Direct link to Returns") * **\** **`screenshot`:** The base64-encoded PNG image data comprising the screenshot of the visible region of an element’s bounding rectangle after it has been scrolled into view. *** ## getLogTypes[​](#getlogtypes "Direct link to getLogTypes") Get available log types.

Appium command. More details can be found in the [official protocol docs](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes). ### Usage[​](#usage-26 "Direct link to Usage") ``` await browser.getLogTypes() ``` ### Returns[​](#returns-14 "Direct link to Returns") * **\** **`logTypes`:** The list of available log types, example: browser, driver. *** ## getLogs[​](#getlogs "Direct link to getLogs") Get the log for a given log type. Log buffer is reset after each request.

Appium command. More details can be found in the [official protocol docs](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog).

Non official and undocumented Chromium command. More about this command can be found [here](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog). ### Usage[​](#usage-27 "Direct link to Usage") ``` await browser.getLogs(type) ``` ### Parameters[​](#parameters-14 "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ------------ | | `type` | `string` | the log type | ### Returns[​](#returns-15 "Direct link to Returns") * **\** **`logs`:** The list of log entries. --- # The Clock Object You can modify the browser system clock using the [`emulate`](/docs/emulation.md) command. It overrides native global functions related to time allowing them to be controlled synchronously via `clock.tick()` or the yielded clock object. This includes controlling: * `setTimeout` * `clearTimeout` * `setInterval` * `clearInterval` * `Date Objects` The clock starts at the unix epoch (timestamp of 0). This means that when you instantiate new Date in your application, it will have a time of January 1st, 1970 if you don't pass any other options to the `emulate` command. ## Example[​](#example "Direct link to Example") When calling `browser.emulate('clock', { ... })` it will immediately overwrite the global functions for the current page as well as all following pages, e.g.: ``` const clock = await browser.emulate('clock', { now: new Date(1989, 7, 4) }) console.log(await browser.execute(() => (new Date()).toString())) // returns "Fri Aug 04 1989 00:00:00 GMT-0700 (Pacific Daylight Time)" await browser.url('https://webdriverio') console.log(await browser.execute(() => (new Date()).toString())) // returns "Fri Aug 04 1989 00:00:00 GMT-0700 (Pacific Daylight Time)" await clock.restore() console.log(await browser.execute(() => (new Date()).toString())) // returns "Thu Aug 01 2024 17:59:59 GMT-0700 (Pacific Daylight Time)" await browser.url('http://guinea-pig.webdriver.io/pointer.html') console.log(await browser.execute(() => (new Date()).toString())) // returns "Thu Aug 01 2024 17:59:59 GMT-0700 (Pacific Daylight Time)" ``` You can modify the system time by calling [`setSystemTime`](/docs/api/clock/setSystemTime.md) or [`tick`](/docs/api/clock/tick.md). --- # restore Restore all overridden native functions. This is automatically called between tests, so should not generally be needed. ## Usage[​](#usage "Direct link to Usage") ``` const clock = await browser.emulate('clock', { ... }) await clock.restore() ``` ## Example[​](#example "Direct link to Example") restore.js ``` console.log(new Date()) // returns e.g. 1722560447102 const clock = await browser.emulate('clock', { now: new Date(2021, 3, 14) }) console.log(await browser.execute(() => new Date().getTime())) // returns 1618383600000 await clock.restore() console.log(await browser.execute(() => new Date().getTime())) // returns 1722560447102 ``` ## Returns[​](#returns "Direct link to Returns") * **< `Promise` >** --- # setSystemTime Change the system time to the new now. Now can be a timestamp, date object, or not passed in which defaults to 0. No timers will be called, nor will the time left before they trigger change. ## Usage[​](#usage "Direct link to Usage") ``` const clock = await browser.emulate('clock', { ... }) await clock.setSystemTime(date) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------ | -------------- | --------------------------------------- | | `date` | `Date, number` | The new date to set the system time to. | ## Example[​](#example "Direct link to Example") setSystemTime.js ``` const clock = await browser.emulate('clock', { now: new Date(2021, 3, 14) }) console.log(await browser.execute(() => new Date().getTime())) // returns 1618383600000 await clock.setSystemTime(new Date(2011, 3, 15)) console.log(await browser.execute(() => new Date().getTime())) // returns 1302850800000 ``` ## Returns[​](#returns "Direct link to Returns") * **< `Promise` >** --- # tick Move the clock the specified number of `milliseconds`. Any timers within the affected range of time will be called. ## Usage[​](#usage "Direct link to Usage") ``` const clock = await browser.emulate('clock', { ... }) await clock.tick(ms) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---- | -------- | --------------------------------------------- | | `ms` | `number` | The number of milliseconds to move the clock. | ## Example[​](#example "Direct link to Example") tick.js ``` const clock = await browser.emulate('clock', { now: new Date(2021, 3, 14) }) console.log(await browser.execute(() => new Date().getTime())) // returns 1618383600000 await clock.tick(1000) console.log(await browser.execute(() => new Date().getTime())) // returns 1618383601000 ``` ## Returns[​](#returns "Direct link to Returns") * **< `Promise` >** --- # The Dialog Object Dialog objects are dispatched by [`browser`](/docs/api/browser.md) via the `browser.on('dialog')` event. An example of using the Dialog object: ``` import { browser } from '@wdio/globals' await browser.url('https://webdriver.io') browser.on('dialog', async (dialog) => { console.log(dialog.message()) // outputs: "Hello Dialog" await dialog.dismiss() }) await browser.execute(() => alert('Hello Dialog')) ``` note Dialogs are dismissed automatically, unless there is at least one `browser.on('dialog')` or `browser.once('dialog')` listener. When a listener is present, it must either [`dialog.accept()`](/docs/api/dialog/accept.md) or [`dialog.dismiss()`](/docs/api/dialog/dismiss.md) the dialog - otherwise the page will freeze waiting for the dialog, and actions like click will never finish. Mobile native dialogs Browser dialog events are not emitted for native iOS/Android permission dialogs. Handle those with [`browser.acceptDialog`](/docs/api/mobile/acceptDialog.md) and [`browser.dismissDialog`](/docs/api/mobile/dismissDialog.md) instead. --- # accept Accepts the dialog and returns when the dialog has been handled. info Only works with browser dialogs (via BiDi protocol). For mobile native dialogs, use [`browser.acceptDialog`](/docs/api/mobile/acceptDialog.md) instead. ## Usage[​](#usage "Direct link to Usage") ``` await dialog.accept(promptText) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------------- | -------- | ------------------------------------------------------------------------------------------- | | `promptText`
*optional* | `string` | A text to enter into prompt. Does not cause any effects if the dialog's type is not prompt. | ## Example[​](#example "Direct link to Example") dialogAccept.js ``` // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { console.log(dialog.message()); // prints: 'Hello, world!' await dialog.accept(); }); // Or accept a prompt dialog with text browser.on('dialog', async (dialog) => { if (dialog.type() === 'prompt') { await dialog.accept('my input'); } }); ``` --- # defaultValue If dialog is prompt, returns default prompt value. Otherwise, returns empty string. info Only works with browser dialogs (via BiDi protocol). Native mobile dialogs do not expose a default value through WebDriver. Use [`browser.acceptDialog`](/docs/api/mobile/acceptDialog.md) or [`browser.dismissDialog`](/docs/api/mobile/dismissDialog.md) to handle them. ## Usage[​](#usage "Direct link to Usage") ``` await dialog.defaultValue() ``` ## Example[​](#example "Direct link to Example") dialogDefaultValue.js ``` // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { if (dialog.type() === 'prompt') { const value = await dialog.defaultValue(); console.log(value); // prints the default prompt value } }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`returns`:** The default prompt value, or empty string if not a prompt. --- # dismiss Dismisses the dialog and returns when the dialog has been handled. info Only works with browser dialogs (via BiDi protocol). For mobile native dialogs, use [`browser.dismissDialog`](/docs/api/mobile/dismissDialog.md) instead. ## Usage[​](#usage "Direct link to Usage") ``` await dialog.dismiss() ``` ## Example[​](#example "Direct link to Example") dialogDismiss.js ``` // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { console.log(dialog.message()); // prints: 'Are you sure?' await dialog.dismiss(); }); ``` --- # message A message displayed in the dialog. info Only works with browser dialogs (via BiDi protocol). Native mobile dialogs do not expose their message through WebDriver. Use [`browser.acceptDialog`](/docs/api/mobile/acceptDialog.md) or [`browser.dismissDialog`](/docs/api/mobile/dismissDialog.md) to handle them. ## Usage[​](#usage "Direct link to Usage") ``` await dialog.message() ``` ## Example[​](#example "Direct link to Example") dialogMessage.js ``` // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { const message = await dialog.message(); console.log(message); // prints: 'Hello, world!' }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`returns`:** The message displayed in the dialog. --- # type Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`. info Only works with browser dialogs (via BiDi protocol). Native mobile dialogs do not expose a dialog type through WebDriver. Use [`browser.acceptDialog`](/docs/api/mobile/acceptDialog.md) or [`browser.dismissDialog`](/docs/api/mobile/dismissDialog.md) to handle them. ## Usage[​](#usage "Direct link to Usage") ``` await dialog.type() ``` ## Example[​](#example "Direct link to Example") dialogType.js ``` // Listen for the dialog event to get the dialog object browser.on('dialog', async (dialog) => { const type = await dialog.type(); console.log(type); // prints: 'alert', 'confirm', 'prompt', or 'beforeunload' }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`returns`:** The type of the dialog --- # The Element Object An Element Object is an object representing an element on the remote user agent, e.g. a [DOM Node](https://developer.mozilla.org/en-US/docs/Web/API/Element) when running a session within a browser or [a mobile element](https://developer.apple.com/documentation/swift/sequence/element) for mobile. It can be received using one of the many element query commands, e.g. [`$`](/docs/api/element/$.md), [`custom$`](/docs/api/element/custom$.md), [`react$`](/docs/api/element/react$.md) or [`shadow$`](/docs/api/element/shadow$.md). ## Properties[​](#properties "Direct link to Properties") An element object has the following properties: | Name | Type | Details | | ----------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sessionId` | `String` | Session id assigned from the remote server. | | `elementId` | `String` | Associated [web element reference](https://w3c.github.io/webdriver/#elements) that can be used to interact with the element on the protocol level | | `selector` | `String` | [Selector](/docs/selectors.md) used to query the element. | | `parent` | `Object` | Either the [Browser Object](/docs/api/browser.md) when element was fetched from the it (e.g. `const elem = browser.$('selector')`) or an [Element Object](/docs/api/element.md) if it was fetched from an element scope (e.g. `elem.$('selector')`) | | `options` | `Object` | WebdriverIO [options](/docs/configuration.md) depending on how the browser object was created. See more [setup types](/docs/setuptypes.md). | ## Methods[​](#methods "Direct link to Methods") An element object provides all methods from the protocol section, e.g. [WebDriver](/docs/api/webdriver.md) protocol as well as commands listed within the element section. Available protocol commands depend on the type of session. If you run an automated browser session, none of the Appium [commands](/docs/api/appium.md) will be available and vice versa. In addition to that the following commands are available: | Name | Parameters | Details | | ------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `addCommand` | - `commandName` (Type: `String`)
- `fn` (Type: `Function`) | Allows to define custom commands that can be called from the browser object for composition purposes. Read more in the [Custom Command](/docs/customcommands.md) guide. | | `overwriteCommand` | - `commandName` (Type: `String`)
- `fn` (Type: `Function`) | Allows to overwrite any browser command with custom functionality. Use carefully as it can confuse framework users. Read more in the [Custom Command](/docs/customcommands.md#overwriting-native-commands) guide. | ## Remarks[​](#remarks "Direct link to Remarks") ### Element Chain[​](#element-chain "Direct link to Element Chain") When working with elements WebdriverIO provides special syntax to simplify querying them and composite complex nested element lookups. As element objects allow you to find elements within their tree branch using common query methods, users can fetch nested elements as follows: ``` const header = await $('#header') const headline = await header.$('#headline') console.log(await headline.getText()) // outputs "I am a headline" ``` With deep nested structures assigning any nested element to an array to then use it can be quite verbose. Therefore WebdriverIO has the concept of chained element queries that allow fetching nested elements like this: ``` console.log(await $('#header').$('#headline').getText()) ``` This also works when fetching a set of elements, e.g.: ``` // get the text of the 3rd headline within the 2nd header console.log(await $$('#header')[1].$$('#headline')[2].getText()) ``` When working with a set of elements this can be especially useful when trying to interact with them, so instead of doing: ``` const elems = await $$('div') const locations = await Promise.all( elems.map((el) => el.getLocation()) ) ``` You can directly call Array methods on the element chain, e.g.: ``` const location = await $$('div').map((el) => el.getLocation()) ``` same as: ``` const divs = await $$('div') const location = await divs.map((el) => el.getLocation()) ``` WebdriverIO uses a custom implementation that supports asynchronous iterators under the hood so all commands from their API are also supported for these use cases. **Note:** all async iterators return a promise even if your callback doesn't return one, e.g.: ``` const divs = await $$('div') console.log(divs.map((div) => div.selector)) // ❌ returns "Promise[]" console.log(await divs.map((div) => div.selector)) // ✅ returns "string[]" ``` ### Custom Commands[​](#custom-commands "Direct link to Custom Commands") You can set custom commands on the browser scope to abstract away workflows that are commonly used. Check out our guide on [Custom Commands](/docs/customcommands.md#adding-custom-commands) for more information. --- # $ The `$` command is a short and handy way in order to fetch a single element on the page. info As opposed to the [`$`](/docs/api/browser/$.md) attached to the [browser object](/docs/api/browser.md) this command queries an element based on a root element. You can also pass in an object as selector where the object contains a property `element-6066-11e4-a52e-4f735466cecf` with the value of a reference to an element. The command will then transform the reference to an extended WebdriverIO element. Note: chaining `$` and `$$` commands only make sense when you use multiple selector strategies. You will otherwise make unnecessary requests that slow down the test (e.g. `$('body').$('div')` will trigger two request whereas `$('body div')` does literally the same with just one request) You can chain `$` or `$$` together without wrapping individual commands into `await` in order to walk down the DOM tree, e.g.: ``` const imageSrc = await $$('div')[1].nextElement().$$('img')[2].getAttribute('src') ``` WebdriverIO seamlessly traverses shadow roots when using the `$` or `$$` commands, regardless of the nesting level or shadow root mode, for example: ``` await browser.url('https://ionicframework.com/docs/usage/v8/datetime/basic/demo.html?ionic:mode=md') await browser.$('button[aria-label="Sunday, August 4"]').click() await browser.$('.aux-input').getValue() ``` info For more information on how to select specific elements, check out the [Selectors](/docs/selectors.md) guide. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).$(selector) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | --------------------------- | ------------------------------------------------------------------- | | `selector` | `String, Function, Matcher` | selector, JS Function, or Matcher object to fetch a certain element | ## Examples[​](#examples "Direct link to Examples") example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25) singleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L42-L46) $.js ``` it('should use Androids DataMatcher or ViewMatcher selector', async () => { const menuItem = await $({ "name": "hasEntry", "args": ["title", "ViewTitle"], "class": "androidx.test.espresso.matcher.ViewMatchers" }); await menuItem.click(); const menuItem = await $({ "name": "hasEntry", "args": ["title", "ViewTitle"] }); await menuItem.click(); }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # $$ The `$$` command is a short and handy way in order to fetch multiple elements on the page. It returns a `ChainablePromiseArray` containing a set of WebdriverIO elements. info As opposed to the [`$$`](/docs/api/browser/$$.md) attached to the [browser object](/docs/api/browser.md) this command queries elements based on a root element. You can chain `$` or `$$` together without wrapping individual commands into `await` in order to walk down the DOM tree, e.g.: ``` const imageSrc = await $$('div')[1].nextElement().$$('img')[2].getAttribute('src') ``` WebdriverIO seamlessly traverses shadow roots when using the `$` or `$$` commands, regardless of the nesting level or shadow root mode, for example: ``` await browser.url('https://ionicframework.com/docs/usage/v8/datetime/basic/demo.html?ionic:mode=md') await browser.$('button[aria-label="Sunday, August 4"]').click() await browser.$('.aux-input').getValue() ``` It is also possible to use async iterators to loop over the result of the query, e.g.: ``` // print all image sources for await (const img of $$('img')) { console.log(await img.getAttribute('src')) } ``` The result also provides asynchronous versions of the `Array` iteration methods, like `map` and `mapSeries`. See [Iterating over elements](/docs/api/browser/$$.md#iterating-over-elements) for how they work. info For more information on how to select specific elements, check out the [Selectors](/docs/selectors.md) guide. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).$$(selector) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | --------------------------- | ------------------------------------------------------------------- | | `selector` | `String, Function, Matcher` | selector, JS Function, or Matcher object to fetch multiple elements | ## Examples[​](#examples "Direct link to Examples") example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24) multipleElements.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L32-L39) ## Returns[​](#returns "Direct link to Returns") * **\** --- # addValue Add a value to an input or textarea element found by given selector. info If you like to use special characters, e.g. to copy and paste a value from one input to another, use the [`keys`](/docs/api/browser/keys.md) command with the [`Key`](/docs/api/modules.md#key) object. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).addValue(value, additional) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------ | ---------------- | --------------------------------- | | `value` | `string, number` | value to be added | | `additional` | `InputOptions` | options, exclusive to Webdriverio | ## Example[​](#example "Direct link to Example") addValue.js ``` it('should demonstrate the addValue command', async () => { let input = await $('.input') await input.addValue('test') await input.addValue(123) value = await input.getValue() assert(value === 'test123') // true }) ``` --- # clearValue Clear the value of an input or textarea element. Make sure you can interact with the element before using this command. You can't clear an input element that is disabled or in readonly mode. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).clearValue() ``` ## Example[​](#example "Direct link to Example") clearValue.js ``` it('should demonstrate the clearValue command', async () => { const elem = await $('.input') await elem.setValue('test123') const value = await elem.getValue() console.log(value) // returns 'test123' await elem.clearValue() value = await elem.getValue() assert(value === ''); // true }) ``` --- # click Click on an element. This issues a WebDriver `click` command for the selected element , which generally scrolls to and then clicks the selected element when no options are passed. When options object is passed it uses action class instead of webdriver click which give added capabilities like passing button type, coordinates etc. By default, when using options a release action command is send after performing the click action, pass `option.skipRelease=true` to skip this action. info If you have fixed-position elements (such as a fixed header or footer) that cover up the selected element after it is scrolled within the viewport, the click will be issued at the given coordinates, but will be received by your fixed (overlaying) element. In these cased the following error is thrown: ``` Element is not clickable at point (x, x). Other element would receive the click: ..." ``` To work around this, try to find the overlaying element and remove it via `execute` command so it doesn't interfere the click. You also can try to scroll to the element yourself using `scroll` with an offset appropriate for your scenario. info The click command can also be used to simulate a long press on a mobile device. This is done by setting the `duration`. See the example below for more information. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).click({ button, x, y, skipRelease, duration }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | `options`
*optional* | `ClickOptions` | Click options (optional) | | `options.button`
*optional* | `string, number` | Can be one of `[0, "left", 1, "middle", 2, "right"]`
**WEB-ONLY** (Desktop/Mobile) | | `options.x`
*optional* | `number` | Clicks X horizontal pixels away from location of the element (from center point of element)
**WEB and Native** (Desktop/Mobile) | | `options.y`
*optional* | `number` | Clicks Y vertical pixels away from location of the element (from center point of element)
**WEB and Native support** (Desktop/Mobile) | | `options.skipRelease`
*optional* | `boolean` | Boolean (optional)
**WEB-ONLY** (Desktop/Mobile) | | `options.duration`
*optional* | `number` | Duration of the click, aka "LongPress"
**MOBILE-NATIVE-APP-ONLY** (Mobile) | ## Examples[​](#examples "Direct link to Examples") example.html ```
I was not clicked
``` click.js ``` it('should demonstrate the click command', async () => { const myButton = await $('#myButton') await myButton.click() const myText = await $('#someText') const text = await myText.getText() assert(text === 'I was clicked') // true }) ``` example.js ``` it('should fetch menu links and visit each page', async () => { const links = await $$('#menu a') await links.forEach(async (link) => { await link.click() }) }) ``` example.html ``` ``` example.js ``` it('should demonstrate a click using an offset', async () => { const myButton = await $('#myButton') await myButton.click({ x: 30 }) // clicks 30 horizontal pixels away from location of the button (from center point of element) }) ``` example.html ``` ``` example.js ``` it('should demonstrate a right click passed as string', async () => { const myButton = await $('#myButton') await myButton.click({ button: 'right' }) // opens the contextmenu at the location of the button }) it('should demonstrate a right click passed as number while adding an offset', async () => { const myButton = await $('#myButton') await myButton.click({ button: 2, x: 30, y: 40 }) // opens the contextmenu 30 horizontal and 40 vertical pixels away from location of the button (from the center of element) }) it('should skip sending releaseAction command that cause unexpected alert closure', async () => { const myButton = await $('#myButton') await myButton.click({ button: 2, x: 30, y: 40, skipRelease:true }) // skips sending releaseActions }) ``` longpress.example.js ``` it('should be able to open the contacts menu on iOS by executing a longPress', async () => { const contacts = await $('~Contacts') // opens the Contacts menu on iOS where you can quickly create // a new contact, edit your home screen, or remove the app await contacts.click({ duration: 2000 }) }) ``` --- # custom$ The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`. Read more on custom selector stratgies in the [Selector docs](/docs/selectors.md#custom-selector-strategies). ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).custom$(strategyName, strategyArguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------- | -------- | ------- | | `strategyName` | `string` | | | `strategyArguments` | `*` | | ## Examples[​](#examples "Direct link to Examples") customStrategy.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L2-L11) example.html ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/example.html#L8-L12) customStrategy.js ``` loading... ``` [View on GitHub](https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L16-L19) example.js ``` it('should fetch the project title', async () => { await browser.url('https://webdriver.io') await browser.addLocatorStrategy('myStrat', (selector) => { return document.querySelectorAll(selector) }) const header = await browser.custom$('myStrat', 'header') const projectTitle = await header.custom$('myStrat', '.projectTitle') console.log(projectTitle.getText()) // WEBDRIVER I/O }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # custom$$ The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`. Read more on custom selector stratgies in the [Selector docs](/docs/selectors.md#custom-selector-strategies). ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).custom$$(strategyName, strategyArguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------------------- | -------- | ------- | | `strategyName` | `string` | | | `strategyArguments` | `*` | | ## Example[​](#example "Direct link to Example") example.js ``` it('should get all the plugin wrapper buttons', async () => { await browser.url('https://webdriver.io') await browser.addLocatorStrategy('myStrat', (selector) => { return document.querySelectorAll(selector) }) const pluginRowBlock = await browser.custom$('myStrat', '.pluginRowBlock') const pluginWrapper = await pluginRowBlock.custom$$('myStrat', '.pluginWrapper') console.log(pluginWrapper.length) // 4 }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # doubleClick Double-click on an element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).doubleClick() ``` ## Examples[​](#examples "Direct link to Examples") example.html ```
I was not clicked
``` doubleClick.js ``` it('should demonstrate the doubleClick command', async () => { const myButton = await $('#myButton') await myButton.doubleClick() const value = await myButton.getText() assert(value === 'I was dblclicked') // true }) ``` --- # dragAndDrop Drag an item to a destination element or position. info The functionality of this command highly depends on the way drag and drop is implemented in your app. If you experience issues please post your example in [#4134](https://github.com/webdriverio/webdriverio/issues/4134). ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).dragAndDrop(target, { duration }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------------------- | -------------------------------- | ----------------------------------------------------- | | `target` | `Element, DragAndDropCoordinate` | destination element or object with x and y properties | | `options`
*optional* | `DragAndDropOptions` | dragAndDrop command options | | `options.duration`
*optional* | `Number` | how long the drag should take place | ## Example[​](#example "Direct link to Example") example.test.js ``` it('should demonstrate the dragAndDrop command', async () => { const elem = $('#someElem') const target = $('#someTarget') // drag and drop to other element await elem.dragAndDrop(target) // drag and drop relative from current position await elem.dragAndDrop({ x: 100, y: 200 }) }) ``` --- # execute Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame using the given element as scope, because it is on the element scope it means that WebdriverIO will automatically wait for the element to exist before executing the script. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client. The script argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).execute(script, arguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------- | ------------------ | ---------------------- | | `script` | `String, Function` | The script to execute. | | `arguments`
*optional* | `*` | script arguments | ## Example[​](#example "Direct link to Example") execute.js ``` it('should wait for the element to exist, then executes javascript on the page with the element as first argument', async () => { const text = await $('div').execute((elem, a, b, c, d) => { return elem.textContent + a + b + c + d }, 1, 2, 3, 4); // node.js context - client and console are available console.log(text); // outputs "Hello World1234" }); ``` ## Returns[​](#returns "Direct link to Returns") * **<\*>** **`return`:** The script result. --- # executeAsync warning The `executeAsync` command is deprecated and will be removed in a future version. Please use the `execute` command instead as it provides better support for error handling via `async`/`await`. Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame using the given element as scope, because it is on the element scope it means that WebdriverIO will automatically wait for the element to exist before executing the script. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client. Asynchronous script commands may not span page loads. If an unload event is fired while waiting for a script result, an error should be returned to the client. The script argument defines the script to execute in the form of a function body. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished. Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects. caution Please use `execute` instead ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).executeAsync(script, arguments) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------------------- | ------------------ | ---------------------- | | `script` | `String, Function` | The script to execute. | | `arguments`
*optional* | `*` | script arguments | ## Examples[​](#examples "Direct link to Examples") executeAsync.js ``` it('should wait for the element to exist, then executes async javascript on the page with the element as first argument', async () => { await browser.setTimeout({ script: 5000 }) const text = await $('div').execute((elem, a, b, c, d) => { // browser context - you may not access client or console setTimeout(() => { done(elem.textContent + a + b + c + d) }, 3000); }, 1, 2, 3, 4); // node.js context - client and console are available console.log(text); // outputs "Hello World1234" }); ``` executeAsync.ts ``` it('should wait for the element to exist, then executes async javascript on the page with the element as first argument', async () => { await browser.setTimeout({ script: 5000 }) // explicitly type the return value of the script to ensure type safety const text: number = await $('div').execute((elem, a, b, c, d) => { // browser context - you may not access client or console setTimeout(() => { done(elem.textContent + a + b + c + d) }, 3000); }, 1, 2, 3, 4); // node.js context - client and console are available console.log(text); // outputs "Hello World1234" }); ``` ## Returns[​](#returns "Direct link to Returns") * **<\*>** **`return`:** The script result. --- # getAttribute Get an attribute from a DOM-element based on the attribute name. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getAttribute(attributeName) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------- | -------- | ------------------- | | `attributeName` | `string` | requested attribute | ## Examples[​](#examples "Direct link to Examples") index.html ```
``` getAttribute.js ``` it('should demonstrate the getAttribute command', async () => { const form = await $('form') const attr = await form.getAttribute('method') console.log(attr) // outputs: "post" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** The value of the attribute, or null if it is not set on the element. --- # getComputedLabel Get the computed WAI-ARIA label of an element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getComputedLabel() ``` ## Example[​](#example "Direct link to Example") getComputedLabel.js ``` it('should demonstrate the getComputedLabel command', async () => { await browser.url('https://www.google.com/ncr') const elem = await $('*[name="q"]'); console.log(await elem.getComputedLabel()); // outputs: "Search" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** the computed WAI-ARIA label --- # getComputedRole Get the computed WAI-ARIA label of an element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getComputedRole() ``` ## Example[​](#example "Direct link to Example") getComputedRole.js ``` it('should demonstrate the getComputedRole command', async () => { await browser.url('https://www.google.com/ncr') const elem = await $('*[name="q"]'); console.log(await elem.getComputedRole()); // outputs: "combobox" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** the computed WAI-ARIA label --- # getCSSProperty Get a css property from a DOM-element selected by given selector. The return value is formatted to be testable. Colors gets parsed via [rgb2hex](https://www.npmjs.org/package/rgb2hex) and all other properties get parsed via [css-value](https://www.npmjs.org/package/css-value). info Note that shorthand CSS properties (e.g. `background`, `font`, `border`, `margin`, `padding`, `list-style`, `outline`, `pause`, `cue`) will be expanded to fetch all longhand properties resulting in multiple WebDriver calls. If you are interested in a specific longhand property it is recommended to query for that instead. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getCSSProperty(cssProperty, pseudoElement) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | --------------- | --------------- | ------------------ | | `cssProperty` | `string` | css property name | | `pseudoElement` | `PseudoElement` | css pseudo element | ## Examples[​](#examples "Direct link to Examples") example.html ``` ``` getCSSProperty.js ``` it('should demonstrate the getCSSProperty command', async () => { const elem = await $('#myLabel') const color = await elem.getCSSProperty('color') console.log(color) // outputs the following: // { // property: 'color', // value: 'rgba(0, 136, 204, 1)', // parsed: { // hex: '#0088cc', // alpha: 1, // type: 'color', // rgba: 'rgba(0, 136, 204, 1)' // } // } const font = await elem.getCSSProperty('font-family') console.log(font) // outputs the following: // { // property: 'font-family', // value: 'helvetica', // parsed: { // value: [ 'helvetica', 'arial', 'freesans', 'clean', 'sans-serif' ], // type: 'font', // string: 'helvetica, arial, freesans, clean, sans-serif' // } // } var width = await elem.getCSSProperty('width', '::before') console.log(width) // outputs the following: // { // property: 'width', // value: '100px', // parsed: { // type: 'number', // string: '100px', // unit: 'px', // value: 100 // } // } }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** The specified css of the element --- # getElement Access `WebdriverIO.Element` properties like `selector` or `elementId` from the element reference. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getElement() ``` ## Example[​](#example "Direct link to Example") getElement.ts ``` it('should allow me to inspect WebdriverIO.Element properties', async () => { const elem = await $('#elem').getElement(); console.log(elem.selector); // outputs: '#elem' }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # getElements Access `WebdriverIO.ElementArray` properties like `length` or `selector` from the elements reference. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getElements() ``` ## Example[​](#example "Direct link to Example") getElements.ts ``` it('should allow me to inspect WebdriverIO.Element properties', async () => { const divs = await $$('div').getElements(); console.log(divs.length); // outputs: 43 }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** --- # getHTML Get source code of specified DOM element by selector. By default, it automatically pierces through all shadow roots of elements contained by the element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getHTML({ includeSelectorTag, pierceShadowRoot, removeCommentNodes, prettify }) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | -------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------- | | `options` | `GetHTMLOptions` | command options | | `options.includeSelectorTag`
*optional* | `boolean` | if true it includes the selector element tag (default: `true`) | | `options.pierceShadowRoot`
*optional* | `boolean` | if true it includes content of the shadow roots of all web components in the DOM (default: `true`) | | `options.removeCommentNodes`
*optional* | `boolean` | if true it removes all comment nodes from the HTML, e.g. `` (default: `true`) | | `options.prettify`
*optional* | `boolean` | if true, the html output will be prettified (default: `true`) | ## Examples[​](#examples "Direct link to Examples") index.html ```
Lorem ipsum dolor amet
``` getHTML.js ``` it('should get html for certain elements', async () => { var outerHTML = await $('#test').getHTML(); console.log(outerHTML); // outputs: // "
Lorem ipsum dolor amet
" var innerHTML = await $('#test').getHTML({ includeSelectorTag: false }); console.log(innerHTML); // outputs: // "Lorem ipsum dolor amet" }); ``` getHTMLShadow\.js ``` it('allows to snapshot shadow dom', async () => { await browser.url('https://ionicframework.com/docs/usage/v8/button/basic/demo.html?ionic:mode=md') // get snapshot of web component without its styles const snapshot = await $('ion-button').getHTML({ excludeElements: ['style'] }) // assert snapshot await expect(snapshot).toMatchInlineSnapshot(` Default `) }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** the HTML of the specified element (as a string) --- # getLocation Determine an element’s location on the page. The point (0, 0) refers to the upper-left corner of the page. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getLocation(prop) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ------ | -------- | ---------------------------------------------------------------------- | | `prop` | `string` | can be "x" or "y" to get a result value directly for easier assertions | ## Example[​](#example "Direct link to Example") getLocation.js ``` it('should demonstrate the getLocation function', async () => { await browser.url('http://github.com'); const logo = await $('.octicon-mark-github') const location = await logo.getLocation(); console.log(location); // outputs: { x: 150, y: 20 } const xLocation = await logo.getLocation('x') console.log(xLocation); // outputs: 150 const yLocation = await logo.getLocation('y') console.log(yLocation); // outputs: 20 }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** The X and Y coordinates for the element on the page `{x:number, y:number}` --- # getProperty The Get Element Property command will return the result of getting a property of an element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getProperty(property) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------- | -------- | ---------------------------- | | `property` | `string` | name of the element property | ## Example[​](#example "Direct link to Example") getProperty.js ``` it('should demonstrate the getProperty command', async () => { var elem = await $('body') var tag = await elem.getProperty('tagName') console.log(tag) // outputs: "BODY" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** the value of the property of the selected element --- # getSize Get the width and height for an DOM-element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getSize(prop) ``` ## Parameters[​](#parameters "Direct link to Parameters") | Name | Type | Details | | ---------------------- | -------- | ------------------------------------------------- | | `prop`
*optional* | `String` | size to receive \[optional] ("width" or "height") | ## Example[​](#example "Direct link to Example") getSize.js ``` it('should demonstrate the getSize command', async () => { await browser.url('http://github.com') const logo = await $('.octicon-mark-github') const size = await logo.getSize() console.log(size) // outputs: { width: 32, height: 32 } const width = await logo.getSize('width') console.log(width) // outputs: 32 const height = await logo.getSize('height') console.log(height) // outputs: 32 }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** requested element size (`{ width: , height: }`) or actual width/height as number if prop param is given --- # getTagName Get tag name of a DOM-element. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getTagName() ``` ## Examples[​](#examples "Direct link to Examples") index.html ```
Lorem ipsum
``` getTagName.js ``` it('should demonstrate the getTagName command', async () => { const elem = await $('#elem'); const tagName = await elem.getTagName(); console.log(tagName); // outputs: "div" }) ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** the element's tag name, as a lowercase string --- # getText Get the text content from a DOM-element. Make sure the element you want to request the text from [is interactable](http://www.w3.org/TR/webdriver/#interactable) otherwise you will get an empty string as return value. If the element is disabled or not visible and you still want to receive the text content use [getHTML](https://webdriver.io/docs/api/element/getHTML) as a workaround. ## Usage[​](#usage "Direct link to Usage") ``` await $(selector).getText() ``` ## Examples[​](#examples "Direct link to Examples") index.html ```
Lorem ipsum dolor sit amet,
consetetur sadipscing elitr
I am invisible ``` getText.js ``` it('should demonstrate the getText function', async () => { const elem = await $('#elem'); console.log(await elem.getText()); // outputs the following: // "Lorem ipsum dolor sit amet,consetetur sadipscing elitr" const span = await $('span'); console.log(await span.getText()); // outputs "" (empty string) since element is not interactable }); it('get content from table cell', async () => { await browser.url('http://the-internet.herokuapp.com/tables'); const rows = await $$('#table1 tr'); const columns = await rows[1].$$('td'); // get columns of 2nd row console.log(await columns[2].getText()); // get text of 3rd column }); ``` ## Returns[​](#returns "Direct link to Returns") * **\** **`return`:** content of selected element (all HTML tags are removed) --- # getValue Get the value of a `