1e41f4b71Sopenharmony_ci# AbilityDelegatorArgs 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciAbilityDelegatorArgs模块提供在应用程序执行测试用例期间,获取测试用例参数AbilityDelegatorArgs对象的能力。 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **说明:** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> 本模块接口仅可在<!--RP1-->[自动化测试框架arkxtest](../../application-test/arkxtest-guidelines.md)<!--RP1End-->中使用。 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci## 导入模块 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci```ts 14e41f4b71Sopenharmony_ciimport { abilityDelegatorRegistry } from '@kit.TestKit'; 15e41f4b71Sopenharmony_ci``` 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci## 使用说明 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci通过AbilityDelegatorRegistry中[getArguments](js-apis-app-ability-abilityDelegatorRegistry.md#abilitydelegatorregistrygetarguments)方法获取。 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci## AbilityDelegatorArgs 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci测试参数信息 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci| 名称 | 类型 | 可读 | 可写 | 说明 | 30e41f4b71Sopenharmony_ci| ------------------- | ---------------------- | ---- | ---- | ------------------------------------------------------------ | 31e41f4b71Sopenharmony_ci| bundleName | string | 是 | 是 | 当前被测试应用的包名 | 32e41f4b71Sopenharmony_ci| parameters | Record\<string, string> | 是 | 是 | 当前启动单元测试的参数 | 33e41f4b71Sopenharmony_ci| testCaseNames | string | 是 | 是 | 测试用例名称 | 34e41f4b71Sopenharmony_ci| testRunnerClassName | string | 是 | 是 | 执行测试用例的测试执行器名称 | 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci**示例:** 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci```ts 39e41f4b71Sopenharmony_ciimport { abilityDelegatorRegistry } from '@kit.TestKit'; 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_cilet args: abilityDelegatorRegistry.AbilityDelegatorArgs = abilityDelegatorRegistry.getArguments(); 42e41f4b71Sopenharmony_ci``` 43