vendredi 22 novembre 2019

How to run Android UI Tests and pass arguments to the App/Activity

I want to run UI tests for Android app with some predefined data which will vary depending on the test case. In iOS, it's possible to pass arguments to the tested app like this:

app = XCUIApplication()
app.reset()
app.launchArguments += ["--myArgument"]
app.launch()

These arguments are later available inside the app process.

Is there something similar for Android UI testing? Best way would to access these arguments via intent's extras.

getIntent().getExtras().getString(key)

Thanks for help!

Aucun commentaire:

Enregistrer un commentaire