Skip to main content
🇺🇦  We stand with the people of Ukraine. We encourage compassion, and hope for peace.   🇺🇦
Please support humanitarian efforts for the Ukraine crisis through the International Committee of the Red Cross! #StandWithUkraine

getCurrentActivity

Get the name of the current Android activity.

Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the mobile: execute method.

Usage
browser.getCurrentActivity()
Example
getCurrentActivity.js
it('should get the current Android activity', async () => {
const activity = await browser.getCurrentActivity()
console.log('Current activity:', activity)
})
Returns
  • <Promise<string>> returns: The name of the current Android activity
Support

Support for android

note

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot
Morty Proxy This is a proxified and sanitized view of the page, visit original site.