Generate Run Code for BitBar Dialog

Applies to TestComplete 14.80, last modified on May 04, 2021

Use the Generate Run Code dialog to generate script code that will connect to either a mobile device running in the BitBar device cloud or to a device controlled by a private Appium server (on your local computer or on a remote computer in your local network) and will open a testing session on this device.

Generate run code for BitBar dialog

Click the image to enlarge it.

To call the dialog

Click on the Code Editor toolbar in TestComplete.

Requirements

  • An active license for TestComplete Mobile Module.

  • The Appium Support plugin must be enabled in TestComplete. You can check the plugin state in the File > Install Extensions dialog in TestComplete. You can find the plugin in the Mobile group.

  • Access to the server that controls your mobile devices. It can be one of the following:

    • A mobile device cloud provided as a service by BitBar.

      If you do not have a BitBar account, you can sign up for a free trial on the BitBar website:

      bitbar.com/signup

      To access the cloud from TestComplete tests, use the API key assigned to your BitBar account. See the Prerequisites section.

    – or –

    • A private server managed by the Appium framework. It can run on your current computer or on a remote computer in your local network. The supported Appium version is 1.18.2.

      To learn how to install and configure one, please see the Appium documentation.

      Note: Selenium, Selendroid, and other frameworks are not supported.

      For iOS testing: the XCUITest driver must be installed on your Appium server. See appium.io/docs/en/drivers/ios-xcuitest/.

      For Android testing: the UIAutomator2 driver must be installed on your Appium server. See appium.io/docs/en/drivers/android-uiautomator2.

      Note: Other automation drivers for iOS and Android are not supported.

Enter BitBar API Key

If you use BitBar and there is no BitBar API key specified in the current TestComplete project, enter the API key you will use to run tests and click Apply.

Learn how to get the API Key

If you use a private mobile cloud, click Local Appium.

Generate run code

For BitBar

1. Configure the code
  1. On the Parameters tab, select the mobile device and a tested application for which you want to open a testing session.

    The Found devices list contains all the devices that are available for you in BitBar and that match the search criteria. If needed, you can filter the list by using the Device Type, OS Version, Resolution and Quick Search filters. Select the device to which you want to connect.

  2. In the Application drop-down list box, select a mobile application for which you want to open a testing session. The application file must be either stored in the BitBar Files Library or added to the Tested Applications of the current TestComplete project. In the latter case, click Upload to BitBar to upload the application file to the BitBar Files Library and then select it in the list.

  3. If needed, on the Custom parameters tab, you can specify additional capabilities to be used for the testing session. Specify the capabilities in the JSON format. For example:

    JSON

    {
      "bitbar_project": "Automated tests",
      "bitbar_description": "Testing the Orders app"
    }

    The will validate the JSON code as you are typing it.

    For the list of available capabilities, see the BitBar Documentation - Desired Capabilities.

2. Copy the generated code

The dialog will generate the code based on the parameters you specify and will show the generated code in the lower part of the dialog. You can select and copy the code to the clipboard manually, or you can click Copy to clipboard. The dialog will copy the entire code to the clipboard and then close. Insert the code from the clipboard to the needed place in your code.

Click Close to close the dialog without copying anything.

For local Appium

1. Configure the code
  1. In the Server URL text box, enter the URL address of your Appium server.

  2. In the Application Path text editor, specify the full path to the application that you want to install on the target mobile device and from which you want to open a testing session. You can type the path manually, or you can click the ellipsis button and browse for the needed application file.

  3. In the Parameters editor, enter the capabilities that describe a testing session you want to open, in the JSON format. The dialog will validate the JSON code as you are typing.

    View required capabilities

    For information on all available capabilities, see Appium Desired Capabilities.

2. Copy the generated code

The dialog will generate the code based on the server URL and capabilities you specify and will show the generated code in the lower part of the dialog.

You can select and copy the code to the clipboard manually, or you can click Copy to clipboard. The dialog will copy the entire code to the clipboard and then close. Insert the code from the clipboard to the needed place in your code.

Click Close to close the dialog without copying anything.

See Also

About Mobile Tests
Connecting to Mobile Devices and Opening Testing Sessions

Highlight search results