Running mobile tests on Android devices on BrowserStack Cloud

You can run mobile tests on the BrowserStack Cloud so that you can choose devices from a wide range of Android devices that are available for testing.

Before you begin

You must have completed the following tasks:
  • Recorded mobile tests. See Recording mobile tests for Android applications.
  • Set up your account to access the BrowserStack Cloud. You must have valid credentials such as the user name, either the host name or the URL of the BrowserStack cloud instance, and an API key to authenticate the connection. This key is available under ACCESS KEY in the BrowserStack dashboard.
  • Uploaded the .apk file of the Android application to the BrowserStack server for testing. For more information, refer to Live Testing in the BrowserStack documentation.
  • Installed the Android application that you want to test on the Android device.

About this task

When you run mobile tests, you can enable HCL OneTest UI to collect metrics for certain parameters of the resources used by the mobile applications or devices. You can select the Resource Monitoring option and set the time intervals for the collection of the metrics during the test run.

Procedure

  1. Open the UI Test perspective in HCL OneTest UI if it is not already open.
  2. Select the mobile test from the Test Navigator pane.

    The test window is displayed.

  3. Click Window > Preferences > Test > Test Execution > UI Test Playback.

    The UI Test Playback pane is displayed.

  4. Perform the following steps in the UI Test Playback pane:
    1. Click the Mobile Device Cloud tab.
    2. Select the BrowserStack host checkbox to enable the options on the BrowserStack Device Cloud Environment panel.
    3. Perform the actions as listed in the following table:
      Option Action
      Required
      BrowserStack host Enter the URL of the BrowserStack cloud instance.
      User Name Enter the user name of your BrowserStack account.
      API key

      Enter the API key of your BrowserStack Cloud account to authenticate the connection.

      Project Select the BrowserStack project from the drop-down list or an enter an appropriate name for the project with which you can identify the test run on the BrowserStack Cloud dashboard.
    4. Click Apply and Close.
      Note: When the connection with the BrowserStack Cloud instance is successful, the mobile devices that are on the BrowserStack Cloud are displayed in the Run using drop-down list.
  5. Click the Run Test play back a Web UI test icon.
    The Run Configuration dialog is displayed.
    Note: If you are using a compound test that contains mobile tests, you can specify the mobile device to play back the test for each mobile test.
  6. Select the mobile device to play back the test from the Run using list, and then click Next.

    The Advanced Playback Options dialog is displayed.

  7. Select the advanced playback options as required for the test run.
    The options are described in the following table:
    Option Action
    Global steps delay in milliseconds Select this checkbox and specify the duration of delay in milliseconds to set the delay between all the steps in the test.
    BrowserStack Project Select the BrowserStack project from the drop-down list or enter an appropriate name for the project with which you can identify the test run on the BrowserStack Cloud dashboard.

    When you select or specify a project in this drop-down list, the value overrides the project selected in Windows > Preferences > Test > Test Execution > UI Test Playback. Also, the selected value continues to display for the subsequent test runs.

  8. Click Next.

    The Performance Measurement dialog is displayed.

  9. Perform the following steps if you want HCL OneTest UI to collect the Resource Monitoring metrics during the test run:
    1. Select the Resource Monitoring option.
    2. Set the interval to collect the metrics by entering a number in the Polling interval field.
      Note: The minimum value that you can enter in the Polling interval field is 1000 milliseconds.
  10. Click Finish.

Results

You have run the mobile test on multiple Android devices that are avialble on the BrowserStack Cloud.

What to do next

You can view the test result that is displayed as a unified report for mobile tests and choose to export the unified report. See Unified reports.

If you opted to collect the Resource Monitoring metrics, you can view the metrics displayed graphically in the UI Test Statistical report. You can analyze the Resource Monitoring metrics to manage the resources of the device or the mobile application under test. See UI Test Statistical report.