You can define the mobile device that is used for the replay of a test in the following ways:
- If you execute a test from the UI of
Silk4J and the
Select Mobile Device dialog box displays, the mobile device,
Android Emulator, or
iOS Simulator that is selected in the dialog box is used, and
Silk4J ignores which mobile device is set in the test script.
- If the
Select Mobile Device dialog box is disabled, because the
Don't show again check box is checked, the application configurations in the individual test scripts determine the mobile device that is used
to execute the tests.
Note: To re-enable the
Select Mobile Device dialog box, click
and check the
Show 'Select Mobile Device' dialog before record and playback check box
- If you execute a script from the command line or from a Continuous Integration (CI) server, specify the connection string
in the application configuration of the script.
To overwrite the mobile device that is specified in the application configuration, use the
silktest.configurationName environment variable.
- If you execute a test from
Silk Central, specify the mobile device in the
Mobile Device Selection area of the
Deployment tab of the execution definition in
Silk Central instead of specifying a connection string. For additional information, refer to the
Silk Central Help.
You can use the connection string to specify a specific mobile device, or you can filter a subset of the available devices,
for example if you have a device pool. The first matching device is used for replay. If not specified otherwise, mobile devices
are matched by using the following rules, with declining priority:
- Matching mobile devices connected to the local machine are preferred over mobile devices connected to remote locations.
- If the browser type is specified in the connection string, newer browser versions are preferred over older versions.
- Newer platforms are preferred over older platforms.
- A physical device is preferred to an Emulator or Simulator.
- A device with a device name that is alphabetically later is preferred. For example, a device named "iphone 6" is preferred
to a device named "iphone 5".
Example: Connection string for an app on an
Android device that is connected to a remote machine
To test the app
MyApp.apk on an
Android device that is connected to a remote machine, the connection string would look like the following:
"platformName=Android;deviceName=MotoG3;host=http://10.0.0.1;app=MyApp.apk"
Example: Connection string for an app on an
iOS Simulator on a Mac
"platformName=iOS;platformVersion=10.0;deviceName=iPhone6;host=10.0.0.1;app=MyApp.ipa;isSimulator=true"