Appium 1.2.3 has a new Android-only feature, “Start Activity.” It allows you to start an arbitrary activity at test time. If the activity is part of an application different from the application currently under test, “Start Activity” will also start the activity’s application. Nice!
The “Start Activity” feature requires two arguments, appPackage
and appActivity
. You can optionally provide “wait” activities via appWaitPackage
and appWaitActivity
, the same way you can when launching the application under test. Here’s how easy it is to start the activity ".Foo":
Start Activity
Open an activity in the current app or start a new app and open an activity Android only
// java
driver.startActivity("appPackage","com.example.android.apis", null, null);
// javascript
driver.startActivity({appPackage: 'com.example.android.apis', appActivity: '.Foo'}, cb);
# python
driver.start_activity('com.example.android.apis', '.Foo')
# ruby
start_activity app_package: 'io.appium.android.apis', app_activity: '.accessibility.AccessibilityNodeProviderActivity'
// c#
driver.StartActivity("com.example.android.apis", ".Foo");
// php
$this->startActivity(array("appPackage" => "com.example.android.apis",
"appActivity" => ".Foo"));