Starting your iOS app with Process Arguments in Appium

mjm_
2 min readJun 8, 2019

Currently I’m working on a project where we have created a white labelled news app solution for our customers. Our customers are newspaper brands in both the Netherlands and Belgium which use our product to inform readers with the latest news, columns, live blogs etc…

Because we are working with a white labelled app solution for multiple brands we wanted to limit our build times as much as possible. One of the changes that we have made is only building production builds, instead of also building test builds for QA purposes. This reduced build times drastically but in order to test our product we needed test data, which is not available on the production servers.

We needed to find a way to let our Appium test scripts work on the production builds while being able to access test data that is located at a different endpoint. Appium provides the processArguments capability, that allows an automation script to pass command-line arguments and environment variables to the AUT. We teamed up with our iOS developers and asked them if they can provide us with such arguments. Such arguments in iOS are called Launch Arguments. Our iOS developers created the launch argument: setEndpointToTestServer. We provide this launch argument including the location for our test data in our runner set up. The application will launch with the given processArguments and sets the endpoint to the location of our test data.

See the below code example:

With the use of processArguments we can launch our AUT in any desired state given the fact that the Launch Arguments are available within the iOS app.

In my next blog post I will show you how to realise this for Android by using the startActivity command.

--

--