aws-api-gatewayaws-device-farm

AWS DeviceFarm: How to access test.parameters passed to "ScheduleRun" API


Does anyone know how to access the test.parameters key-value pairs passed as input to the ScheduleRun API?

This is what I am doing:

  1. Passing the input for the test to be run under test.filter.
  2. Passing the parameters I need for my test under test.parameters. I have ensured it is a valid JSON object.
  3. I am not passing any yaml file, so a "standard" test run gets triggered on DeviceFarm.

Here is my code that I use to retrieve the data:

final Bundle bundle = InstrumentationRegistry.getArguments();
for (final String key : bundle.keySet())
{
    final Object obj = bundle.get(key);
    Log.i(TAG, "Key - '" + key + "' ; Value - '" + obj.toString() + "'");
}

I know the test.filter part works because the InstrumentationRegistry.getArguments() bundle is able to retrieve the class value which is the test that needs to be run. Unfortunately, the test.parameters values are not present in the bundle.

Is there anything that I am missing or should I use some other mechanism to retrieve the test.parameters ?


Solution

  • Got confirmation from the AWS team that, at this point, they don't support this feature for Custom environments.