Creating a Test for a Mobile Native Application

Before you can create a Silk4J test, you must have created a Silk4J project.

To record a new test for a mobile native application (app) on a mobile device:
  1. In the Package Explorer, select the project to which you want to add the new test.
  2. In the toolbar, click Record Actions.
  3. In the Select Mobile Device dialog box, perform the following actions:
    1. Select the mobile device, on which you want to test the app, from the list.
    2. Select the native mobile application.
      • If you want to install the app on the mobile device or emulator, click Browse to select the app file or enter the full path to the app file into the App file text field. Silk4J supports HTTP and UNC formats for the path.
      • If you want to use an app that is already installed on an Android device, select the app from the Package/Activity list or specify the package and the activity in the Package/Activity field.
      • If you want to use an app that is already installed on an iOS device, specify the Bundle ID.
      • If you want to use an app that is available in UFT Mobile, specify the App identifier.
  4. Click Record.
  5. The Recording window opens and displays the screen of the mobile device. In the screen, perform the actions that you want to record.
    1. Click on the object with which you want to interact. Silk4J performs the default action for the object. If there is no default action, or if you have to insert text, the Choose Action dialog box opens.
    2. Optional: To chose an action for an object, which might not be the default action, right-click on the object. The Choose Action dialog box opens.
    3. Optional: To record a swipe or a gesture, click and drag the mouse cursor.
    4. Optional: If the action has parameters, type the parameters into the parameter fields in the Choose Action dialog box. Silk4J automatically validates the parameters.
    5. Click OK to close the Choose Action dialog box. Silk4J adds the action to the recorded actions and replays it on the mobile device or emulator.
    For additional information, see Interacting with a Mobile Device.
  6. Click Stop. The Record Complete dialog box opens.
  7. The Source folder field is automatically populated with the source file location for the project that you selected. To use a different source folder, click Select and navigate to the folder that you want to use.
  8. Optional: In the Package text box, specify the package name.
    For example, type: com.example. To use an existing package, click Select and select the package that you want to use.
  9. In the Test class text box, specify the name for the test class.
    To use an existing class, click Select and select the class that you want to use.
  10. In the Test method text box, specify a name for the test method.
  11. Click OK.

Replay the test to ensure that it works as expected. You can modify the test to make changes if necessary.