Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start an activity using a specific intent #2026

Closed
ytonthat opened this issue Mar 10, 2014 · 11 comments
Closed

Start an activity using a specific intent #2026

ytonthat opened this issue Mar 10, 2014 · 11 comments
Assignees
Labels
Android related to Android-native driver(s) Enhancement feature
Milestone

Comments

@ytonthat
Copy link

I would like to be able to specify an intent when starting an activity upon launching an Android app

The information that I would like to set in the intent is:

  • Action
  • Category
  • Extras (string data as a key-value pair)

I would also like to be allowed to set this information in the implementation of test methods as desired capabilities

@jlipps
Copy link
Member

jlipps commented Mar 24, 2014

Can you give me an example of what you'd like to do? Seems like a useful feature.

@jlipps jlipps modified the milestones: Appium 1.0 Feature Complete, Appium 1.1 Mar 24, 2014
@ytonthat
Copy link
Author

The application is an Android app. As you probably know, the emulator is quite slow. We already have methods for testing navigation and wish bypass it as much as possible in other tests. We believe this will save a lot of time when confronted with hundreds of tests to run.

To bypass navigation, we want to start the activity under test when creating the remote web driver and use an intent to pass user credentials in order to avoid logging in with the UI.

@ytonthat
Copy link
Author

Please let me know if you can think of an alternative to intents :)

@jlipps
Copy link
Member

jlipps commented Mar 25, 2014

I get the use case, it's more that I was looking for a specific example so I can make sure the interface is designed correctly.

I.e., what would you be doing with adb to get to the intent you want pre- or mid-test

@ytonthat
Copy link
Author

I have a service with members that allow me to navigate to specific screens mid-test. If the service had access to adb, it would execute the following command to bypass the log on screen:

adb shell am start -n |activity_name| -a |action_name| --es server |server_string_value| --es username |username_string_value| --es password |password_string_value| --ez usesecurecomm |usesecurecomm_boolean_value|

The extras are the values the app needs to perform a log on before rendering the user interface

I was thinking that Appium could expose an additional mobile method to start a new activity

Sorry for the late reply!

@jlipps jlipps modified the milestones: Appium 1.1, Appium 1.0 Release Mar 29, 2014
@paymand
Copy link
Member

paymand commented Apr 12, 2014

@ytonthat: All you need to do is to append the <INTENT> argument to the app-activity cap:

caps["app-activity"] = "app.apk <INTENT>"

I'm using this approach to start the app with an intent :)

@jlipps
Copy link
Member

jlipps commented Apr 14, 2014

Ha, this was not an intentional feature

@jlipps
Copy link
Member

jlipps commented Jun 3, 2014

let's go ahead and add a appIntent capability that gets added to the app launch command appropriately when we start the app

@moizjv
Copy link
Member

moizjv commented Jun 5, 2014

@paymand can you please elaborate on <INTENT> may be with an example that would help in designing a better interface.

@Jonahss
Copy link
Member

Jonahss commented Jun 11, 2014

this might help
https://gist.github.com/qube81/1148734

@lock
Copy link

lock bot commented May 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android related to Android-native driver(s) Enhancement feature
Projects
None yet
Development

No branches or pull requests

6 participants