Record the script Configure runtime settings Enhance your script Run test Set up the environment

Record scripts

You can record a typical business process on a mobile device using the TruClient -Mobile Center integration.

Create a script and connect to a server

  1. Make sure you have prepared your system for Mobile Center integration, as described in Get started with performance testing.
  2. Open an existing TruClient–Native Mobile script or create a new one.

  3. The TruClient window opens. Make sure the Mobile Center tab is selected in the bottom of the pane.

    Tip: For all the arguments in the browser window, you can use parameters instead of actual values. Use the drop-down box in each argument field to indicate whether the text in the field is an actual value or a parameter . If you indicate a parameter, you define it separately in VuGen . For details, see Enhance scripts.

  4. Expand the top section, Connect to Mobile Center Server.


    Expand the Arguments section, and manually fill in the server information. If you have already entered the server information in the General Settings, it should appear in the fields. If you recently made changes in the TruClient General Settings dialog box, click the Import button to bring those settings into your script.

    To specify a timeout for the connection to the server, other than the default value of 30 seconds, expand the Step section and specify a value.

  5. Click the Connect button to establish a connection with the server. A check mark to the left of the section indicates success.

Back to top

Choose a device and apps

Before recording your actions, you choose a device and one or more apps for your script. The Mobile Center wizard lets you select all of the items for your configuration flow, from a single window. For details, see the Mobile Center Wizard.

  1. Open the wizard.

    Expand the Prepare mobile device section, and click the Mobile Configuration wizard button . This wizard lets you configure the entire test flow. The DEVICE tab opens. If you know your device's ID, you can enter it directly into the Arguments section, without opening the wizard.

  2. Choose a device.

    You can select a device based on its capabilities or a specific device by its ID or name. The default selection method is Choose Capabilities,

    1. To use the default selection method, Choose Capabilities, select your requirements in the CREATE RULE page.

      Tip: To quickly create a rule based on an existing device, click the Fill Capabilities button , visible when you hover over an active device.

      (Devices on the Amazon Device Farm can only be selected by Capabilities.)

    2. To select a specific device (not available for Amazon Device Farm devices), click the Choose Specific Device tab in the left pane and select a device.
  3. Add applications.

    If you only plan to test system apps or the Home screen, you do not need to install any apps and you can skip to the next step.

    1. Click the APPS tab, which is only available after you have selected a device. Select one or more apps. For details, see View, upload, and manage apps.
    2. If you do not see the app you want to test in the APPS page, click the Upload app card to add it. When you upload an app, Mobile Center also creates a packaged version of the app with the libraries that are required for testing.
    3. Click SAVE AND CLOSE in the top right corner.
  4. Fine tune your device settings.

    1. In the TruClient window, expand the Select device's Arguments node. Review the argument values.
    2. To replace a value with a parameter, click the drop-down arrow to the right of the field and select the Parameter icon . You can create a parameter through VuGen or from the right-click menu item Create new parameter from selection.
    3. If you are using parameters, click on the Parameter icon to open the Arguments Editor window. Enter values for the parameter, with each value on a separate line.
  5. Fine tune your app settings.

    1. In the TruClient window, expand the Install Applications section. The selected apps are listed.
    2. Click on each application, and expand its Arguments node. Review the argument values. TruClient distinguishes between apps by their Logical names, so make sure all of your apps have unique names, To change a logical name, click the Rename icon .

      We recommend that you use the latest version and latest upload number for your app, to avoid incompatibility with new versions. To use these values, click the Use Default icon in the Version and Upload fields.


    3. To replace a value with a parameter, click the drop-down arrow to the right of the field and select the Parameter icon . Click on the Parameter icon to open the Arguments Editor window. Enter values for the parameter, with each value on a separate line.
    4. Indicate if you want to use the packaged (instrumented) or non-packaged (default) version of the app. For details about packaged vs. non-packaged apps, see the Mobile Center help.

    5. To exclude a specific app for this test, click the Enable/Disable during replay icon . This disables its loading during replay and helps conserve resources.
    6. To delete an app from the list of installed apps, hover over it and select Delete from the right-click menu.

For detailed instructions, considerations, and limitations, see Lab Console and App packaging and signing services.

Back to top

Set the test options

Before launching the test, you specify which app should open at the beginning of the test. This can be the Home screen, a system app such as Calendar or Phone, or a non-system app that you installed in the previous section.

  1. In the Finalize and launch application section, click the expansion arrow adjacent to Launch Application.
  2. Click the wizard icon to open the Mobile Center wizard. In the wizard window, click the TEST OPTIONS tab (only available after you have selected a device and app).
  3. Indicate what you would like to launch upon the start of the test: the Home screen, an installed app, or a system app. For System or Mobile Center apps, select an app from the drop-down list.
  4. Indicate how to handle the installed apps: Install, Restart, or Uninstall for the test.

    For actual replay, you can specify a different behavior for the first and subsequent iterations. To set your preferences globally, see the Get started with performance testing. To set the replay preferences for this test only, see Runtime settings.

  5. Indicate the device metrics that you would like to gather during the test replay. Select Log if you want to generate a device log. To download the log, click the Download Log button in the remote view's Control Panel, available only during recording.

    Note: You can also select the metrics globally in the TruClient General settings.

  6. Click SAVE AND CLOSE.
  7. To review your settings, expand the Launch application's Arguments node, to open the Step editor.
  8. Click the Save button in the TruClient browser.

Back to top

Execute the flow and record a session

To register all of your choices in TruClient, and prepare for a recording, you must send the Mobile Center configuration to TruClient, using the Execute configuration flow button.

  1. Click the Execute configuration flow button on the TruClient toolbar. A check mark is displayed next to each of the sections as their values are verified. In the right pane, TruClient shows a remote view of your device and launches the app that you selected.

    • When you execute this flow, the device is locked on the Mobile Center server for your use.
    • If for some reason, you get disconnected from the server, or if your device reservation has ended, execute the configuration flow again.

    Note: If you allocated your devices from an Amazon Device Farm, this command will not be able to register devices and apps. To monitor the integration with AWS, run it in VuGen or from the LoadRunner Controller.

  2. In the TruClient window's Actions tab, click Record.

    Tip: To restart or reinstall the app before you start recording, select the relevant option from the menu in the TruClient toolbar. This can be helpful, for example, to reset the app, or if you want to start recording from the app's opening screen.

  3. Interact with the mobile device in the remote access window. As you perform actions, TruClient records the operations, and steps are added to the script.

    • In the Device Interactions section:
      • Use the Change orientation button to change the orientation of the device.
      • Use the Take Screenshot button to download a screenshot of the current screen to your local machine.
      • To send text to the device, click the Send text button.
    • Expand the Simulations section, and add simulated events such as Simulate incoming call, Simulate incoming SMS, and Simulate sending app to background.

    For more information about the available interactions and simulations, see the Device control panel.

    Note: If the remote access window fails to show the completion of an action on the device, for example, due to a network delay, TruClient still continues to record steps that you perform on the device itself.

  4. When you have finished recording your test, click Stop in the Actions tab.

Back to top

See also: