I am passing arguments from runner through gradle and using them in my androidTest.
''' e;g:
In build.gradle:
android {
defaultConfig {
testInstrumentationRunnerArguments 'FOO' :'foo'
}
}
In androidTest/foo.java
username= androidx.test.platform.app.InstrumentationRegistry.getArguments().getString("FOO");
The test is working locally, but when running in Firebase TestLab, I am getting a null pointer exception and tests failing when I am trying to access argument with key=FOO. Can you please help me with this issue.
I do not want to use CLI. If there is a way I can do this using android studio and firebase testlab web UI, please let me know.
You can pass them in by running tests thru the command line:
Use the
--environment-variables
option.