To ultilize TestNG parameters in TestNG Test Suite file (.xml) for parallel executions without wasting efforts to handle desired capabilities initializations. See its actual usage in this repository
Upon TestRunner execution:
- Dynamic desired capabilities are retrieved using MobileDeviceInfo. Applicable for both Android and iOS
- TestNG suite file (.xml) is generated based on the FreeMaker template through TestRunner. This template file includes necessary desired capabilities (platformName, systemPort, deviceId, deviceVersion, deviceName) placeholder which are passed from the above step
- TestRunner will execute generated .xml file using its native TestNG runner. This suite is contrusted from the sample test
Execute generateTestSuiteXml
test in TestRunner
Followed this sample project, you will have an approach to resolve your issue with including the dynamic desired capabilites generated from MobileDeviceInfo to be usable in TestSuite file with the help of FreeMaker
- Generalize this solution, maybe a maven plugin
- Add solutions for cloud service providers, such as SauceLabs, BrowserStacks, pCloudy